Teach validate_config to validate lists of conditions (#95380)

* Teach validate_config to validate lists of conditions

* Update test
This commit is contained in:
Erik Montnemery 2023-06-27 19:44:23 +02:00 committed by GitHub
parent e8cb9fba7b
commit e18f7dffb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 6 deletions

View file

@ -1823,11 +1823,17 @@ async def test_integration_setup_info(
("key", "config"),
(
("trigger", {"platform": "event", "event_type": "hello"}),
("trigger", [{"platform": "event", "event_type": "hello"}]),
(
"condition",
{"condition": "state", "entity_id": "hello.world", "state": "paulus"},
),
(
"condition",
[{"condition": "state", "entity_id": "hello.world", "state": "paulus"}],
),
("action", {"service": "domain_test.test_service"}),
("action", [{"service": "domain_test.test_service"}]),
),
)
async def test_validate_config_works(websocket_client, key, config) -> None:
@ -1858,7 +1864,8 @@ async def test_validate_config_works(websocket_client, key, config) -> None:
},
(
"Unexpected value for condition: 'non_existing'. Expected and, device,"
" not, numeric_state, or, state, sun, template, time, trigger, zone"
" not, numeric_state, or, state, sun, template, time, trigger, zone "
"@ data[0]"
),
),
(