Skip to content

Commit

Permalink
Log failed to get token (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielhiversen authored Sep 21, 2020
1 parent 54c3c26 commit e5655f1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions custom_components/adax/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ async def _request(self, url, json_data=None, retry=3):
"password": self._password,
},
)
if response.status != 200:
_LOGGER.error("Adax: Failed to login to retrieve token: %s %s", response.status, response.reason)
return None
token_data = json.loads(await response.text())
self._access_token = token_data.get("access_token")
headers = {"Authorization": f"Bearer {self._access_token}"}
Expand Down

0 comments on commit e5655f1

Please sign in to comment.