Log delay and wait_template steps in scripts (#18448)

* Log delay and wait_template steps in scripts

Help improve script debugging by logging delay and wait_template steps in scripts.

* Update tests

* Fix lint issue
This commit is contained in:
Phil Bruckner authored and Paulus Schoutsen committed 2018-11-19 11:14:00 +01:00
1 parent 089a2f4e71
commit 83b4e56978
2 files changed
+41 -19

No files matched your search

+7
View File
@@ -120,6 +120,10 @@ class Script():
self.name, ex)
break
self.last_action = action.get(
CONF_ALIAS, 'delay {}'.format(delay))
self._log("Executing step %s" % self.last_action)
unsub = async_track_point_in_utc_time(
self.hass, async_script_delay,
date_util.utcnow() + delay
@@ -136,6 +140,9 @@ class Script():
wait_template = action[CONF_WAIT_TEMPLATE]
wait_template.hass = self.hass
self.last_action = action.get(CONF_ALIAS, 'wait template')
self._log("Executing step %s" % self.last_action)
# check if condition already okay
if condition.async_template(
self.hass, wait_template, variables):