Eagerly shutdown unifiprotect at the stop event (#113655)

This commit is contained in:
J. Nick Koston 2024-03-16 17:04:04 -10:00 committed by GitHub
parent 69564b1a17
commit ba7ec4ac16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -110,7 +110,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = data_service
entry.async_on_unload(entry.add_update_listener(_async_options_updated))
entry.async_on_unload(
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, data_service.async_stop)
hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_STOP, data_service.async_stop, run_immediately=True
)
)
if not entry.options.get(CONF_ALLOW_EA, False) and (