diff --git a/blinkpy/auth.py b/blinkpy/auth.py index 8f5a7de1..59967f63 100644 --- a/blinkpy/auth.py +++ b/blinkpy/auth.py @@ -132,6 +132,7 @@ def extract_login_info(self): self.token = self.login_response["auth"]["token"] self.client_id = self.login_response["account"]["client_id"] self.account_id = self.login_response["account"]["account_id"] + self.user_id = self.login_response["account"].get("user_id", None) async def startup(self): """Initialize tokens for communication.""" diff --git a/blinkpy/blinkpy.py b/blinkpy/blinkpy.py index e46a2c56..aa5be02b 100644 --- a/blinkpy/blinkpy.py +++ b/blinkpy/blinkpy.py @@ -192,7 +192,7 @@ async def setup_owls(self): network_list.append(str(network_id)) self.sync[name] = BlinkOwl(self, name, network_id, owl) await self.sync[name].start() - except KeyError: + except (KeyError, TypeError): # No sync-less devices found pass @@ -222,7 +222,7 @@ async def setup_lotus(self): network_list.append(str(network_id)) self.sync[name] = BlinkLotus(self, name, network_id, lotus) await self.sync[name].start() - except KeyError: + except (KeyError, TypeError): # No sync-less devices found pass diff --git a/tests/test_auth.py b/tests/test_auth.py index 0d6168e9..b0f5122f 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -167,6 +167,7 @@ async def test_refresh_token(self, mock_resp): self.assertEqual(self.auth.token, "foobar") self.assertEqual(self.auth.client_id, 1234) self.assertEqual(self.auth.account_id, 5678) + self.assertEqual(self.auth.user_id, None) mock_resp.return_value.status = 400 with self.assertRaises(TokenRefreshFailed):