1
0
mirror of https://github.com/USA-RedDragon/badnest.git synced 2025-01-18 19:40:42 +00:00

Improve error messages when user_id is unavailable

This commit is contained in:
Andrew Ash 2020-04-19 00:13:27 -07:00 committed by GitHub
parent 7ab48d968e
commit 4f67bf4b49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -127,6 +127,7 @@ class NestAPI():
return self._get_cameras()
def _get_devices(self):
assert self._user_id, "No user_id found; check configuration"
try:
r = self._session.post(
f"{API_URL}/api/0.1/user/{self._user_id}/app_launch",
@ -178,6 +179,7 @@ class NestAPI():
return "Unknown"
def update(self):
assert self._user_id, "No user_id found; check configuration"
try:
# To get friendly names
r = self._session.post(