Do not try to reconnect shelly on disconnected if Home Assistant is stopping (#83805)

This commit is contained in:
J. Nick Koston 2022-12-11 21:33:58 -10:00 committed by GitHub
parent 80a8d5443d
commit d91e44485c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -479,8 +479,9 @@ class ShellyRpcCoordinator(DataUpdateCoordinator):
return return
self.connected = False self.connected = False
self._async_run_disconnected_events() self._async_run_disconnected_events()
# Try to reconnect right away # Try to reconnect right away if hass is not stopping
await self.async_request_refresh() if not self.hass.is_stopping:
await self.async_request_refresh()
@callback @callback
def _async_run_disconnected_events(self) -> None: def _async_run_disconnected_events(self) -> None: