From 900e0c07bf346bad672cf2d3a55ff984dfc99a7d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 22 Mar 2024 23:51:03 -1000 Subject: [PATCH] Load light profiles in a task to avoid delaying platform setup (#114038) --- homeassistant/components/light/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/light/__init__.py b/homeassistant/components/light/__init__.py index 0a41ca2a84e..0045e2324ff 100644 --- a/homeassistant/components/light/__init__.py +++ b/homeassistant/components/light/__init__.py @@ -403,7 +403,9 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: # noqa: await component.async_setup(config) profiles = hass.data[DATA_PROFILES] = Profiles(hass) - await profiles.async_initialize() + # Profiles are loaded in a separate task to avoid delaying the setup + # of the light base platform. + hass.async_create_task(profiles.async_initialize(), eager_start=True) def preprocess_data(data: dict[str, Any]) -> dict[str | vol.Optional, Any]: """Preprocess the service data."""