diff --git a/pyhon/api.py b/pyhon/api.py index f53f3d3..b72ad7c 100644 --- a/pyhon/api.py +++ b/pyhon/api.py @@ -92,9 +92,10 @@ class HonConnection: } url = f"{const.API_URL}/commands/v1/context" async with self._session.get(url, params=params, headers=await self._headers) as response: - if response.status >= 400 and not loop: + if response.status == 403 and not loop: _LOGGER.error("%s - Error %s - %s", url, response.status, await response.text()) - await self.setup() + self._request_headers.pop("cognito-token", None) + self._request_headers.pop("id-token", None) return await self.load_attributes(device, loop=True) return (await response.json()).get("payload", {}) diff --git a/setup.py b/setup.py index a3be9f3..c3b4ba4 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ with open("README.md", "r") as f: setup( name="pyhOn", - version="0.3.3", + version="0.3.4", author="Andre Basche", description="Control hOn devices with python", long_description=long_description,