mirror of
https://github.com/home-assistant/core.git
synced 2025-07-30 02:38:10 +02: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:
@ -859,9 +859,9 @@ def handle_fire_event(
|
||||
@decorators.websocket_command(
|
||||
{
|
||||
vol.Required("type"): "validate_config",
|
||||
vol.Optional("trigger"): cv.match_all,
|
||||
vol.Optional("condition"): cv.match_all,
|
||||
vol.Optional("action"): cv.match_all,
|
||||
vol.Optional("triggers"): cv.match_all,
|
||||
vol.Optional("conditions"): cv.match_all,
|
||||
vol.Optional("actions"): cv.match_all,
|
||||
}
|
||||
)
|
||||
@decorators.async_response
|
||||
@ -876,9 +876,13 @@ async def handle_validate_config(
|
||||
result = {}
|
||||
|
||||
for key, schema, validator in (
|
||||
("trigger", cv.TRIGGER_SCHEMA, trigger.async_validate_trigger_config),
|
||||
("condition", cv.CONDITIONS_SCHEMA, condition.async_validate_conditions_config),
|
||||
("action", cv.SCRIPT_SCHEMA, script.async_validate_actions_config),
|
||||
("triggers", cv.TRIGGER_SCHEMA, trigger.async_validate_trigger_config),
|
||||
(
|
||||
"conditions",
|
||||
cv.CONDITIONS_SCHEMA,
|
||||
condition.async_validate_conditions_config,
|
||||
),
|
||||
("actions", cv.SCRIPT_SCHEMA, script.async_validate_actions_config),
|
||||
):
|
||||
if key not in msg:
|
||||
continue
|
||||
|
Reference in New Issue
Block a user