Update scripts command, Scripts documentation

This commit is contained in:
Griatch 2021-03-07 17:41:48 +01:00
parent b5195a6e96
commit e1762c8b2f
9 changed files with 386 additions and 318 deletions

View file

@ -515,19 +515,8 @@ class ScriptBase(ScriptDB, metaclass=TypeclassBase):
"""
self._start_task(interval=interval, start_delay=start_delay, repeats=repeats, **kwargs)
def update(self, interval=None, start_delay=None, repeats=None, **kwargs):
"""
Update the Script's timer component with new settings.
Keyword Args:
interval (int): How often to fire `at_repeat` in seconds.
start_delay (int): If the start of ticking should be delayed.
repeats (int): How many repeats. 0 for infinite repeats.
**kwargs: Optional (default unused) kwargs passed on into the `at_start` hook.
"""
self._start_task(interval=interval, start_delay=start_delay,
repeats=repeats, force_restart=True, **kwargs)
# legacy alias
update = start
def stop(self, **kwargs):
"""