Fix timer.finish to cancel callback (#48549)
Timer.finish doesn't cancel the callback, which can lead to incorrect early cancellation of the timer if it is subsequently restarted. Bug reported here: https://community.home-assistant.io/t/timer-component-timer-stops-before-time-is-up/96038
This commit is contained in:
parent
6ce96dcb63
commit
9d085778c2
1 changed files with 3 additions and 1 deletions
|
@ -327,7 +327,9 @@ class Timer(RestoreEntity):
|
|||
if self._state != STATUS_ACTIVE:
|
||||
return
|
||||
|
||||
self._listener = None
|
||||
if self._listener:
|
||||
self._listener()
|
||||
self._listener = None
|
||||
self._state = STATUS_IDLE
|
||||
self._end = None
|
||||
self._remaining = None
|
||||
|
|
Loading…
Add table
Reference in a new issue