1
mirror of https://github.com/home-assistant/core synced 2024-08-02 23:40:32 +02: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:
youknowjack0 2021-04-01 09:32:59 -07:00 committed by GitHub
parent 6ce96dcb63
commit 9d085778c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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