From dc5f7aedd716347a831844d192b5f219188c8799 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 20 Nov 2020 15:57:57 +0100 Subject: [PATCH] Verify that we register blueprints on automation setup (#43434) --- homeassistant/components/automation/__init__.py | 3 +++ tests/components/blueprint/test_websocket_api.py | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/automation/__init__.py b/homeassistant/components/automation/__init__.py index 74a319242ec..e91aa687b21 100644 --- a/homeassistant/components/automation/__init__.py +++ b/homeassistant/components/automation/__init__.py @@ -163,6 +163,9 @@ async def async_setup(hass, config): """Set up the automation.""" hass.data[DOMAIN] = component = EntityComponent(LOGGER, DOMAIN, hass) + # To register the automation blueprints + async_get_blueprints(hass) + await _async_process_config(hass, config, component) async def trigger_service_handler(entity, service_call): diff --git a/tests/components/blueprint/test_websocket_api.py b/tests/components/blueprint/test_websocket_api.py index c948494cca0..32b7e7748e5 100644 --- a/tests/components/blueprint/test_websocket_api.py +++ b/tests/components/blueprint/test_websocket_api.py @@ -3,7 +3,6 @@ from pathlib import Path import pytest -from homeassistant.components import automation from homeassistant.setup import async_setup_component from tests.async_mock import Mock, patch @@ -15,7 +14,7 @@ async def setup_bp(hass): assert await async_setup_component(hass, "blueprint", {}) # Trigger registration of automation blueprints - automation.async_get_blueprints(hass) + await async_setup_component(hass, "automation", {}) async def test_list_blueprints(hass, hass_ws_client):