mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 19:18:20 +00:00
Catch APIRateLimit in Honeywell (#107806)
This commit is contained in:
parent
9e47d03086
commit
3b7271d597
@ -7,6 +7,7 @@ from typing import Any
|
|||||||
|
|
||||||
from aiohttp import ClientConnectionError
|
from aiohttp import ClientConnectionError
|
||||||
from aiosomecomfort import (
|
from aiosomecomfort import (
|
||||||
|
APIRateLimited,
|
||||||
AuthError,
|
AuthError,
|
||||||
ConnectionError as AscConnectionError,
|
ConnectionError as AscConnectionError,
|
||||||
SomeComfortError,
|
SomeComfortError,
|
||||||
@ -505,10 +506,11 @@ class HoneywellUSThermostat(ClimateEntity):
|
|||||||
await self._device.refresh()
|
await self._device.refresh()
|
||||||
|
|
||||||
except (
|
except (
|
||||||
|
asyncio.TimeoutError,
|
||||||
|
AscConnectionError,
|
||||||
|
APIRateLimited,
|
||||||
AuthError,
|
AuthError,
|
||||||
ClientConnectionError,
|
ClientConnectionError,
|
||||||
AscConnectionError,
|
|
||||||
asyncio.TimeoutError,
|
|
||||||
):
|
):
|
||||||
self._retry += 1
|
self._retry += 1
|
||||||
self._attr_available = self._retry <= RETRY
|
self._attr_available = self._retry <= RETRY
|
||||||
@ -524,7 +526,12 @@ class HoneywellUSThermostat(ClimateEntity):
|
|||||||
await _login()
|
await _login()
|
||||||
return
|
return
|
||||||
|
|
||||||
except (AscConnectionError, ClientConnectionError, asyncio.TimeoutError):
|
except (
|
||||||
|
asyncio.TimeoutError,
|
||||||
|
AscConnectionError,
|
||||||
|
APIRateLimited,
|
||||||
|
ClientConnectionError,
|
||||||
|
):
|
||||||
self._retry += 1
|
self._retry += 1
|
||||||
self._attr_available = self._retry <= RETRY
|
self._attr_available = self._retry <= RETRY
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user