Fix race between script delay and turn_off (#16923)
This commit is contained in:
parent
c9b6567265
commit
720b05c301
1 changed files with 2 additions and 2 deletions
|
@ -95,7 +95,7 @@ class Script():
|
||||||
def async_script_delay(now):
|
def async_script_delay(now):
|
||||||
"""Handle delay."""
|
"""Handle delay."""
|
||||||
# pylint: disable=cell-var-from-loop
|
# pylint: disable=cell-var-from-loop
|
||||||
self._async_listener.remove(unsub)
|
self._async_remove_listener()
|
||||||
self.hass.async_create_task(
|
self.hass.async_create_task(
|
||||||
self.async_run(variables, context))
|
self.async_run(variables, context))
|
||||||
|
|
||||||
|
@ -240,7 +240,7 @@ class Script():
|
||||||
@callback
|
@callback
|
||||||
def async_script_timeout(now):
|
def async_script_timeout(now):
|
||||||
"""Call after timeout is retrieve."""
|
"""Call after timeout is retrieve."""
|
||||||
self._async_listener.remove(unsub)
|
self._async_remove_listener()
|
||||||
|
|
||||||
# Check if we want to continue to execute
|
# Check if we want to continue to execute
|
||||||
# the script after the timeout
|
# the script after the timeout
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue