Fix Shelly sleeping Gen2 device updates (#86198)

pull/86202/head
Shay Levy 2023-01-19 01:11:40 +02:00 committed by GitHub
parent 37c1052cce
commit 0dabbcfca1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -475,6 +475,11 @@ class ShellyRpcCoordinator(DataUpdateCoordinator[None]):
async def _async_disconnected(self) -> None:
"""Handle device disconnected."""
# Sleeping devices send data and disconnects
# There are no disconnect events for sleeping devices
if self.entry.data.get(CONF_SLEEP_PERIOD):
return
async with self._connection_lock:
if not self.connected: # Already disconnected
return