Skip to content

Commit

Permalink
Fix race when during timeout of IP connection request (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Aug 17, 2024
1 parent 3c28be8 commit fd91472
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion aiohomekit/controller/ip/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ def _cancel_pending_requests(self) -> None:
# fire, so set them to an error state.
while self.result_cbs:
result = self.result_cbs.pop(0)
result.set_exception(AccessoryDisconnectedError("Connection closed"))
if not result.done():
result.set_exception(AccessoryDisconnectedError("Connection closed"))


class SecureHomeKitProtocol(InsecureHomeKitProtocol):
Expand Down

0 comments on commit fd91472

Please sign in to comment.