File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
zha/application/platforms/cover Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -209,6 +209,14 @@ def on_add(self) -> None:
209209 )
210210 )
211211
212+ async def on_remove (self ) -> None :
213+ """Cancel tasks and timers this entity owns."""
214+ await super ().on_remove ()
215+ if self ._lift_transition_timer :
216+ self ._lift_transition_timer .cancel ()
217+ if self ._tilt_transition_timer :
218+ self ._tilt_transition_timer .cancel ()
219+
212220 def restore_external_state_attributes (
213221 self ,
214222 * ,
@@ -233,10 +241,11 @@ def restore_external_state_attributes(
233241 return
234242
235243 self ._state = state
236- self ._loop .call_later (
244+ restored_state_timer = self ._loop .call_later (
237245 DEFAULT_MOVEMENT_TIMEOUT ,
238246 functools .partial (self ._determine_cover_state , refresh = True ),
239247 )
248+ self ._on_remove_callbacks .append (restored_state_timer .cancel )
240249
241250 @property
242251 def supported_features (self ) -> CoverEntityFeature :
You can’t perform that action at this time.
0 commit comments