Adjust automation to plural triggers/conditions/actions keys (#123823)

* Adjust automation to plural triggers/conditions/actions keys

* Fix some tests

* Adjust websocket tests

* Fix search tests

* Convert blueprint and blueprint inputs to modern schema

* Pass schema when creating Blueprint object

* Update tests

* Adjust websocket api

---------

Co-authored-by: Joostlek <joostlek@outlook.com>
Co-authored-by: Erik <erik@montnemery.com>
This commit is contained in:
Franck Nijhof
2024-09-24 20:03:23 +02:00
committed by GitHub
parent 08bdf797f0
commit 9dfabc3fb7
25 changed files with 488 additions and 183 deletions

View File

@@ -2566,18 +2566,18 @@ async def test_integration_setup_info(
@pytest.mark.parametrize(
("key", "config"),
[
("trigger", {"platform": "event", "event_type": "hello"}),
("trigger", [{"platform": "event", "event_type": "hello"}]),
("triggers", {"platform": "event", "event_type": "hello"}),
("triggers", [{"platform": "event", "event_type": "hello"}]),
(
"condition",
"conditions",
{"condition": "state", "entity_id": "hello.world", "state": "paulus"},
),
(
"condition",
"conditions",
[{"condition": "state", "entity_id": "hello.world", "state": "paulus"}],
),
("action", {"service": "domain_test.test_service"}),
("action", [{"service": "domain_test.test_service"}]),
("actions", {"service": "domain_test.test_service"}),
("actions", [{"service": "domain_test.test_service"}]),
],
)
async def test_validate_config_works(
@@ -2599,13 +2599,13 @@ async def test_validate_config_works(
[
# Raises vol.Invalid
(
"trigger",
"triggers",
{"platform": "non_existing", "event_type": "hello"},
"Invalid platform 'non_existing' specified",
),
# Raises vol.Invalid
(
"condition",
"conditions",
{
"condition": "non_existing",
"entity_id": "hello.world",
@@ -2619,7 +2619,7 @@ async def test_validate_config_works(
),
# Raises HomeAssistantError
(
"condition",
"conditions",
{
"above": 50,
"condition": "device",
@@ -2632,7 +2632,7 @@ async def test_validate_config_works(
),
# Raises vol.Invalid
(
"action",
"actions",
{"non_existing": "domain_test.test_service"},
"Unable to determine action @ data[0]",
),