Catch APIRateLimit in Honeywell (#107806)
This commit is contained in:
parent
2d88b77813
commit
168657b724
1 changed files with 10 additions and 4 deletions
|
@ -6,6 +6,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,
|
||||||
|
@ -504,10 +505,11 @@ class HoneywellUSThermostat(ClimateEntity):
|
||||||
await self._device.refresh()
|
await self._device.refresh()
|
||||||
|
|
||||||
except (
|
except (
|
||||||
|
TimeoutError,
|
||||||
|
AscConnectionError,
|
||||||
|
APIRateLimited,
|
||||||
AuthError,
|
AuthError,
|
||||||
ClientConnectionError,
|
ClientConnectionError,
|
||||||
AscConnectionError,
|
|
||||||
TimeoutError,
|
|
||||||
):
|
):
|
||||||
self._retry += 1
|
self._retry += 1
|
||||||
self._attr_available = self._retry <= RETRY
|
self._attr_available = self._retry <= RETRY
|
||||||
|
@ -522,8 +524,12 @@ class HoneywellUSThermostat(ClimateEntity):
|
||||||
except UnauthorizedError:
|
except UnauthorizedError:
|
||||||
await _login()
|
await _login()
|
||||||
return
|
return
|
||||||
|
except (
|
||||||
except (AscConnectionError, ClientConnectionError, TimeoutError):
|
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…
Add table
Reference in a new issue