Eagerly shutdown homekit_controller at the stop event (#113650)

This commit is contained in:
J. Nick Koston 2024-03-16 17:15:46 -10:00 committed by GitHub
parent 4d430520a0
commit 309fcb5c30
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View file

@ -77,7 +77,9 @@ async def async_get_controller(hass: HomeAssistant) -> Controller:
# Right now _async_stop_homekit_controller is only called on HA exiting
# So we don't have to worry about leaking a callback here.
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, _async_stop_homekit_controller)
hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_STOP, _async_stop_homekit_controller, run_immediately=True
)
await controller.async_start()