Load light profiles in a task to avoid delaying platform setup (#114038)

pull/114067/head
J. Nick Koston 2024-03-22 23:51:03 -10:00 committed by GitHub
parent 4f22c85e39
commit 900e0c07bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -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."""