Catch APIRateLimit in Honeywell (#107806)

This commit is contained in:
mkmer 2024-02-08 04:51:20 -05:00 committed by Franck Nijhof
parent 9e47d03086
commit 3b7271d597
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3

View File

@ -7,6 +7,7 @@ from typing import Any
from aiohttp import ClientConnectionError
from aiosomecomfort import (
APIRateLimited,
AuthError,
ConnectionError as AscConnectionError,
SomeComfortError,
@ -505,10 +506,11 @@ class HoneywellUSThermostat(ClimateEntity):
await self._device.refresh()
except (
asyncio.TimeoutError,
AscConnectionError,
APIRateLimited,
AuthError,
ClientConnectionError,
AscConnectionError,
asyncio.TimeoutError,
):
self._retry += 1
self._attr_available = self._retry <= RETRY
@ -524,7 +526,12 @@ class HoneywellUSThermostat(ClimateEntity):
await _login()
return
except (AscConnectionError, ClientConnectionError, asyncio.TimeoutError):
except (
asyncio.TimeoutError,
AscConnectionError,
APIRateLimited,
ClientConnectionError,
):
self._retry += 1
self._attr_available = self._retry <= RETRY
return