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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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)