Properly handle Shelly gen2 device disconnect (#71937)

This commit is contained in:
Simone Chemelli
2022-05-16 12:50:03 +02:00
committed by GitHub
parent f7a2a6ea21
commit 0ee838b25e

View File

@@ -812,7 +812,7 @@ class RpcPollingWrapper(update_coordinator.DataUpdateCoordinator):
LOGGER.debug("Polling Shelly RPC Device - %s", self.name)
async with async_timeout.timeout(AIOSHELLY_DEVICE_TIMEOUT_SEC):
await self.device.update_status()
except OSError as err:
except (OSError, aioshelly.exceptions.RPCTimeout) as err:
raise update_coordinator.UpdateFailed("Device disconnected") from err
@property