Add last triggered to script (#5261)
* Add last triggered to script * Add tests for script last_triggered
This commit is contained in:
parent
82d037a828
commit
467cb18625
3 changed files with 23 additions and 0 deletions
|
@ -46,6 +46,7 @@ class Script():
|
|||
self._change_listener = change_listener
|
||||
self._cur = -1
|
||||
self.last_action = None
|
||||
self.last_triggered = None
|
||||
self.can_cancel = any(CONF_DELAY in action for action
|
||||
in self.sequence)
|
||||
self._async_unsub_delay_listener = None
|
||||
|
@ -68,6 +69,7 @@ class Script():
|
|||
|
||||
This method is a coroutine.
|
||||
"""
|
||||
self.last_triggered = date_util.utcnow()
|
||||
if self._cur == -1:
|
||||
self._log('Running script')
|
||||
self._cur = 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue