pyotgw 2.2.0__tar.gz → 2.2.2__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.
- {pyotgw-2.2.0 → pyotgw-2.2.2}/PKG-INFO +2 -1
- {pyotgw-2.2.0 → pyotgw-2.2.2}/pyotgw/connection.py +9 -7
- {pyotgw-2.2.0 → pyotgw-2.2.2}/pyotgw.egg-info/PKG-INFO +2 -1
- {pyotgw-2.2.0 → pyotgw-2.2.2}/setup.py +1 -1
- {pyotgw-2.2.0 → pyotgw-2.2.2}/tests/test_connection.py +34 -0
- {pyotgw-2.2.0 → pyotgw-2.2.2}/LICENSE +0 -0
- {pyotgw-2.2.0 → pyotgw-2.2.2}/README.md +0 -0
- {pyotgw-2.2.0 → pyotgw-2.2.2}/pyotgw/__init__.py +0 -0
- {pyotgw-2.2.0 → pyotgw-2.2.2}/pyotgw/commandprocessor.py +0 -0
- {pyotgw-2.2.0 → pyotgw-2.2.2}/pyotgw/messageprocessor.py +0 -0
- {pyotgw-2.2.0 → pyotgw-2.2.2}/pyotgw/messages.py +0 -0
- {pyotgw-2.2.0 → pyotgw-2.2.2}/pyotgw/protocol.py +0 -0
- {pyotgw-2.2.0 → pyotgw-2.2.2}/pyotgw/pyotgw.py +0 -0
- {pyotgw-2.2.0 → pyotgw-2.2.2}/pyotgw/status.py +0 -0
- {pyotgw-2.2.0 → pyotgw-2.2.2}/pyotgw/vars.py +0 -0
- {pyotgw-2.2.0 → pyotgw-2.2.2}/pyotgw.egg-info/SOURCES.txt +0 -0
- {pyotgw-2.2.0 → pyotgw-2.2.2}/pyotgw.egg-info/dependency_links.txt +0 -0
- {pyotgw-2.2.0 → pyotgw-2.2.2}/pyotgw.egg-info/requires.txt +0 -0
- {pyotgw-2.2.0 → pyotgw-2.2.2}/pyotgw.egg-info/top_level.txt +0 -0
- {pyotgw-2.2.0 → pyotgw-2.2.2}/setup.cfg +0 -0
- {pyotgw-2.2.0 → pyotgw-2.2.2}/tests/test_commandprocessor.py +0 -0
- {pyotgw-2.2.0 → pyotgw-2.2.2}/tests/test_messageprocessor.py +0 -0
- {pyotgw-2.2.0 → pyotgw-2.2.2}/tests/test_messages.py +0 -0
- {pyotgw-2.2.0 → pyotgw-2.2.2}/tests/test_protocol.py +0 -0
- {pyotgw-2.2.0 → pyotgw-2.2.2}/tests/test_pyotgw.py +0 -0
- {pyotgw-2.2.0 → pyotgw-2.2.2}/tests/test_status.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyotgw
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.2
|
|
4
4
|
Summary: A library to interface with the opentherm gateway through serial or network connection.
|
|
5
5
|
Home-page: https://github.com/mvn23/pyotgw
|
|
6
6
|
Author: Milan van Nugteren
|
|
@@ -13,6 +13,7 @@ Classifier: License :: OSI Approved :: GNU General Public License v3 or later (G
|
|
|
13
13
|
Requires-Python: >=3.8
|
|
14
14
|
Description-Content-Type: text/markdown
|
|
15
15
|
License-File: LICENSE
|
|
16
|
+
Requires-Dist: pyserial-asyncio-fast
|
|
16
17
|
|
|
17
18
|
[](https://travis-ci.org/mvn23/pyotgw)
|
|
18
19
|
|
|
@@ -131,22 +131,24 @@ class ConnectionManager: # pylint: disable=too-many-instance-attributes
|
|
|
131
131
|
)
|
|
132
132
|
return transport, protocol
|
|
133
133
|
|
|
134
|
-
except
|
|
134
|
+
except asyncio.TimeoutError as err:
|
|
135
135
|
if not isinstance(err, type(self._error)):
|
|
136
136
|
_LOGGER.error(
|
|
137
|
-
"
|
|
138
|
-
"Will keep trying.
|
|
137
|
+
"The serial device on %s is not responding. "
|
|
138
|
+
"Will keep trying.",
|
|
139
139
|
self._port,
|
|
140
|
-
err,
|
|
141
140
|
)
|
|
142
141
|
self._error = err
|
|
142
|
+
if protocol:
|
|
143
|
+
await protocol.cleanup()
|
|
143
144
|
|
|
144
|
-
except
|
|
145
|
+
except (serial.SerialException, OSError) as err:
|
|
145
146
|
if not isinstance(err, type(self._error)):
|
|
146
147
|
_LOGGER.error(
|
|
147
|
-
"
|
|
148
|
-
"Will keep trying.",
|
|
148
|
+
"Could not connect to serial device on %s. "
|
|
149
|
+
"Will keep trying. Reported error was: %s",
|
|
149
150
|
self._port,
|
|
151
|
+
err,
|
|
150
152
|
)
|
|
151
153
|
self._error = err
|
|
152
154
|
if protocol:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyotgw
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.2
|
|
4
4
|
Summary: A library to interface with the opentherm gateway through serial or network connection.
|
|
5
5
|
Home-page: https://github.com/mvn23/pyotgw
|
|
6
6
|
Author: Milan van Nugteren
|
|
@@ -13,6 +13,7 @@ Classifier: License :: OSI Approved :: GNU General Public License v3 or later (G
|
|
|
13
13
|
Requires-Python: >=3.8
|
|
14
14
|
Description-Content-Type: text/markdown
|
|
15
15
|
License-File: LICENSE
|
|
16
|
+
Requires-Dist: pyserial-asyncio-fast
|
|
16
17
|
|
|
17
18
|
[](https://travis-ci.org/mvn23/pyotgw)
|
|
18
19
|
|
|
@@ -290,6 +290,40 @@ async def test_attempt_connect_success(pygw_conn, pygw_proto):
|
|
|
290
290
|
init_and_wait.assert_called_once()
|
|
291
291
|
|
|
292
292
|
|
|
293
|
+
@pytest.mark.asyncio
|
|
294
|
+
async def test_attempt_connect_oserror(caplog, pygw_conn):
|
|
295
|
+
"""Test ConnectionManager._attempt_connect() with OSError"""
|
|
296
|
+
loop = asyncio.get_running_loop()
|
|
297
|
+
pygw_conn._port = "loop://"
|
|
298
|
+
|
|
299
|
+
with patch(
|
|
300
|
+
"serial_asyncio_fast.create_serial_connection",
|
|
301
|
+
side_effect=OSError,
|
|
302
|
+
) as create_serial_connection, patch.object(
|
|
303
|
+
pygw_conn,
|
|
304
|
+
"_get_retry_timeout",
|
|
305
|
+
return_value=0,
|
|
306
|
+
) as retry_timeout, caplog.at_level(
|
|
307
|
+
logging.ERROR
|
|
308
|
+
):
|
|
309
|
+
task = loop.create_task(pygw_conn._attempt_connect())
|
|
310
|
+
await called_x_times(retry_timeout, 2)
|
|
311
|
+
|
|
312
|
+
assert create_serial_connection.call_count >= 2
|
|
313
|
+
assert caplog.record_tuples == [
|
|
314
|
+
(
|
|
315
|
+
"pyotgw.connection",
|
|
316
|
+
logging.ERROR,
|
|
317
|
+
"Could not connect to serial device on loop://. "
|
|
318
|
+
"Will keep trying. Reported error was: ",
|
|
319
|
+
)
|
|
320
|
+
]
|
|
321
|
+
|
|
322
|
+
task.cancel()
|
|
323
|
+
with pytest.raises(asyncio.CancelledError):
|
|
324
|
+
await task
|
|
325
|
+
|
|
326
|
+
|
|
293
327
|
@pytest.mark.asyncio
|
|
294
328
|
async def test_attempt_connect_serialexception(caplog, pygw_conn):
|
|
295
329
|
"""Test ConnectionManager._attempt_connect() with SerialException"""
|
|
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
|
|
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
|