From c9fd97c6a34e147bc37f65d457903f059bbe4ffa Mon Sep 17 00:00:00 2001 From: "David F. Mulcahey" Date: Mon, 5 Feb 2024 02:58:08 -0500 Subject: [PATCH] Buffer TImeoutError in Flo (#109675) --- homeassistant/components/flo/device.py | 2 +- tests/components/flo/test_device.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/flo/device.py b/homeassistant/components/flo/device.py index 3b7469686b4..0c805b932cb 100644 --- a/homeassistant/components/flo/device.py +++ b/homeassistant/components/flo/device.py @@ -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 diff --git a/tests/components/flo/test_device.py b/tests/components/flo/test_device.py index 884c9e3ca7e..34abfef0e72 100644 --- a/tests/components/flo/test_device.py +++ b/tests/components/flo/test_device.py @@ -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