diff --git a/aiohomekit/controller/ip/connection.py b/aiohomekit/controller/ip/connection.py index ca0cafe0..5378167d 100644 --- a/aiohomekit/controller/ip/connection.py +++ b/aiohomekit/controller/ip/connection.py @@ -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):