Skip to content

Commit

Permalink
Merge pull request #455 from mrw298/fix/ha-sensor-update
Browse files Browse the repository at this point in the history
fix: Increase data update timeout for slower selenium based tests
  • Loading branch information
dp247 authored Dec 1, 2023
2 parents cf404cc + 99135f6 commit a87121a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion custom_components/uk_bin_collection/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit a87121a

Please sign in to comment.