mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Increase async_timeout for wemo update polling (#46649)
This commit is contained in:
parent
facbd73130
commit
f7c0fc5553
@ -49,16 +49,16 @@ class WemoEntity(Entity):
|
|||||||
"""Update WeMo state.
|
"""Update WeMo state.
|
||||||
|
|
||||||
Wemo has an aggressive retry logic that sometimes can take over a
|
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
|
minute to return. If we don't get a state within the scan interval,
|
||||||
Wemo switch is unreachable. If update goes through, it will be made
|
assume the Wemo switch is unreachable. If update goes through, it will
|
||||||
available again.
|
be made available again.
|
||||||
"""
|
"""
|
||||||
# If an update is in progress, we don't do anything
|
# If an update is in progress, we don't do anything
|
||||||
if self._update_lock.locked():
|
if self._update_lock.locked():
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
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))
|
await asyncio.shield(self._async_locked_update(True))
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
_LOGGER.warning("Lost connection to %s", self.name)
|
_LOGGER.warning("Lost connection to %s", self.name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user