mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
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
@ -327,7 +327,9 @@ class Timer(RestoreEntity):
|
|||||||
if self._state != STATUS_ACTIVE:
|
if self._state != STATUS_ACTIVE:
|
||||||
return
|
return
|
||||||
|
|
||||||
self._listener = None
|
if self._listener:
|
||||||
|
self._listener()
|
||||||
|
self._listener = None
|
||||||
self._state = STATUS_IDLE
|
self._state = STATUS_IDLE
|
||||||
self._end = None
|
self._end = None
|
||||||
self._remaining = None
|
self._remaining = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user