mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Avoid some event loop overhead for ESPHome listeners (#113173)
This commit is contained in:
parent
b9837a561b
commit
4c82196fc8
@ -103,7 +103,7 @@ class ESPHomeDashboardManager:
|
||||
await dashboard.async_shutdown()
|
||||
|
||||
self._cancel_shutdown = hass.bus.async_listen_once(
|
||||
EVENT_HOMEASSISTANT_STOP, on_hass_stop
|
||||
EVENT_HOMEASSISTANT_STOP, on_hass_stop, run_immediately=True
|
||||
)
|
||||
|
||||
new_data = {"info": {"addon_slug": addon_slug, "host": host, "port": port}}
|
||||
|
@ -543,11 +543,15 @@ class ESPHomeManager:
|
||||
# "Unable to remove unknown listener
|
||||
# <function EventBus.async_listen_once.<locals>.onetime_listener>"
|
||||
entry_data.cleanup_callbacks.append(
|
||||
hass.bus.async_listen(EVENT_HOMEASSISTANT_STOP, self.on_stop)
|
||||
hass.bus.async_listen(
|
||||
EVENT_HOMEASSISTANT_STOP, self.on_stop, run_immediately=True
|
||||
)
|
||||
)
|
||||
entry_data.cleanup_callbacks.append(
|
||||
hass.bus.async_listen(
|
||||
EVENT_LOGGING_CHANGED, self._async_handle_logging_changed
|
||||
EVENT_LOGGING_CHANGED,
|
||||
self._async_handle_logging_changed,
|
||||
run_immediately=True,
|
||||
)
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user