Skip to content

Commit 60c8878

Browse files
committed
Prevent the error "task_done() called too many times"
Move `self._cmd_q.task_done()` outside the while loop.
1 parent 6047ab6 commit 60c8878

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

custom_components/jablotron80/jablotron.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,10 +794,11 @@ async def read_send_packet_loop(self) -> None:
794794
send_cmd.confirm(True)
795795
if send_cmd.name == "Details":
796796
self.update_devices = True
797-
self._cmd_q.task_done()
798797

799798
retries -= 1
800799

800+
self._cmd_q.task_done()
801+
801802
except Exception:
802803
LOGGER.exception("Unexpected error in packet loop")
803804
self.disconnect()

0 commit comments

Comments
 (0)