mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Resolve issue with delay not passing variables to render (#3901)
This commit is contained in:
parent
71ee847aee
commit
10c9132046
@ -94,7 +94,7 @@ class Script():
|
|||||||
delay = vol.All(
|
delay = vol.All(
|
||||||
cv.time_period,
|
cv.time_period,
|
||||||
cv.positive_timedelta)(
|
cv.positive_timedelta)(
|
||||||
delay.async_render())
|
delay.async_render(variables))
|
||||||
|
|
||||||
self._async_unsub_delay_listener = \
|
self._async_unsub_delay_listener = \
|
||||||
async_track_point_in_utc_time(
|
async_track_point_in_utc_time(
|
||||||
|
@ -222,7 +222,7 @@ class TestScriptHelper(unittest.TestCase):
|
|||||||
'hello': '{{ greeting }}',
|
'hello': '{{ greeting }}',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{'delay': {'seconds': 5}},
|
{'delay': '{{ delay_period }}'},
|
||||||
{
|
{
|
||||||
'service': 'test.script',
|
'service': 'test.script',
|
||||||
'data_template': {
|
'data_template': {
|
||||||
@ -233,6 +233,7 @@ class TestScriptHelper(unittest.TestCase):
|
|||||||
script_obj.run({
|
script_obj.run({
|
||||||
'greeting': 'world',
|
'greeting': 'world',
|
||||||
'greeting2': 'universe',
|
'greeting2': 'universe',
|
||||||
|
'delay_period': '00:00:05'
|
||||||
})
|
})
|
||||||
|
|
||||||
self.hass.block_till_done()
|
self.hass.block_till_done()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user