aiocomfoconnect 0.4.0__tar.gz → 0.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {aiocomfoconnect-0.4.0 → aiocomfoconnect-0.4.1}/PKG-INFO +1 -1
- {aiocomfoconnect-0.4.0 → aiocomfoconnect-0.4.1}/aiocomfoconnect/comfoconnect.py +15 -0
- {aiocomfoconnect-0.4.0 → aiocomfoconnect-0.4.1}/aiocomfoconnect/exceptions.py +9 -1
- {aiocomfoconnect-0.4.0 → aiocomfoconnect-0.4.1}/pyproject.toml +1 -1
- {aiocomfoconnect-0.4.0 → aiocomfoconnect-0.4.1}/LICENSE +0 -0
- {aiocomfoconnect-0.4.0 → aiocomfoconnect-0.4.1}/README.md +0 -0
- {aiocomfoconnect-0.4.0 → aiocomfoconnect-0.4.1}/aiocomfoconnect/__init__.py +0 -0
- {aiocomfoconnect-0.4.0 → aiocomfoconnect-0.4.1}/aiocomfoconnect/__main__.py +0 -0
- {aiocomfoconnect-0.4.0 → aiocomfoconnect-0.4.1}/aiocomfoconnect/bridge.py +0 -0
- {aiocomfoconnect-0.4.0 → aiocomfoconnect-0.4.1}/aiocomfoconnect/const.py +0 -0
- {aiocomfoconnect-0.4.0 → aiocomfoconnect-0.4.1}/aiocomfoconnect/discovery.py +0 -0
- {aiocomfoconnect-0.4.0 → aiocomfoconnect-0.4.1}/aiocomfoconnect/properties.py +0 -0
- {aiocomfoconnect-0.4.0 → aiocomfoconnect-0.4.1}/aiocomfoconnect/protobuf/nanopb_pb2.py +0 -0
- {aiocomfoconnect-0.4.0 → aiocomfoconnect-0.4.1}/aiocomfoconnect/protobuf/zehnder_pb2.py +0 -0
- {aiocomfoconnect-0.4.0 → aiocomfoconnect-0.4.1}/aiocomfoconnect/sensors.py +0 -0
- {aiocomfoconnect-0.4.0 → aiocomfoconnect-0.4.1}/aiocomfoconnect/util.py +0 -0
|
@@ -280,6 +280,21 @@ class ComfoConnect(Bridge):
|
|
|
280
280
|
raise AioComfoConnectNotConnected("Not connected to bridge")
|
|
281
281
|
return super().cmd_rmi_request(message, node_id)
|
|
282
282
|
|
|
283
|
+
async def _send(self, request, request_type, params: dict = None, reply: bool = True, timeout: float = None) -> Message:
|
|
284
|
+
"""Send a request, and close the connection when the bridge dropped our session.
|
|
285
|
+
|
|
286
|
+
The bridge can drop our session without closing the connection, e.g. when another app takes over a session with our
|
|
287
|
+
uuid. It then answers every request with NOT_ALLOWED (or OTHER_SESSION). Closing the connection lets the reconnect
|
|
288
|
+
loop start a new session. The request still raises its error.
|
|
289
|
+
"""
|
|
290
|
+
try:
|
|
291
|
+
return await super()._send(request, request_type, params, reply, timeout)
|
|
292
|
+
except (ComfoConnectNotAllowed, ComfoConnectOtherSession):
|
|
293
|
+
if self._connection_state == ConnectionState.CONNECTED and self._writer is not None:
|
|
294
|
+
_LOGGER.warning("The bridge dropped our session, reconnecting")
|
|
295
|
+
self._writer.close()
|
|
296
|
+
raise
|
|
297
|
+
|
|
283
298
|
async def disconnect(self):
|
|
284
299
|
"""Disconnect from the bridge and stop reconnecting. A connect() that is still busy fails."""
|
|
285
300
|
_LOGGER.debug("Stopping reconnection and disconnecting")
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
from .protobuf import zehnder_pb2
|
|
6
|
+
|
|
5
7
|
|
|
6
8
|
class AioComfoConnectError(Exception):
|
|
7
9
|
"""Base class for all errors raised by aiocomfoconnect."""
|
|
@@ -12,7 +14,13 @@ class ComfoConnectError(AioComfoConnectError):
|
|
|
12
14
|
|
|
13
15
|
def __init__(self, message):
|
|
14
16
|
cmd = getattr(message, "cmd", None)
|
|
15
|
-
|
|
17
|
+
if cmd is None:
|
|
18
|
+
text = str(message)
|
|
19
|
+
else:
|
|
20
|
+
result = zehnder_pb2.GatewayOperation.GatewayResult.Name(cmd.result) # pylint: disable=no-member
|
|
21
|
+
description = f": {cmd.resultDescription}" if cmd.resultDescription else ""
|
|
22
|
+
text = f"{result}{description} (reference {cmd.reference})"
|
|
23
|
+
super().__init__(text)
|
|
16
24
|
self.message = message
|
|
17
25
|
|
|
18
26
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "aiocomfoconnect"
|
|
3
|
-
version = "0.4.
|
|
3
|
+
version = "0.4.1"
|
|
4
4
|
description = "aiocomfoconnect is an asyncio Python 3 library for communicating with a Zehnder ComfoAir Q350/450/600 ventilation system"
|
|
5
5
|
authors = ["Michaël Arnauts <michael.arnauts@gmail.com>"]
|
|
6
6
|
license = "MIT"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|