mirror of
https://github.com/home-assistant/core.git
synced 2025-11-11 03:50:55 +00:00
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:
@@ -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]",
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user