Run apple_tv shutdown eagerly at the stop event (#113637)

The shutdown can be done without having to schedule a task on the event loop
This commit is contained in:
J. Nick Koston
2024-03-16 13:34:27 -10:00
committed by GitHub
parent e703baba0a
commit 44cac3c90a

View File

@@ -102,7 +102,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
await manager.disconnect()
entry.async_on_unload(
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, on_hass_stop)
hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_STOP, on_hass_stop, run_immediately=True
)
)
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)