Skip to content

Commit

Permalink
fix: Added exception for missing credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
Jelloeater committed May 9, 2023
1 parent 6b65f8f commit 8bac9ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@

n.n.n / 2023-05-08
n.n.n / 2023-05-09
==================



v2.3.0 / 2023-05-08
===================

* Release v2.3.0
* Release v2.3.0
* Merge branch 'fix/temp-sensor-missing'
* fix: Added specific device type of temp and env sensors
Expand Down
2 changes: 2 additions & 0 deletions hubitatcontrol/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def __init__(self, host, token, app_id, cloud_token=None):
@property
def devices(self) -> list:
r = requests.get(url=self.base_url_prefix + "/all", params={"access_token": self.token}, timeout=timeout)
if r.status_code == 403:
raise Exception("Check credentials")
return r.json()

def get_device(self, name: str):
Expand Down

0 comments on commit 8bac9ea

Please sign in to comment.