mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Fix exception after removing Shelly config entry and stopping HA (#51321)
* Fix device shutdown twice * Change if logic
This commit is contained in:
parent
b91696c139
commit
ed9b199372
@ -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, _):
|
||||
|
Loading…
x
Reference in New Issue
Block a user