Skip to content

Commit

Permalink
Prevent unneeded Baichuan "Future exception was never retrieved" errors
Browse files Browse the repository at this point in the history
  • Loading branch information
starkillerOG committed Dec 9, 2024
1 parent 0e59ad9 commit a0cc098
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion reolink_aio/baichuan/baichuan.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ async def send(
return await self.send(cmd_id, channel, body, extension, enc_type, message_class, enc_offset, retry)
finally:
if cmd_id in self._protocol.receive_futures:
self._protocol.receive_futures[cmd_id].cancel()
if not self._protocol.receive_futures[cmd_id].done():
self._protocol.receive_futures[cmd_id].cancel()
self._protocol.receive_futures.pop(cmd_id, None)

# decryption
Expand Down

0 comments on commit a0cc098

Please sign in to comment.