From 10c9132046ef117427698259ea5e19bbc12616eb Mon Sep 17 00:00:00 2001 From: Lewis Juggins Date: Mon, 17 Oct 2016 00:08:12 +0100 Subject: [PATCH] Resolve issue with delay not passing variables to render (#3901) --- homeassistant/helpers/script.py | 2 +- tests/helpers/test_script.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/homeassistant/helpers/script.py b/homeassistant/helpers/script.py index a5869915d46..f6a2f482fc1 100644 --- a/homeassistant/helpers/script.py +++ b/homeassistant/helpers/script.py @@ -94,7 +94,7 @@ class Script(): delay = vol.All( cv.time_period, cv.positive_timedelta)( - delay.async_render()) + delay.async_render(variables)) self._async_unsub_delay_listener = \ async_track_point_in_utc_time( diff --git a/tests/helpers/test_script.py b/tests/helpers/test_script.py index b4febc83048..93bf0268337 100644 --- a/tests/helpers/test_script.py +++ b/tests/helpers/test_script.py @@ -222,7 +222,7 @@ class TestScriptHelper(unittest.TestCase): 'hello': '{{ greeting }}', }, }, - {'delay': {'seconds': 5}}, + {'delay': '{{ delay_period }}'}, { 'service': 'test.script', 'data_template': { @@ -233,6 +233,7 @@ class TestScriptHelper(unittest.TestCase): script_obj.run({ 'greeting': 'world', 'greeting2': 'universe', + 'delay_period': '00:00:05' }) self.hass.block_till_done()