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 Paulus Schoutsen
parent 75908f38f3
commit 16da181692
+3 -1
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