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 2018-11-19 04:14:00 -06:00 committed by Paulus Schoutsen
parent 089a2f4e71
commit 83b4e56978
2 changed files with 41 additions and 19 deletions

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):