mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
Buffer TImeoutError in Flo (#109675)
This commit is contained in:
parent
0a8e4b5958
commit
c9fd97c6a3
@ -46,7 +46,7 @@ class FloDeviceDataUpdateCoordinator(DataUpdateCoordinator): # pylint: disable=
|
|||||||
await self._update_device()
|
await self._update_device()
|
||||||
await self._update_consumption_data()
|
await self._update_consumption_data()
|
||||||
self._failure_count = 0
|
self._failure_count = 0
|
||||||
except RequestError as error:
|
except (RequestError, TimeoutError) as error:
|
||||||
self._failure_count += 1
|
self._failure_count += 1
|
||||||
if self._failure_count > 3:
|
if self._failure_count > 3:
|
||||||
raise UpdateFailed(error) from error
|
raise UpdateFailed(error) from error
|
||||||
|
@ -117,7 +117,7 @@ async def test_device_failures(
|
|||||||
|
|
||||||
aioclient_mock.clear_requests()
|
aioclient_mock.clear_requests()
|
||||||
with patch(
|
with patch(
|
||||||
"homeassistant.components.flo.device.FloDeviceDataUpdateCoordinator.send_presence_ping",
|
"aioflo.presence.Presence.ping",
|
||||||
side_effect=RequestError,
|
side_effect=RequestError,
|
||||||
):
|
):
|
||||||
# simulate 4 updates failing. The failures should be buffered so that it takes 4
|
# simulate 4 updates failing. The failures should be buffered so that it takes 4
|
||||||
|
Loading…
x
Reference in New Issue
Block a user