Allow templates for enabling automation triggers (#114458)

* Allow templates for enabling automation triggers

* Test exception for non-limited template

* Use `cv.template` instead of `cv.template_complex`

* skip trigger with invalid enable template

instead of returning and thus not evaluating other triggers
This commit is contained in:
Matthias Alphart
2024-05-14 14:44:21 +02:00
committed by GitHub
parent 2a6a0e6230
commit ba48da7678
3 changed files with 97 additions and 4 deletions

View File

@ -1648,7 +1648,7 @@ TRIGGER_BASE_SCHEMA = vol.Schema(
vol.Required(CONF_PLATFORM): str,
vol.Optional(CONF_ID): str,
vol.Optional(CONF_VARIABLES): SCRIPT_VARIABLES_SCHEMA,
vol.Optional(CONF_ENABLED): boolean,
vol.Optional(CONF_ENABLED): vol.Any(boolean, template),
}
)