mirror of
https://github.com/home-assistant/core.git
synced 2025-08-01 03:35:09 +02:00
Schedule Unifi shutdown callback earlier (#33257)
This commit is contained in:
@@ -40,6 +40,8 @@ async def async_setup_entry(hass, config_entry):
|
|||||||
controller_id = get_controller_id_from_config_entry(config_entry)
|
controller_id = get_controller_id_from_config_entry(config_entry)
|
||||||
hass.data[DOMAIN][controller_id] = controller
|
hass.data[DOMAIN][controller_id] = controller
|
||||||
|
|
||||||
|
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, controller.shutdown)
|
||||||
|
|
||||||
if controller.mac is None:
|
if controller.mac is None:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@@ -53,8 +55,6 @@ async def async_setup_entry(hass, config_entry):
|
|||||||
# sw_version=config.raw['swversion'],
|
# sw_version=config.raw['swversion'],
|
||||||
)
|
)
|
||||||
|
|
||||||
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, controller.shutdown)
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user