Show more command data

This commit is contained in:
Andre Basche 2023-03-06 19:45:46 +01:00
parent 79a121263f
commit 43d61ab853
6 changed files with 22 additions and 12 deletions

View file

@ -92,8 +92,8 @@ 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_code >= 400 and not loop:
_LOGGER.error("%s - Error %s - %s", url, response.status_code, await response.text)
if response.status >= 400 and not loop:
_LOGGER.error("%s - Error %s - %s", url, response.status, await response.text)
await self.setup()
return await self.load_attributes(device, loop=True)
return (await response.json()).get("payload", {})