From 99135f6bd572e9395e008d36c49601f4ebc5b390 Mon Sep 17 00:00:00 2001 From: mrw298 <3275620+mrw298@users.noreply.github.com> Date: Thu, 30 Nov 2023 18:51:12 +0000 Subject: [PATCH] fix: Increase data update timeout for slower selenium based tests --- custom_components/uk_bin_collection/sensor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/custom_components/uk_bin_collection/sensor.py b/custom_components/uk_bin_collection/sensor.py index 0817449fe5..1769cdda41 100644 --- a/custom_components/uk_bin_collection/sensor.py +++ b/custom_components/uk_bin_collection/sensor.py @@ -131,12 +131,15 @@ def __init__(self, hass, ukbcd, name): self.name = name async def _async_update_data(self): - async with async_timeout.timeout(10): + async with async_timeout.timeout(30) as cm: _LOGGER.info(f"{LOG_PREFIX} UKBinCollectionApp Updating") data = await self.hass.async_add_executor_job(self.ukbcd.run) _LOGGER.info(f"{LOG_PREFIX} UKBinCollectionApp: {data}") + + if cm.expired: + _LOGGER.warning(f"{LOG_PREFIX} UKBinCollectionApp timeout expired during run") return get_latest_collection_info(json.loads(data))