Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tridonic: fix AssertionFailure #142

Merged
merged 2 commits into from
Aug 2, 2024
Merged
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
15 changes: 10 additions & 5 deletions dali/driver/hid.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ async def _bus_watch(self):
self._log.debug("bus_watch message %s", _hex(message[0:9]))
origin, rtype, raw_frame, interval, seq = self._resptmpl.unpack(message)
if origin not in (self._MODE_OBSERVE, self._MODE_RESPONSE):
self._log.debug("bus_watch: unexpected packet mode, ignoring")
self._log.warning("bus_watch: unexpected packet mode, ignoring")
continue
if rtype == self._RESPONSE_FRAME_DALI16:
frame = dali.frame.ForwardFrame(16, raw_frame)
Expand All @@ -545,7 +545,7 @@ async def _bus_watch(self):
# We are waiting for a repeat of the command
if timeout:
# We didn't get it: report a failed command
self._log.debug("Failed sendtwice command: %s", current_command)
self._log.warning("Failed sendtwice command: %s", current_command)
self.bus_traffic._invoke(current_command, None, True)
current_command = None
continue
Expand All @@ -557,18 +557,23 @@ async def _bus_watch(self):
current_command = None
continue
else:
self._log.debug("Failed config command (second frame didn't match): %s", current_command)
self._log.warning("Failed config command (second frame didn't match): %s", current_command)
self.bus_traffic._invoke(current_command, None, True)
current_command = None
# Fall through to continue processing frame
elif isinstance(frame, dali.frame.BackwardFrame):
# Error: config commands don't get backward frames.
self._log.debug("Failed config command %s with backward frame",
self._log.error("Failed config command %s with backward frame",
current_command)
self.bus_traffic._invoke(current_command, None, True)
current_command = None
elif frame == "no":
self._log.warning("No frame in response to a sendtwice command: %s", current_command)
self.bus_traffic._invoke(current_command, None, True)
current_command = None
continue
else:
self._log.debug("Unexpected response waiting for retransmit of config command")
self._log.error("Unexpected response waiting for retransmit of config command, frame = %s", frame)
elif current_command.response:
# We are waiting for a response
if timeout or frame == "no":
Expand Down
Loading