Buffer TImeoutError in Flo (#109675)
parent
0a8e4b5958
commit
c9fd97c6a3
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue