From f7c0fc55530adc4f0dd0cc3efb23ffd4a6477804 Mon Sep 17 00:00:00 2001 From: Eric Severance Date: Wed, 17 Feb 2021 04:17:16 -0800 Subject: [PATCH] Increase async_timeout for wemo update polling (#46649) --- homeassistant/components/wemo/entity.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/wemo/entity.py b/homeassistant/components/wemo/entity.py index e7c0712272c..2278cc854b2 100644 --- a/homeassistant/components/wemo/entity.py +++ b/homeassistant/components/wemo/entity.py @@ -49,16 +49,16 @@ class WemoEntity(Entity): """Update WeMo state. Wemo has an aggressive retry logic that sometimes can take over a - minute to return. If we don't get a state after 5 seconds, assume the - Wemo switch is unreachable. If update goes through, it will be made - available again. + minute to return. If we don't get a state within the scan interval, + assume the Wemo switch is unreachable. If update goes through, it will + be made available again. """ # If an update is in progress, we don't do anything if self._update_lock.locked(): return try: - with async_timeout.timeout(5): + with async_timeout.timeout(self.platform.scan_interval.seconds - 0.1): await asyncio.shield(self._async_locked_update(True)) except asyncio.TimeoutError: _LOGGER.warning("Lost connection to %s", self.name)