Implement support for complex templates in script delays (#16442)
* Implement support for complex templates in script delays * Swap out dict instead of collections.Mapping
This commit is contained in:
parent
98b92c78c0
commit
3d1c8ee467
3 changed files with 70 additions and 1 deletions
|
@ -107,6 +107,11 @@ class Script():
|
|||
cv.time_period,
|
||||
cv.positive_timedelta)(
|
||||
delay.async_render(variables))
|
||||
elif isinstance(delay, dict):
|
||||
delay_data = {}
|
||||
delay_data.update(
|
||||
template.render_complex(delay, variables))
|
||||
delay = cv.time_period(delay_data)
|
||||
except (TemplateError, vol.Invalid) as ex:
|
||||
_LOGGER.error("Error rendering '%s' delay template: %s",
|
||||
self.name, ex)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue