conson-xp 1.47.0__py3-none-any.whl → 1.48.0__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.
- {conson_xp-1.47.0.dist-info → conson_xp-1.48.0.dist-info}/METADATA +1 -1
- {conson_xp-1.47.0.dist-info → conson_xp-1.48.0.dist-info}/RECORD +13 -13
- xp/__init__.py +1 -1
- xp/cli/commands/conbus/conbus_actiontable_commands.py +0 -4
- xp/services/actiontable/msactiontable_xp20_serializer.py +4 -9
- xp/services/actiontable/msactiontable_xp24_serializer.py +5 -11
- xp/services/actiontable/msactiontable_xp33_serializer.py +5 -11
- xp/services/conbus/actiontable/actiontable_download_service.py +6 -3
- xp/services/conbus/msactiontable/msactiontable_upload_service.py +2 -2
- xp/services/protocol/conbus_event_protocol.py +5 -2
- {conson_xp-1.47.0.dist-info → conson_xp-1.48.0.dist-info}/WHEEL +0 -0
- {conson_xp-1.47.0.dist-info → conson_xp-1.48.0.dist-info}/entry_points.txt +0 -0
- {conson_xp-1.47.0.dist-info → conson_xp-1.48.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
conson_xp-1.
|
|
2
|
-
conson_xp-1.
|
|
3
|
-
conson_xp-1.
|
|
4
|
-
conson_xp-1.
|
|
5
|
-
xp/__init__.py,sha256=
|
|
1
|
+
conson_xp-1.48.0.dist-info/METADATA,sha256=ik_ZkQlc-4OEqECRAK5REKQjzTHB6QTWeXKrnmBZeyY,11403
|
|
2
|
+
conson_xp-1.48.0.dist-info/WHEEL,sha256=tsUv_t7BDeJeRHaSrczbGeuK-TtDpGsWi_JfpzD255I,90
|
|
3
|
+
conson_xp-1.48.0.dist-info/entry_points.txt,sha256=1OcdIcDM1hz3ljCXgybaPUh1IOFEwkaTgLIW9u9zGeg,50
|
|
4
|
+
conson_xp-1.48.0.dist-info/licenses/LICENSE,sha256=rxj6woMM-r3YCyGq_UHFtbh7kHTAJgrccH6O-33IDE4,1419
|
|
5
|
+
xp/__init__.py,sha256=4LPDDZ3llI4VJJDFvi6MAvoF53KlCIbPYPSRgPAec_I,182
|
|
6
6
|
xp/cli/__init__.py,sha256=QjnKB1KaI2aIyKlzrnvCwfbBuUj8HNgwNMvNJVQofbI,81
|
|
7
7
|
xp/cli/__main__.py,sha256=l2iKwMdat5rTGd3JWs-uGksnYYDDffp_Npz05QdKEeU,117
|
|
8
8
|
xp/cli/commands/__init__.py,sha256=G7A1KFRSV0CEeDTqr_khu-K9_sc01CTI2KSfkFcaBRM,4949
|
|
9
9
|
xp/cli/commands/conbus/__init__.py,sha256=HYaX2__XxwD3Xaw4CzflvL8CwoUa4yR6wOyH8wwyofM,535
|
|
10
10
|
xp/cli/commands/conbus/conbus.py,sha256=GpWq1QS3mKfQFG77nTED-_hsvcnXb3ZIrC6DhfyhzBE,3538
|
|
11
|
-
xp/cli/commands/conbus/conbus_actiontable_commands.py,sha256=
|
|
11
|
+
xp/cli/commands/conbus/conbus_actiontable_commands.py,sha256=9kLP-ISIDWXVUtELCjTAs0JIT3DNGcYGBRnZEo-tp3g,7743
|
|
12
12
|
xp/cli/commands/conbus/conbus_autoreport_commands.py,sha256=dO3rxgII_xZVhbkxlMqTJCarrUveQCs_7-qf4li0UkQ,3962
|
|
13
13
|
xp/cli/commands/conbus/conbus_blink_commands.py,sha256=1zLiXV8Nn4XSDI-z7F3f2RN2IO-yxeMkGQ1PCknAkWY,5398
|
|
14
14
|
xp/cli/commands/conbus/conbus_config_commands.py,sha256=jeZi7J973DrDCyP59Qrvk6tonduj97KnV4fq9zbei2k,721
|
|
@@ -118,13 +118,13 @@ xp/services/actiontable/__init__.py,sha256=z6js4EuJ6xKHaseTEhuEvKo1tr9K1XyQiruRe
|
|
|
118
118
|
xp/services/actiontable/actiontable_serializer.py,sha256=AZpqxfq8-o7FGGtseW52MS6z647x3Ucc1RjR3GLUb20,8335
|
|
119
119
|
xp/services/actiontable/download_state_machine.py,sha256=lqNYN9LGGK2KiVUsmvyRfryWRB4-NOfsp7-9GrFubK4,9978
|
|
120
120
|
xp/services/actiontable/msactiontable_serializer.py,sha256=RRL6TZ1gpSQw81kAiw2BV3jTqm4fCJC0pWIcO26Cmos,174
|
|
121
|
-
xp/services/actiontable/msactiontable_xp20_serializer.py,sha256=
|
|
122
|
-
xp/services/actiontable/msactiontable_xp24_serializer.py,sha256=
|
|
123
|
-
xp/services/actiontable/msactiontable_xp33_serializer.py,sha256=
|
|
121
|
+
xp/services/actiontable/msactiontable_xp20_serializer.py,sha256=5K6FxgbV2F4brumNaOH6M8qPyCxIfaqCGOPIYDmFdnk,6998
|
|
122
|
+
xp/services/actiontable/msactiontable_xp24_serializer.py,sha256=NBsRViz-J1Zx7DtO9flRRsiZtOsB5rpQVplJ-I43stg,5192
|
|
123
|
+
xp/services/actiontable/msactiontable_xp33_serializer.py,sha256=9JzG9dOrfamu8UjsWztveX5n4o29Rm3ki81Ot0a38KQ,9490
|
|
124
124
|
xp/services/actiontable/serializer_protocol.py,sha256=PMsZbPwPQD1MJYo_KpZSgpnVQCtXFXSfzXFpCiA6Xi8,2002
|
|
125
125
|
xp/services/conbus/__init__.py,sha256=Hi35sMKu9o6LpYoi2tQDaQoMb8M5sOt_-LUTxxaCU_0,28
|
|
126
126
|
xp/services/conbus/actiontable/__init__.py,sha256=oD6vRk_Ye-eZ9s_hldAgtRJFu4mfAnODqpkJUGHHszk,40
|
|
127
|
-
xp/services/conbus/actiontable/actiontable_download_service.py,sha256=
|
|
127
|
+
xp/services/conbus/actiontable/actiontable_download_service.py,sha256=ZTQCC1D9TLmyDu3b5GAO4VxUVGSr6HuqZI9fxHB1qW8,14992
|
|
128
128
|
xp/services/conbus/actiontable/actiontable_list_service.py,sha256=oTDSpBkp-MJeaF5bhRnwkSy3na55xqQ4e2ykJzbMCUo,3236
|
|
129
129
|
xp/services/conbus/actiontable/actiontable_show_service.py,sha256=WISY2VsmSlceGa5_9lpFO-gs5TnTjv6YidQksUjCapk,3058
|
|
130
130
|
xp/services/conbus/actiontable/actiontable_upload_service.py,sha256=4crX4OZeTLYC_9ZjhV1Cqqc-WOhhBlXDmEHToLS6N9g,9772
|
|
@@ -142,7 +142,7 @@ xp/services/conbus/conbus_raw_service.py,sha256=OQuV521VOQraf2PGF2B9868vh7sDgmfc
|
|
|
142
142
|
xp/services/conbus/conbus_receive_service.py,sha256=TFf3W65brGsy6QZICpIs0Xy9bgqyL1vgQuhS_eHuIZs,5416
|
|
143
143
|
xp/services/conbus/conbus_scan_service.py,sha256=_Ka0OUDNYhDgZIR49Q0P5GTxJq6RcAAX2DVqEDdtb5U,6888
|
|
144
144
|
xp/services/conbus/msactiontable/__init__.py,sha256=rDYzumPSfcTjDADHxjE7bXQoeWtZTDGaYzFTYdVl_9g,42
|
|
145
|
-
xp/services/conbus/msactiontable/msactiontable_upload_service.py,sha256=
|
|
145
|
+
xp/services/conbus/msactiontable/msactiontable_upload_service.py,sha256=LB9pv0VOUDmyTHKUcY894fmBAqINO7qpM8mW1E3s8aU,12423
|
|
146
146
|
xp/services/conbus/write_config_service.py,sha256=BCfmLNPRDpwSwRMRYJvx2FXA8IZsdgmyeTXIYvmb4ys,9004
|
|
147
147
|
xp/services/homekit/__init__.py,sha256=xAMKmln_AmEFdOOJGKWYi96seRlKDQpKx3-hm7XbdIo,36
|
|
148
148
|
xp/services/homekit/homekit_cache_service.py,sha256=z1TB6icEqd1paoilVTewuFL0lXVCQbvrOJkJvvQECJY,11060
|
|
@@ -161,7 +161,7 @@ xp/services/homekit/homekit_service.py,sha256=mmO9dHd1PAkOLkM7wwbpC0iBnULN4XZxeH
|
|
|
161
161
|
xp/services/log_file_service.py,sha256=y775InPlpG8Z_uitHt7yrgRG-3vlIuCfdJjiZzPc_MA,10578
|
|
162
162
|
xp/services/module_type_service.py,sha256=ga4WO7dmJEaDKrXPmrJ-72n4UaEZonead23lHBkFN1E,7505
|
|
163
163
|
xp/services/protocol/__init__.py,sha256=qRufBmqRKGzpuzZ5bxBbmwf510TT00Ke8s5HcWGnqRY,818
|
|
164
|
-
xp/services/protocol/conbus_event_protocol.py,sha256=
|
|
164
|
+
xp/services/protocol/conbus_event_protocol.py,sha256=0EHC8YefW2EcYBAeRm3TX1N0L32KQv5Ed3utTe3JrTQ,19567
|
|
165
165
|
xp/services/protocol/conbus_protocol.py,sha256=3RY1dva3XHLyvcBqwV4nuenaVpRnT-ppPz45EXNGCIs,10417
|
|
166
166
|
xp/services/protocol/protocol_factory.py,sha256=gWXQtOdgtOyn0Tu_aydYFd_cTdU-jtsKVuMl-ru133s,2512
|
|
167
167
|
xp/services/protocol/telegram_protocol.py,sha256=hyEMJUUhgQe_2R8CDio8xT5tpLtgoXS8W0aDd7wN48E,9538
|
|
@@ -207,4 +207,4 @@ xp/utils/logging.py,sha256=wJ1d-yg97NiZUrt2F8iDMcmnHVwC-PErcI-7dpyiRDc,3777
|
|
|
207
207
|
xp/utils/serialization.py,sha256=TS1OwpTOemSvXsCGw3js4JkYYFEqkzrPe8V9QYQefdw,4684
|
|
208
208
|
xp/utils/state_machine.py,sha256=W9AY4ntRZnFeHAa5d43hm37j53uJPlqkRvWTPiBhJ_0,2464
|
|
209
209
|
xp/utils/time_utils.py,sha256=K17godWpL18VEypbTlvNOEDG6R3huYnf29yjkcnwRpU,3796
|
|
210
|
-
conson_xp-1.
|
|
210
|
+
conson_xp-1.48.0.dist-info/RECORD,,
|
xp/__init__.py
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import json
|
|
4
4
|
from contextlib import suppress
|
|
5
5
|
from pathlib import Path
|
|
6
|
-
from typing import Any, Dict
|
|
7
6
|
|
|
8
7
|
import click
|
|
9
8
|
from click import Context
|
|
@@ -66,7 +65,6 @@ def conbus_download_actiontable(ctx: Context, serial_number: str) -> None:
|
|
|
66
65
|
|
|
67
66
|
def on_actiontable_received(
|
|
68
67
|
_actiontable: ActionTable,
|
|
69
|
-
actiontable_dict: Dict[str, Any],
|
|
70
68
|
actiontable_short: list[str],
|
|
71
69
|
) -> None:
|
|
72
70
|
"""
|
|
@@ -74,13 +72,11 @@ def conbus_download_actiontable(ctx: Context, serial_number: str) -> None:
|
|
|
74
72
|
|
|
75
73
|
Args:
|
|
76
74
|
_actiontable: a list of ActionTableEntries.
|
|
77
|
-
actiontable_dict: action table in a dictionary.
|
|
78
75
|
actiontable_short: short representation of action table.
|
|
79
76
|
"""
|
|
80
77
|
output = {
|
|
81
78
|
"serial_number": serial_number,
|
|
82
79
|
"actiontable_short": actiontable_short,
|
|
83
|
-
"actiontable": actiontable_dict,
|
|
84
80
|
}
|
|
85
81
|
click.echo(json.dumps(output, indent=2, default=str))
|
|
86
82
|
|
|
@@ -42,17 +42,12 @@ class Xp20MsActionTableSerializer(ActionTableSerializerProtocol):
|
|
|
42
42
|
ValueError: If input length is not 64 characters
|
|
43
43
|
"""
|
|
44
44
|
raw_length = len(encoded_data)
|
|
45
|
-
if raw_length <
|
|
45
|
+
if raw_length < 64: # Minimum: 4 char prefix + 64 chars data
|
|
46
46
|
raise ValueError(
|
|
47
|
-
f"XP20 action table data must be
|
|
47
|
+
f"XP20 action table data must be 64 characters long, got {len(encoded_data)}"
|
|
48
48
|
)
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
data = encoded_data[4:]
|
|
52
|
-
|
|
53
|
-
# Take first 64 chars (32 bytes) as per pseudocode
|
|
54
|
-
hex_data = data[:64]
|
|
55
|
-
raw_bytes = de_nibbles(hex_data)
|
|
50
|
+
raw_bytes = de_nibbles(encoded_data)
|
|
56
51
|
|
|
57
52
|
# Decode input channels
|
|
58
53
|
input_channels = []
|
|
@@ -108,7 +103,7 @@ class Xp20MsActionTableSerializer(ActionTableSerializerProtocol):
|
|
|
108
103
|
|
|
109
104
|
encoded_data = nibbles(raw_bytes)
|
|
110
105
|
# Convert raw bytes to hex string with A-P encoding
|
|
111
|
-
return
|
|
106
|
+
return encoded_data
|
|
112
107
|
|
|
113
108
|
@staticmethod
|
|
114
109
|
def to_short_string(action_table: Xp20MsActionTable) -> list[str]:
|
|
@@ -36,19 +36,13 @@ class Xp24MsActionTableSerializer(ActionTableSerializerProtocol):
|
|
|
36
36
|
ValueError: If data length is not 68 bytes.
|
|
37
37
|
"""
|
|
38
38
|
raw_length = len(encoded_data)
|
|
39
|
-
if raw_length !=
|
|
39
|
+
if raw_length != 64:
|
|
40
40
|
raise ValueError(
|
|
41
|
-
f"Msactiontable is not
|
|
41
|
+
f"Msactiontable is not 64 bytes long ({raw_length}): {encoded_data}"
|
|
42
42
|
)
|
|
43
43
|
|
|
44
|
-
# Remove action table count AAAA, AAAB .
|
|
45
|
-
stripped_data = encoded_data[4:]
|
|
46
|
-
|
|
47
|
-
# Take first 64 chars (32 bytes) as per pseudocode
|
|
48
|
-
hex_data = stripped_data[:64]
|
|
49
|
-
|
|
50
44
|
# Convert hex string to bytes using deNibble (A-P encoding)
|
|
51
|
-
data = de_nibbles(
|
|
45
|
+
data = de_nibbles(encoded_data)
|
|
52
46
|
|
|
53
47
|
# Decode input actions from positions 0-3 (2 bytes each)
|
|
54
48
|
input_actions = []
|
|
@@ -78,7 +72,7 @@ class Xp24MsActionTableSerializer(ActionTableSerializerProtocol):
|
|
|
78
72
|
action_table: XP24 MS action table to serialize.
|
|
79
73
|
|
|
80
74
|
Returns:
|
|
81
|
-
Serialized action table data string (
|
|
75
|
+
Serialized action table data string (64 characters).
|
|
82
76
|
"""
|
|
83
77
|
# Build byte array for the action table (32 bytes total)
|
|
84
78
|
raw_bytes = bytearray()
|
|
@@ -107,7 +101,7 @@ class Xp24MsActionTableSerializer(ActionTableSerializerProtocol):
|
|
|
107
101
|
|
|
108
102
|
# Build byte array for the action table (32 bytes total)
|
|
109
103
|
# Prepend action table count "AAAA" (4 chars) -> total 68 chars
|
|
110
|
-
return
|
|
104
|
+
return nibbles(raw_bytes)
|
|
111
105
|
|
|
112
106
|
@staticmethod
|
|
113
107
|
def to_short_string(action_table: Xp24MsActionTable) -> list[str]:
|
|
@@ -139,7 +139,7 @@ class Xp33MsActionTableSerializer(ActionTableSerializerProtocol):
|
|
|
139
139
|
encoded_data = nibbles(raw_bytes)
|
|
140
140
|
|
|
141
141
|
# Convert raw bytes to hex string with A-P encoding
|
|
142
|
-
return
|
|
142
|
+
return encoded_data
|
|
143
143
|
|
|
144
144
|
@staticmethod
|
|
145
145
|
def from_encoded_string(msactiontable_rawdata: str) -> Xp33MsActionTable:
|
|
@@ -153,22 +153,16 @@ class Xp33MsActionTableSerializer(ActionTableSerializerProtocol):
|
|
|
153
153
|
Deserialized XP33 MS action table.
|
|
154
154
|
|
|
155
155
|
Raises:
|
|
156
|
-
ValueError: If data length is less than
|
|
156
|
+
ValueError: If data length is less than 64 characters.
|
|
157
157
|
"""
|
|
158
158
|
raw_length = len(msactiontable_rawdata)
|
|
159
|
-
if raw_length <
|
|
159
|
+
if raw_length < 64: # Minimum: 4 char prefix + 64 chars data
|
|
160
160
|
raise ValueError(
|
|
161
|
-
f"Msactiontable is too short ({raw_length}), minimum
|
|
161
|
+
f"Msactiontable is too short ({raw_length}), minimum 64 characters required"
|
|
162
162
|
)
|
|
163
163
|
|
|
164
|
-
# Remove action table count prefix (first 4 characters: AAAA, AAAB, etc.)
|
|
165
|
-
data = msactiontable_rawdata[4:]
|
|
166
|
-
|
|
167
|
-
# Take first 64 chars (32 bytes) as per pseudocode
|
|
168
|
-
hex_data = data[:64]
|
|
169
|
-
|
|
170
164
|
# Convert hex string to bytes using deNibble (A-P encoding)
|
|
171
|
-
raw_bytes = de_nibbles(
|
|
165
|
+
raw_bytes = de_nibbles(msactiontable_rawdata)
|
|
172
166
|
|
|
173
167
|
# Decode outputs
|
|
174
168
|
output1 = Xp33MsActionTableSerializer._decode_output(raw_bytes, 0)
|
|
@@ -51,7 +51,7 @@ class ActionTableDownloadService(DownloadStateMachine):
|
|
|
51
51
|
Attributes:
|
|
52
52
|
on_progress: Signal emitted with "." for each chunk received.
|
|
53
53
|
on_error: Signal emitted with error message string.
|
|
54
|
-
on_actiontable_received: Signal emitted with (ActionTable,
|
|
54
|
+
on_actiontable_received: Signal emitted with (ActionTable, list).
|
|
55
55
|
on_finish: Signal emitted when download and cleanup completed.
|
|
56
56
|
|
|
57
57
|
Example:
|
|
@@ -65,7 +65,7 @@ class ActionTableDownloadService(DownloadStateMachine):
|
|
|
65
65
|
on_progress: Signal = Signal(str)
|
|
66
66
|
on_error: Signal = Signal(str)
|
|
67
67
|
on_finish: Signal = Signal()
|
|
68
|
-
on_actiontable_received: Signal = Signal(Any,
|
|
68
|
+
on_actiontable_received: Signal = Signal(Any, list[str])
|
|
69
69
|
|
|
70
70
|
def __init__(
|
|
71
71
|
self,
|
|
@@ -126,7 +126,10 @@ class ActionTableDownloadService(DownloadStateMachine):
|
|
|
126
126
|
def on_enter_requesting(self) -> None:
|
|
127
127
|
"""Enter requesting state - send download request."""
|
|
128
128
|
self.enter_download_phase() # Sets phase to DOWNLOAD
|
|
129
|
-
self.conbus_protocol.send_download_request(
|
|
129
|
+
self.conbus_protocol.send_download_request(
|
|
130
|
+
serial_number=self.serial_number,
|
|
131
|
+
actiontable_type=self.serializer.download_type(),
|
|
132
|
+
)
|
|
130
133
|
self.send_download()
|
|
131
134
|
|
|
132
135
|
def on_enter_waiting_data(self) -> None:
|
|
@@ -279,8 +279,8 @@ class MsActionTableUploadService:
|
|
|
279
279
|
self.failed(f"Invalid msactiontable format: {e}")
|
|
280
280
|
return
|
|
281
281
|
|
|
282
|
-
# Serialize to telegram data (
|
|
283
|
-
self.upload_data = self.serializer.to_encoded_string(msactiontable) # type: ignore[arg-type]
|
|
282
|
+
# Serialize to telegram data (64 characters: AAAA + 64 data chars)
|
|
283
|
+
self.upload_data = "AAAA" + self.serializer.to_encoded_string(msactiontable) # type: ignore[arg-type]
|
|
284
284
|
|
|
285
285
|
self.logger.debug(
|
|
286
286
|
f"Upload data encoded: {len(self.upload_data)} chars (single chunk)"
|
|
@@ -326,17 +326,20 @@ class ConbusEventProtocol(protocol.Protocol, protocol.ClientFactory):
|
|
|
326
326
|
data_value=DataPointType.MODULE_ERROR_CODE.value,
|
|
327
327
|
)
|
|
328
328
|
|
|
329
|
-
def send_download_request(
|
|
329
|
+
def send_download_request(
|
|
330
|
+
self, serial_number: str, actiontable_type: SystemFunction
|
|
331
|
+
) -> None:
|
|
330
332
|
"""
|
|
331
333
|
Send download request telegram.
|
|
332
334
|
|
|
333
335
|
Args:
|
|
334
336
|
serial_number: Device serial number.
|
|
337
|
+
actiontable_type: DOWNLOAD_ACTIONTABLE or DOWNLOAD_MSACTIONTABLE.
|
|
335
338
|
"""
|
|
336
339
|
self.send_telegram(
|
|
337
340
|
telegram_type=TelegramType.SYSTEM,
|
|
338
341
|
serial_number=serial_number,
|
|
339
|
-
system_function=
|
|
342
|
+
system_function=actiontable_type,
|
|
340
343
|
data_value=NO_ERROR_CODE,
|
|
341
344
|
)
|
|
342
345
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|