Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions hass_apps/schedy/actor/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def __init__(self, entity_id: str, cfg: dict, room: "Room") -> None:

self._gave_up_sending = False
self._resending_timer = None # type: T.Optional[uuid.UUID]
self._resending_timer_cancelled = False

def __repr__(self) -> str:
return "<Actor {}>".format(str(self))
Expand Down Expand Up @@ -81,6 +82,9 @@ def _resending_cb(self, kwargs: dict) -> None:
self._gave_up_sending = True
return
if left_tries <= retries:
if self._resending_timer_cancelled:
self._resending_timer_cancelled = False
return
self.log("Re-sending value due to missing confirmation.", level="WARNING")

self.log(
Expand Down Expand Up @@ -117,6 +121,7 @@ def _state_cb(
if new_value is None:
return

self._resending_timer_cancelled = False
if new_value == self._wanted_value:
self.cancel_resending_timer()
self._gave_up_sending = False
Expand All @@ -140,6 +145,7 @@ def cancel_resending_timer(self) -> None:
return
self._resending_timer = None
self.app.cancel_timer(timer)
self._resending_timer_cancelled = True
self.log("Cancelled re-sending timer.", level="DEBUG")

def check_config_plausibility(self, state: dict) -> None:
Expand Down