pypck 0.8.2__py3-none-any.whl → 0.8.4__py3-none-any.whl
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.
- pypck/connection.py +15 -5
- pypck/inputs.py +11 -1
- pypck/pck_commands.py +1 -1
- pypck/request_handlers.py +1 -1
- {pypck-0.8.2.dist-info → pypck-0.8.4.dist-info}/METADATA +2 -2
- pypck-0.8.4.dist-info/RECORD +15 -0
- {pypck-0.8.2.dist-info → pypck-0.8.4.dist-info}/WHEEL +1 -1
- pypck-0.8.2.dist-info/RECORD +0 -15
- {pypck-0.8.2.dist-info → pypck-0.8.4.dist-info}/LICENSE +0 -0
- {pypck-0.8.2.dist-info → pypck-0.8.4.dist-info}/top_level.txt +0 -0
pypck/connection.py
CHANGED
|
@@ -164,12 +164,22 @@ class PchkConnectionManager:
|
|
|
164
164
|
break
|
|
165
165
|
|
|
166
166
|
try:
|
|
167
|
-
message = data.decode().split(PckGenerator.TERMINATION)[0]
|
|
167
|
+
message = data.decode("utf-8").split(PckGenerator.TERMINATION)[0]
|
|
168
168
|
except UnicodeDecodeError as err:
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
169
|
+
try:
|
|
170
|
+
message = data.decode("cp1250").split(PckGenerator.TERMINATION)[
|
|
171
|
+
0
|
|
172
|
+
]
|
|
173
|
+
_LOGGER.warning(
|
|
174
|
+
"Incorrect PCK encoding detected, possibly caused by LinHK: %s - PCK recovered using cp1250",
|
|
175
|
+
err,
|
|
176
|
+
)
|
|
177
|
+
except UnicodeDecodeError as err2:
|
|
178
|
+
_LOGGER.warning(
|
|
179
|
+
"PCK decoding error: %s - skipping received PCK message",
|
|
180
|
+
err2,
|
|
181
|
+
)
|
|
182
|
+
continue
|
|
173
183
|
await self.process_message(message)
|
|
174
184
|
except asyncio.CancelledError:
|
|
175
185
|
pass
|
pypck/inputs.py
CHANGED
|
@@ -392,7 +392,17 @@ class ModSn(ModInput):
|
|
|
392
392
|
if matcher:
|
|
393
393
|
addr = LcnAddr(int(matcher.group("seg_id")), int(matcher.group("mod_id")))
|
|
394
394
|
hardware_serial = int(matcher.group("hardware_serial"), 16)
|
|
395
|
-
|
|
395
|
+
try:
|
|
396
|
+
manu = int(matcher.group("manu"), 16)
|
|
397
|
+
except (
|
|
398
|
+
ValueError
|
|
399
|
+
): # unconventional manufacturer code (e.g., due to LinHK VM)
|
|
400
|
+
manu = 0xFF
|
|
401
|
+
_LOGGER.debug(
|
|
402
|
+
"Unconventional manufacturer code: %s. Defaulting to 0x%02X",
|
|
403
|
+
matcher.group("manu"),
|
|
404
|
+
manu,
|
|
405
|
+
)
|
|
396
406
|
software_serial = int(matcher.group("software_serial"), 16)
|
|
397
407
|
try:
|
|
398
408
|
hardware_type = lcn_defs.HardwareType(
|
pypck/pck_commands.py
CHANGED
|
@@ -60,7 +60,7 @@ class PckParser:
|
|
|
60
60
|
# Pattern to parse serial number and firmware date responses.
|
|
61
61
|
PATTERN_SN = re.compile(
|
|
62
62
|
r"=M(?P<seg_id>\d{3})(?P<mod_id>\d{3})\.SN(?P<hardware_serial>[0-9|A-F]{10})"
|
|
63
|
-
r"(?P<manu
|
|
63
|
+
r"(?P<manu>.{2})FW(?P<software_serial>[0-9|A-F]{6})"
|
|
64
64
|
r"HW(?P<hardware_type>\d+)"
|
|
65
65
|
)
|
|
66
66
|
|
pypck/request_handlers.py
CHANGED
|
@@ -355,7 +355,7 @@ class GroupMembershipStaticRequestHandler(RequestHandler):
|
|
|
355
355
|
self,
|
|
356
356
|
addr_conn: ModuleConnection,
|
|
357
357
|
num_tries: int = 3,
|
|
358
|
-
timeout: float =
|
|
358
|
+
timeout: float = 1.5,
|
|
359
359
|
):
|
|
360
360
|
"""Initialize class instance."""
|
|
361
361
|
self.groups: set[LcnAddr] = set()
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
pypck/__init__.py,sha256=vjI-MSv-ght8Y_tcKPXYMjL-FGlHX6Z2ofrUBrz8g4U,317
|
|
2
|
+
pypck/connection.py,sha256=lvhQE4ndFfvA5Ns5vszTqEQpzG0p9dPoM3Ss3J7ap3w,24487
|
|
3
|
+
pypck/helpers.py,sha256=hEGId1pQ4wOJgIwNKDx17qKBlxvNxvspSrI0gSY3wCQ,1267
|
|
4
|
+
pypck/inputs.py,sha256=EMz5FsWTBpftHdRBBJ7A-6gXHPTDBiH_S1xqvZCiMco,40599
|
|
5
|
+
pypck/lcn_addr.py,sha256=N2Od8KuANOglqKjf596hJVH1SRcG7MhESKA5YYlDnbw,1946
|
|
6
|
+
pypck/lcn_defs.py,sha256=sU0uGYyCLrnl-1aaHe5BtPE1kExESiPGmJFGdv9FWCk,40610
|
|
7
|
+
pypck/module.py,sha256=o9SB-Gr2w6ZioJa0lpzOWW5IFtWsd1ojV3qgIVjJIxw,37314
|
|
8
|
+
pypck/pck_commands.py,sha256=Rtui9w7TTD5IPiemHVaoaoyIMw0t_BEI3RHm-SP_f0E,46793
|
|
9
|
+
pypck/request_handlers.py,sha256=6TvaWonhWcwDhqoUIS96xIj1_1lcUte2VLDMxovgJAs,24164
|
|
10
|
+
pypck/timeout_retry.py,sha256=5KiTDPzegym-6qi_mM4I8ChJbJjg9HXECFyAZt4c02w,3944
|
|
11
|
+
pypck-0.8.4.dist-info/LICENSE,sha256=iYB6zyMJvShfAzQE7nhYFgLzzZuBmhasLw5fYP9KRz4,1023
|
|
12
|
+
pypck-0.8.4.dist-info/METADATA,sha256=eXmEViNAiNF3dGvbbNkPotdJcpA_efTy3ucqfjZiKrM,5581
|
|
13
|
+
pypck-0.8.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
14
|
+
pypck-0.8.4.dist-info/top_level.txt,sha256=59ried49iFueDa5mQ_5BGVZcESjjzi4MZZKLcganvQA,6
|
|
15
|
+
pypck-0.8.4.dist-info/RECORD,,
|
pypck-0.8.2.dist-info/RECORD
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
pypck/__init__.py,sha256=vjI-MSv-ght8Y_tcKPXYMjL-FGlHX6Z2ofrUBrz8g4U,317
|
|
2
|
-
pypck/connection.py,sha256=AamliVspTxlzHkVeWocexRRMhEZ70bt5rI083BqWpHw,23987
|
|
3
|
-
pypck/helpers.py,sha256=hEGId1pQ4wOJgIwNKDx17qKBlxvNxvspSrI0gSY3wCQ,1267
|
|
4
|
-
pypck/inputs.py,sha256=QBpdGpHKa2iQdrXMai_mbO_MGRmPCk4BWiNb_ta8-DU,40227
|
|
5
|
-
pypck/lcn_addr.py,sha256=N2Od8KuANOglqKjf596hJVH1SRcG7MhESKA5YYlDnbw,1946
|
|
6
|
-
pypck/lcn_defs.py,sha256=sU0uGYyCLrnl-1aaHe5BtPE1kExESiPGmJFGdv9FWCk,40610
|
|
7
|
-
pypck/module.py,sha256=o9SB-Gr2w6ZioJa0lpzOWW5IFtWsd1ojV3qgIVjJIxw,37314
|
|
8
|
-
pypck/pck_commands.py,sha256=nR3LAdWbLD7yrtHfQigIIdMYPAIGM36A1fDAc2AD9Dk,46801
|
|
9
|
-
pypck/request_handlers.py,sha256=VUeYcqG4QyL1eNHn1o3w4CgQS-vWL45SGTE4v6LEOL8,24165
|
|
10
|
-
pypck/timeout_retry.py,sha256=5KiTDPzegym-6qi_mM4I8ChJbJjg9HXECFyAZt4c02w,3944
|
|
11
|
-
pypck-0.8.2.dist-info/LICENSE,sha256=iYB6zyMJvShfAzQE7nhYFgLzzZuBmhasLw5fYP9KRz4,1023
|
|
12
|
-
pypck-0.8.2.dist-info/METADATA,sha256=KZQbN-QApqDFuO7aCkj_Csz-KLjoeRUcc40TGjAfkkc,5581
|
|
13
|
-
pypck-0.8.2.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
14
|
-
pypck-0.8.2.dist-info/top_level.txt,sha256=59ried49iFueDa5mQ_5BGVZcESjjzi4MZZKLcganvQA,6
|
|
15
|
-
pypck-0.8.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|