From ba7ec4ac165fc0dbe70158a700ab1da22684e935 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 16 Mar 2024 17:04:04 -1000 Subject: [PATCH] Eagerly shutdown unifiprotect at the stop event (#113655) --- homeassistant/components/unifiprotect/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/unifiprotect/__init__.py b/homeassistant/components/unifiprotect/__init__.py index 15784dbdeaf..71c887cd870 100644 --- a/homeassistant/components/unifiprotect/__init__.py +++ b/homeassistant/components/unifiprotect/__init__.py @@ -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 (