diff --git a/homeassistant/components/shelly/__init__.py b/homeassistant/components/shelly/__init__.py index ab0facea920..4d7b8654720 100644 --- a/homeassistant/components/shelly/__init__.py +++ b/homeassistant/components/shelly/__init__.py @@ -288,8 +288,10 @@ class ShellyDeviceWrapper(update_coordinator.DataUpdateCoordinator): def shutdown(self): """Shutdown the wrapper.""" - self.device.shutdown() - self._async_remove_device_updates_handler() + if self.device: + self.device.shutdown() + self._async_remove_device_updates_handler() + self.device = None @callback def _handle_ha_stop(self, _):