Fix Shelly sleeping Gen2 device updates (#86198)

This commit is contained in:
Shay Levy 2023-01-19 01:11:40 +02:00 committed by Paulus Schoutsen
parent 58beab1b59
commit 8dd0752bd0

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