diff --git a/homeassistant/components/automation/__init__.py b/homeassistant/components/automation/__init__.py index 3942ca6368f..0bd2ed87d20 100644 --- a/homeassistant/components/automation/__init__.py +++ b/homeassistant/components/automation/__init__.py @@ -298,8 +298,13 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: await _async_process_config(hass, config, component) # Add some default blueprints to blueprints/automation, does nothing - # if blueprints/automation already exists - await async_get_blueprints(hass).async_populate() + # if blueprints/automation already exists but still has to create + # an executor job to check if the folder exists so we run it in a + # separate task to avoid waiting for it to finish setting up + # since a tracked task will be waited at the end of startup + hass.async_create_task( + async_get_blueprints(hass).async_populate(), eager_start=True + ) async def trigger_service_handler( entity: BaseAutomationEntity, service_call: ServiceCall diff --git a/homeassistant/components/script/__init__.py b/homeassistant/components/script/__init__.py index 79ed69d2cdf..82752ed15bc 100644 --- a/homeassistant/components/script/__init__.py +++ b/homeassistant/components/script/__init__.py @@ -223,8 +223,13 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: await _async_process_config(hass, config, component) # Add some default blueprints to blueprints/script, does nothing - # if blueprints/script already exists - await async_get_blueprints(hass).async_populate() + # if blueprints/script already exists but still has to create + # an executor job to check if the folder exists so we run it in a + # separate task to avoid waiting for it to finish setting up + # since a tracked task will be waited at the end of startup + hass.async_create_task( + async_get_blueprints(hass).async_populate(), eager_start=True + ) async def reload_service(service: ServiceCall) -> None: """Call a service to reload scripts."""