conson-xp 2.0.3__py3-none-any.whl → 2.0.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.
- {conson_xp-2.0.3.dist-info → conson_xp-2.0.4.dist-info}/METADATA +1 -1
- {conson_xp-2.0.3.dist-info → conson_xp-2.0.4.dist-info}/RECORD +8 -8
- xp/__init__.py +1 -1
- xp/cli/commands/conbus/conbus_raw_commands.py +9 -10
- xp/services/conbus/conbus_raw_service.py +13 -10
- {conson_xp-2.0.3.dist-info → conson_xp-2.0.4.dist-info}/WHEEL +0 -0
- {conson_xp-2.0.3.dist-info → conson_xp-2.0.4.dist-info}/entry_points.txt +0 -0
- {conson_xp-2.0.3.dist-info → conson_xp-2.0.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
conson_xp-2.0.
|
|
2
|
-
conson_xp-2.0.
|
|
3
|
-
conson_xp-2.0.
|
|
4
|
-
conson_xp-2.0.
|
|
5
|
-
xp/__init__.py,sha256=
|
|
1
|
+
conson_xp-2.0.4.dist-info/METADATA,sha256=CJMAU_3xThp1pBfy62H2HtM-hDsN8T9UxxqFRTflo0o,11319
|
|
2
|
+
conson_xp-2.0.4.dist-info/WHEEL,sha256=tsUv_t7BDeJeRHaSrczbGeuK-TtDpGsWi_JfpzD255I,90
|
|
3
|
+
conson_xp-2.0.4.dist-info/entry_points.txt,sha256=1OcdIcDM1hz3ljCXgybaPUh1IOFEwkaTgLIW9u9zGeg,50
|
|
4
|
+
conson_xp-2.0.4.dist-info/licenses/LICENSE,sha256=rxj6woMM-r3YCyGq_UHFtbh7kHTAJgrccH6O-33IDE4,1419
|
|
5
|
+
xp/__init__.py,sha256=8uU6iQSfgIQU3EC4KbiWh-hGKhEpZZZ7YaahwbEQvaE,181
|
|
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=9TGP3uTxAU-s-kVChvQ-Fn3-HVYj-QpeQ05Is-20HRo,4788
|
|
@@ -22,7 +22,7 @@ xp/cli/commands/conbus/conbus_linknumber_commands.py,sha256=3bkik8nHXY89XfzeUnKW
|
|
|
22
22
|
xp/cli/commands/conbus/conbus_modulenumber_commands.py,sha256=fOIO0f85iDJBfGnRCEN8zK6j4i43uuF_9YKQc_nQ39A,3628
|
|
23
23
|
xp/cli/commands/conbus/conbus_msactiontable_commands.py,sha256=oMHfrxDR9yj0Pvx92ZHnwYU3CZqwNNvfAfEoLuo_jhQ,11585
|
|
24
24
|
xp/cli/commands/conbus/conbus_output_commands.py,sha256=XMEMb5tM0ul7lwhwoo4QRgWprXZ31qswXBno8KCeFMo,5342
|
|
25
|
-
xp/cli/commands/conbus/conbus_raw_commands.py,sha256=
|
|
25
|
+
xp/cli/commands/conbus/conbus_raw_commands.py,sha256=bCFF1q61VSfdwS_Ch7jTbv-Q-t6n_EwEHRw_wlvNrr0,1984
|
|
26
26
|
xp/cli/commands/conbus/conbus_receive_commands.py,sha256=LdxoOUdM5atkC8fFlp-GK7HQ7oxTnjrSFDx-lQ3nme0,1925
|
|
27
27
|
xp/cli/commands/conbus/conbus_scan_commands.py,sha256=QuRT4Vx5TqervCOUsZ4wcxvy7Jwra4hl2-DIt8cDcoE,1828
|
|
28
28
|
xp/cli/commands/file_commands.py,sha256=dx6a4xNxuReXq7dOyL8ebn6lyifzDm0d0OsuDjyr_90,5547
|
|
@@ -136,7 +136,7 @@ xp/services/conbus/conbus_event_raw_service.py,sha256=viXuEXw165-RytdqC76wQShJLD
|
|
|
136
136
|
xp/services/conbus/conbus_export_actiontable_service.py,sha256=d6Y2RDiVOH-jTMWOIE_gY_WBJnHFrbJGguk-WZWbNPs,11818
|
|
137
137
|
xp/services/conbus/conbus_export_service.py,sha256=RP8nADTIs4FGUf_BFLRZMtEJZdXV94zg3QrlWaDnhKA,17536
|
|
138
138
|
xp/services/conbus/conbus_output_service.py,sha256=e57bRkLgPnJuB8hkllNh0kgGkjPt9IK75tuBxd_bOkE,9361
|
|
139
|
-
xp/services/conbus/conbus_raw_service.py,sha256=
|
|
139
|
+
xp/services/conbus/conbus_raw_service.py,sha256=xmFotLJqPU8CSDumB2gnxqLW7OO-Jlc7WyS0f2cgayA,5967
|
|
140
140
|
xp/services/conbus/conbus_receive_service.py,sha256=TFf3W65brGsy6QZICpIs0Xy9bgqyL1vgQuhS_eHuIZs,5416
|
|
141
141
|
xp/services/conbus/conbus_scan_service.py,sha256=_Ka0OUDNYhDgZIR49Q0P5GTxJq6RcAAX2DVqEDdtb5U,6888
|
|
142
142
|
xp/services/conbus/write_config_service.py,sha256=BCfmLNPRDpwSwRMRYJvx2FXA8IZsdgmyeTXIYvmb4ys,9004
|
|
@@ -191,4 +191,4 @@ xp/utils/logging.py,sha256=wJ1d-yg97NiZUrt2F8iDMcmnHVwC-PErcI-7dpyiRDc,3777
|
|
|
191
191
|
xp/utils/serialization.py,sha256=TS1OwpTOemSvXsCGw3js4JkYYFEqkzrPe8V9QYQefdw,4684
|
|
192
192
|
xp/utils/state_machine.py,sha256=W9AY4ntRZnFeHAa5d43hm37j53uJPlqkRvWTPiBhJ_0,2464
|
|
193
193
|
xp/utils/time_utils.py,sha256=K17godWpL18VEypbTlvNOEDG6R3huYnf29yjkcnwRpU,3796
|
|
194
|
-
conson_xp-2.0.
|
|
194
|
+
conson_xp-2.0.4.dist-info/RECORD,,
|
xp/__init__.py
CHANGED
|
@@ -14,25 +14,24 @@ from xp.services.conbus.conbus_raw_service import ConbusRawService
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
@conbus.command("raw")
|
|
17
|
-
@click.argument("
|
|
17
|
+
@click.argument("telegrams", nargs=-1, required=True)
|
|
18
18
|
@click.pass_context
|
|
19
19
|
@connection_command()
|
|
20
|
-
def send_raw_telegrams(ctx: Context,
|
|
20
|
+
def send_raw_telegrams(ctx: Context, telegrams: tuple[str, ...]) -> None:
|
|
21
21
|
r"""
|
|
22
22
|
Send raw telegram sequence to Conbus server.
|
|
23
23
|
|
|
24
|
-
Accepts
|
|
25
|
-
Multiple telegrams should be concatenated without separators.
|
|
24
|
+
Accepts one or more telegrams in format S2113010000F02D (without <> nor CHECKSUM) as separate arguments.
|
|
26
25
|
|
|
27
26
|
Args:
|
|
28
27
|
ctx: Click context object.
|
|
29
|
-
|
|
28
|
+
telegrams: Raw telegram string(s).
|
|
30
29
|
|
|
31
30
|
Examples:
|
|
32
31
|
\b
|
|
33
|
-
xp conbus raw '
|
|
34
|
-
xp conbus raw '
|
|
35
|
-
xp conbus raw '
|
|
32
|
+
xp conbus raw 'S2113010000F02D'
|
|
33
|
+
xp conbus raw 'S2113010000F02D' 'S2113010001F02D'
|
|
34
|
+
xp conbus raw 'S0012345003F02D12F' 'S0012345009F02D12'
|
|
36
35
|
"""
|
|
37
36
|
service: ConbusRawService = (
|
|
38
37
|
ctx.obj.get("container").get_container().resolve(ConbusRawService)
|
|
@@ -62,8 +61,8 @@ def send_raw_telegrams(ctx: Context, raw_telegrams: str) -> None:
|
|
|
62
61
|
service.on_progress.connect(on_progress)
|
|
63
62
|
service.on_finish.connect(on_finish)
|
|
64
63
|
# Setup
|
|
65
|
-
service.
|
|
66
|
-
|
|
64
|
+
service.send_raw_telegrams(
|
|
65
|
+
telegrams=list(telegrams),
|
|
67
66
|
timeout_seconds=5.0,
|
|
68
67
|
)
|
|
69
68
|
# Start (blocks until completion)
|
|
@@ -51,7 +51,7 @@ class ConbusRawService:
|
|
|
51
51
|
self.conbus_protocol.on_timeout.connect(self.timeout)
|
|
52
52
|
self.conbus_protocol.on_failed.connect(self.failed)
|
|
53
53
|
|
|
54
|
-
self.
|
|
54
|
+
self.telegrams: list[str] = []
|
|
55
55
|
self.service_response: ConbusRawResponse = ConbusRawResponse(
|
|
56
56
|
success=False,
|
|
57
57
|
)
|
|
@@ -60,8 +60,11 @@ class ConbusRawService:
|
|
|
60
60
|
|
|
61
61
|
def connection_made(self) -> None:
|
|
62
62
|
"""Handle connection established event."""
|
|
63
|
-
self.logger.debug(
|
|
64
|
-
|
|
63
|
+
self.logger.debug(
|
|
64
|
+
f"Connection established, sending {len(self.telegrams)} telegrams"
|
|
65
|
+
)
|
|
66
|
+
for telegram in self.telegrams:
|
|
67
|
+
self.conbus_protocol.send_raw_telegram(telegram)
|
|
65
68
|
|
|
66
69
|
def telegram_sent(self, telegram_sent: str) -> None:
|
|
67
70
|
"""
|
|
@@ -108,22 +111,22 @@ class ConbusRawService:
|
|
|
108
111
|
self.service_response.error = message
|
|
109
112
|
self.on_finish.emit(self.service_response)
|
|
110
113
|
|
|
111
|
-
def
|
|
114
|
+
def send_raw_telegrams(
|
|
112
115
|
self,
|
|
113
|
-
|
|
116
|
+
telegrams: list[str],
|
|
114
117
|
timeout_seconds: Optional[float] = None,
|
|
115
118
|
) -> None:
|
|
116
119
|
"""
|
|
117
|
-
Send
|
|
120
|
+
Send raw telegrams to the Conbus server.
|
|
118
121
|
|
|
119
122
|
Args:
|
|
120
|
-
|
|
123
|
+
telegrams: List of raw telegram strings to send.
|
|
121
124
|
timeout_seconds: Timeout in seconds.
|
|
122
125
|
"""
|
|
123
|
-
self.logger.info("Starting
|
|
126
|
+
self.logger.info(f"Starting send_raw_telegrams with {len(telegrams)} telegrams")
|
|
124
127
|
if timeout_seconds:
|
|
125
128
|
self.conbus_protocol.timeout_seconds = timeout_seconds
|
|
126
|
-
self.
|
|
129
|
+
self.telegrams = telegrams
|
|
127
130
|
|
|
128
131
|
def set_timeout(self, timeout_seconds: float) -> None:
|
|
129
132
|
"""
|
|
@@ -151,7 +154,7 @@ class ConbusRawService:
|
|
|
151
154
|
"""
|
|
152
155
|
# Reset state for singleton reuse
|
|
153
156
|
self.service_response = ConbusRawResponse(success=False)
|
|
154
|
-
self.
|
|
157
|
+
self.telegrams = []
|
|
155
158
|
return self
|
|
156
159
|
|
|
157
160
|
def __exit__(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|