From d17f308c6afc6b01f7786acc3ff55e3ff045d695 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 2 Apr 2024 17:47:22 -1000 Subject: [PATCH] Small speed up to starting and stopping cloud (#114696) --- homeassistant/components/cloud/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/cloud/__init__.py b/homeassistant/components/cloud/__init__.py index d32278ba8f0..80c2e86a2a3 100644 --- a/homeassistant/components/cloud/__init__.py +++ b/homeassistant/components/cloud/__init__.py @@ -262,7 +262,9 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Shutdown event.""" await cloud.stop() - hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, _shutdown) + hass.bus.async_listen_once( + EVENT_HOMEASSISTANT_STOP, _shutdown, run_immediately=True + ) _remote_handle_prefs_updated(cloud) @@ -343,7 +345,8 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: DOMAIN, {"platform_loaded": tts_platform_loaded}, config, - ) + ), + eager_start=True, ) async_call_later(