Buffer TImeoutError in Flo (#109675)

pull/109689/head
David F. Mulcahey 2024-02-05 02:58:08 -05:00 committed by GitHub
parent 0a8e4b5958
commit c9fd97c6a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ class FloDeviceDataUpdateCoordinator(DataUpdateCoordinator): # pylint: disable=
await self._update_device()
await self._update_consumption_data()
self._failure_count = 0
except RequestError as error:
except (RequestError, TimeoutError) as error:
self._failure_count += 1
if self._failure_count > 3:
raise UpdateFailed(error) from error

View File

@ -117,7 +117,7 @@ async def test_device_failures(
aioclient_mock.clear_requests()
with patch(
"homeassistant.components.flo.device.FloDeviceDataUpdateCoordinator.send_presence_ping",
"aioflo.presence.Presence.ping",
side_effect=RequestError,
):
# simulate 4 updates failing. The failures should be buffered so that it takes 4