conson-xp 1.45.0__py3-none-any.whl → 1.47.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.
Files changed (179) hide show
  1. {conson_xp-1.45.0.dist-info → conson_xp-1.47.0.dist-info}/METADATA +1 -1
  2. conson_xp-1.47.0.dist-info/RECORD +210 -0
  3. xp/__init__.py +3 -2
  4. xp/cli/commands/conbus/conbus.py +1 -1
  5. xp/cli/commands/conbus/conbus_actiontable_commands.py +33 -15
  6. xp/cli/commands/conbus/conbus_autoreport_commands.py +8 -4
  7. xp/cli/commands/conbus/conbus_blink_commands.py +20 -10
  8. xp/cli/commands/conbus/conbus_config_commands.py +2 -1
  9. xp/cli/commands/conbus/conbus_custom_commands.py +4 -2
  10. xp/cli/commands/conbus/conbus_datapoint_commands.py +10 -5
  11. xp/cli/commands/conbus/conbus_discover_commands.py +8 -4
  12. xp/cli/commands/conbus/conbus_event_commands.py +8 -4
  13. xp/cli/commands/conbus/conbus_export_commands.py +8 -4
  14. xp/cli/commands/conbus/conbus_lightlevel_commands.py +16 -8
  15. xp/cli/commands/conbus/conbus_linknumber_commands.py +8 -4
  16. xp/cli/commands/conbus/conbus_modulenumber_commands.py +8 -4
  17. xp/cli/commands/conbus/conbus_msactiontable_commands.py +78 -40
  18. xp/cli/commands/conbus/conbus_output_commands.py +16 -8
  19. xp/cli/commands/conbus/conbus_raw_commands.py +6 -3
  20. xp/cli/commands/conbus/conbus_receive_commands.py +6 -3
  21. xp/cli/commands/conbus/conbus_scan_commands.py +6 -3
  22. xp/cli/commands/file_commands.py +6 -3
  23. xp/cli/commands/homekit/homekit.py +4 -2
  24. xp/cli/commands/homekit/homekit_start_commands.py +2 -1
  25. xp/cli/commands/module_commands.py +8 -4
  26. xp/cli/commands/reverse_proxy_commands.py +8 -4
  27. xp/cli/commands/server/server_commands.py +6 -3
  28. xp/cli/commands/telegram/telegram_blink_commands.py +4 -2
  29. xp/cli/commands/telegram/telegram_checksum_commands.py +4 -2
  30. xp/cli/commands/telegram/telegram_discover_commands.py +2 -1
  31. xp/cli/commands/telegram/telegram_linknumber_commands.py +4 -2
  32. xp/cli/commands/telegram/telegram_parse_commands.py +4 -2
  33. xp/cli/commands/telegram/telegram_version_commands.py +2 -1
  34. xp/cli/commands/term/term_commands.py +4 -2
  35. xp/cli/main.py +2 -1
  36. xp/cli/utils/click_tree.py +6 -3
  37. xp/cli/utils/datapoint_type_choice.py +4 -2
  38. xp/cli/utils/decorators.py +42 -21
  39. xp/cli/utils/error_handlers.py +16 -8
  40. xp/cli/utils/formatters.py +22 -11
  41. xp/cli/utils/module_type_choice.py +4 -2
  42. xp/cli/utils/serial_number_type.py +4 -2
  43. xp/cli/utils/system_function_choice.py +4 -2
  44. xp/cli/utils/xp_module_type.py +4 -2
  45. xp/models/actiontable/actiontable.py +8 -8
  46. xp/models/actiontable/actiontable_type.py +20 -0
  47. xp/models/actiontable/msactiontable_xp20.py +8 -4
  48. xp/models/actiontable/msactiontable_xp24.py +12 -6
  49. xp/models/actiontable/msactiontable_xp33.py +20 -10
  50. xp/models/conbus/conbus.py +8 -4
  51. xp/models/conbus/conbus_autoreport.py +4 -2
  52. xp/models/conbus/conbus_blink.py +4 -2
  53. xp/models/conbus/conbus_client_config.py +6 -3
  54. xp/models/conbus/conbus_connection_status.py +4 -2
  55. xp/models/conbus/conbus_custom.py +4 -2
  56. xp/models/conbus/conbus_datapoint.py +4 -2
  57. xp/models/conbus/conbus_discover.py +6 -3
  58. xp/models/conbus/conbus_event_list.py +4 -2
  59. xp/models/conbus/conbus_event_raw.py +4 -2
  60. xp/models/conbus/conbus_export.py +2 -1
  61. xp/models/conbus/conbus_lightlevel.py +4 -2
  62. xp/models/conbus/conbus_linknumber.py +4 -2
  63. xp/models/conbus/conbus_logger_config.py +8 -4
  64. xp/models/conbus/conbus_output.py +4 -2
  65. xp/models/conbus/conbus_raw.py +4 -2
  66. xp/models/conbus/conbus_receive.py +4 -2
  67. xp/models/conbus/conbus_writeconfig.py +4 -2
  68. xp/models/config/conson_module_config.py +8 -4
  69. xp/models/homekit/homekit_accessory.py +4 -2
  70. xp/models/homekit/homekit_config.py +12 -6
  71. xp/models/log_entry.py +16 -8
  72. xp/models/protocol/conbus_protocol.py +36 -18
  73. xp/models/response.py +12 -8
  74. xp/models/telegram/action_type.py +4 -2
  75. xp/models/telegram/datapoint_type.py +4 -2
  76. xp/models/telegram/event_telegram.py +14 -7
  77. xp/models/telegram/event_type.py +2 -1
  78. xp/models/telegram/input_action_type.py +2 -1
  79. xp/models/telegram/input_type.py +2 -1
  80. xp/models/telegram/module_type.py +24 -12
  81. xp/models/telegram/module_type_code.py +2 -1
  82. xp/models/telegram/output_telegram.py +16 -10
  83. xp/models/telegram/reply_telegram.py +24 -13
  84. xp/models/telegram/system_function.py +6 -3
  85. xp/models/telegram/system_telegram.py +10 -6
  86. xp/models/telegram/telegram.py +2 -1
  87. xp/models/telegram/telegram_type.py +2 -1
  88. xp/models/telegram/timeparam_type.py +2 -1
  89. xp/models/term/connection_state.py +4 -2
  90. xp/models/term/module_state.py +2 -1
  91. xp/models/term/protocol_keys_config.py +6 -3
  92. xp/models/term/status_message.py +2 -1
  93. xp/models/term/telegram_display.py +2 -1
  94. xp/models/write_config_type.py +4 -2
  95. xp/services/actiontable/actiontable_serializer.py +34 -41
  96. xp/services/actiontable/download_state_machine.py +281 -0
  97. xp/services/actiontable/msactiontable_xp20_serializer.py +77 -49
  98. xp/services/actiontable/msactiontable_xp24_serializer.py +78 -53
  99. xp/services/actiontable/msactiontable_xp33_serializer.py +39 -9
  100. xp/services/actiontable/serializer_protocol.py +76 -0
  101. xp/services/conbus/actiontable/actiontable_download_service.py +134 -280
  102. xp/services/conbus/actiontable/actiontable_list_service.py +17 -4
  103. xp/services/conbus/actiontable/actiontable_show_service.py +10 -6
  104. xp/services/conbus/actiontable/actiontable_upload_service.py +17 -9
  105. xp/services/conbus/conbus_blink_all_service.py +16 -8
  106. xp/services/conbus/conbus_blink_service.py +14 -7
  107. xp/services/conbus/conbus_custom_service.py +16 -8
  108. xp/services/conbus/conbus_datapoint_queryall_service.py +18 -9
  109. xp/services/conbus/conbus_datapoint_service.py +18 -9
  110. xp/services/conbus/conbus_discover_service.py +24 -13
  111. xp/services/conbus/conbus_event_list_service.py +11 -7
  112. xp/services/conbus/conbus_event_raw_service.py +18 -10
  113. xp/services/conbus/conbus_export_service.py +28 -14
  114. xp/services/conbus/conbus_output_service.py +18 -10
  115. xp/services/conbus/conbus_raw_service.py +16 -8
  116. xp/services/conbus/conbus_receive_service.py +18 -10
  117. xp/services/conbus/conbus_scan_service.py +18 -10
  118. xp/services/conbus/msactiontable/msactiontable_upload_service.py +17 -9
  119. xp/services/conbus/write_config_service.py +18 -9
  120. xp/services/homekit/homekit_cache_service.py +12 -6
  121. xp/services/homekit/homekit_conbus_service.py +12 -6
  122. xp/services/homekit/homekit_config_validator.py +34 -17
  123. xp/services/homekit/homekit_conson_validator.py +18 -9
  124. xp/services/homekit/homekit_dimminglight.py +14 -7
  125. xp/services/homekit/homekit_dimminglight_service.py +14 -7
  126. xp/services/homekit/homekit_hap_service.py +18 -9
  127. xp/services/homekit/homekit_lightbulb.py +10 -5
  128. xp/services/homekit/homekit_lightbulb_service.py +10 -5
  129. xp/services/homekit/homekit_module_service.py +8 -4
  130. xp/services/homekit/homekit_outlet.py +14 -7
  131. xp/services/homekit/homekit_outlet_service.py +12 -6
  132. xp/services/homekit/homekit_service.py +24 -12
  133. xp/services/log_file_service.py +16 -8
  134. xp/services/module_type_service.py +10 -5
  135. xp/services/protocol/conbus_event_protocol.py +140 -21
  136. xp/services/protocol/conbus_protocol.py +36 -19
  137. xp/services/protocol/protocol_factory.py +12 -6
  138. xp/services/protocol/telegram_protocol.py +12 -6
  139. xp/services/reverse_proxy_service.py +26 -14
  140. xp/services/server/base_server_service.py +42 -23
  141. xp/services/server/client_buffer_manager.py +12 -7
  142. xp/services/server/cp20_server_service.py +10 -7
  143. xp/services/server/device_service_factory.py +12 -8
  144. xp/services/server/server_service.py +18 -11
  145. xp/services/server/xp130_server_service.py +11 -8
  146. xp/services/server/xp20_server_service.py +16 -10
  147. xp/services/server/xp230_server_service.py +10 -7
  148. xp/services/server/xp24_server_service.py +22 -13
  149. xp/services/server/xp33_server_service.py +44 -25
  150. xp/services/telegram/telegram_blink_service.py +14 -8
  151. xp/services/telegram/telegram_checksum_service.py +12 -7
  152. xp/services/telegram/telegram_datapoint_service.py +14 -9
  153. xp/services/telegram/telegram_discover_service.py +28 -15
  154. xp/services/telegram/telegram_link_number_service.py +18 -10
  155. xp/services/telegram/telegram_output_service.py +24 -12
  156. xp/services/telegram/telegram_service.py +22 -11
  157. xp/services/telegram/telegram_version_service.py +14 -8
  158. xp/services/term/protocol_monitor_service.py +30 -16
  159. xp/services/term/state_monitor_service.py +39 -21
  160. xp/term/protocol.py +12 -6
  161. xp/term/state.py +12 -7
  162. xp/term/widgets/help_menu.py +6 -3
  163. xp/term/widgets/modules_list.py +20 -10
  164. xp/term/widgets/protocol_log.py +12 -6
  165. xp/term/widgets/status_footer.py +10 -5
  166. xp/utils/checksum.py +6 -3
  167. xp/utils/dependencies.py +26 -31
  168. xp/utils/event_helper.py +6 -4
  169. xp/utils/logging.py +6 -3
  170. xp/utils/serialization.py +30 -16
  171. xp/utils/state_machine.py +16 -9
  172. xp/utils/time_utils.py +6 -3
  173. conson_xp-1.45.0.dist-info/RECORD +0 -210
  174. xp/services/conbus/msactiontable/msactiontable_download_service.py +0 -275
  175. xp/services/conbus/msactiontable/msactiontable_list_service.py +0 -100
  176. xp/services/conbus/msactiontable/msactiontable_show_service.py +0 -89
  177. {conson_xp-1.45.0.dist-info → conson_xp-1.47.0.dist-info}/WHEEL +0 -0
  178. {conson_xp-1.45.0.dist-info → conson_xp-1.47.0.dist-info}/entry_points.txt +0 -0
  179. {conson_xp-1.45.0.dist-info → conson_xp-1.47.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,7 +1,8 @@
1
- """Conbus Event Raw Service for sending raw event telegrams.
1
+ """
2
+ Conbus Event Raw Service for sending raw event telegrams.
2
3
 
3
- This service implements a TCP client that connects to Conbus servers and sends
4
- raw event telegrams to simulate button presses on Conbus modules.
4
+ This service implements a TCP client that connects to Conbus servers and sends raw event
5
+ telegrams to simulate button presses on Conbus modules.
5
6
  """
6
7
 
7
8
  import logging
@@ -15,7 +16,8 @@ from xp.services.protocol.conbus_event_protocol import ConbusEventProtocol
15
16
 
16
17
 
17
18
  class ConbusEventRawService:
18
- """Service for sending raw event telegrams to Conbus servers.
19
+ """
20
+ Service for sending raw event telegrams to Conbus servers.
19
21
 
20
22
  Uses ConbusEventProtocol to send MAKE/BREAK event sequences to
21
23
  simulate button presses on Conbus modules.
@@ -27,7 +29,8 @@ class ConbusEventRawService:
27
29
  conbus_protocol: ConbusEventProtocol
28
30
 
29
31
  def __init__(self, conbus_protocol: ConbusEventProtocol) -> None:
30
- """Initialize the Conbus event raw service.
32
+ """
33
+ Initialize the Conbus event raw service.
31
34
 
32
35
  Args:
33
36
  conbus_protocol: ConbusEventProtocol instance.
@@ -79,7 +82,8 @@ class ConbusEventRawService:
79
82
  self.conbus_protocol.call_later(0.0, self.conbus_protocol.start_queue_manager)
80
83
 
81
84
  def telegram_sent(self, telegram_sent: str) -> None:
82
- """Handle telegram sent event.
85
+ """
86
+ Handle telegram sent event.
83
87
 
84
88
  Args:
85
89
  telegram_sent: The telegram that was sent.
@@ -90,7 +94,8 @@ class ConbusEventRawService:
90
94
  self.event_result.sent_telegrams.append(telegram_sent)
91
95
 
92
96
  def telegram_received(self, telegram_received: TelegramReceivedEvent) -> None:
93
- """Handle telegram received event.
97
+ """
98
+ Handle telegram received event.
94
99
 
95
100
  Args:
96
101
  telegram_received: The telegram received event.
@@ -105,7 +110,8 @@ class ConbusEventRawService:
105
110
  self.progress_callback(telegram_received.frame)
106
111
 
107
112
  def timeout(self) -> None:
108
- """Handle timeout event.
113
+ """
114
+ Handle timeout event.
109
115
 
110
116
  Timeout is the normal/expected way to finish this service.
111
117
  """
@@ -119,7 +125,8 @@ class ConbusEventRawService:
119
125
  self.stop_reactor()
120
126
 
121
127
  def failed(self, message: str) -> None:
122
- """Handle failed connection event.
128
+ """
129
+ Handle failed connection event.
123
130
 
124
131
  Args:
125
132
  message: Failure message.
@@ -155,7 +162,8 @@ class ConbusEventRawService:
155
162
  finish_callback: Callable[[ConbusEventRawResponse], None],
156
163
  timeout_seconds: int = 5,
157
164
  ) -> None:
158
- """Run reactor in dedicated thread with its own event loop.
165
+ """
166
+ Run reactor in dedicated thread with its own event loop.
159
167
 
160
168
  Args:
161
169
  module_type_code: Module type code (numeric, e.g., 2 for CP20, 33 for XP33).
@@ -23,7 +23,8 @@ from xp.services.telegram.telegram_service import TelegramService
23
23
 
24
24
 
25
25
  class ConbusExportService:
26
- """Service for exporting Conbus device configurations.
26
+ """
27
+ Service for exporting Conbus device configurations.
27
28
 
28
29
  Discovers all devices on the Conbus network and queries their configuration
29
30
  datapoints to generate a structured export file compatible with conson.yml format.
@@ -57,7 +58,8 @@ class ConbusExportService:
57
58
  ]
58
59
 
59
60
  def __init__(self, conbus_protocol: ConbusEventProtocol) -> None:
60
- """Initialize the Conbus export service.
61
+ """
62
+ Initialize the Conbus export service.
61
63
 
62
64
  Args:
63
65
  conbus_protocol: Protocol for Conbus communication.
@@ -93,7 +95,8 @@ class ConbusExportService:
93
95
  )
94
96
 
95
97
  def telegram_sent(self, telegram: str) -> None:
96
- """Handle telegram sent event.
98
+ """
99
+ Handle telegram sent event.
97
100
 
98
101
  Args:
99
102
  telegram: Telegram that was sent.
@@ -101,7 +104,8 @@ class ConbusExportService:
101
104
  self.export_result.sent_telegrams.append(telegram)
102
105
 
103
106
  def telegram_received(self, event: TelegramReceivedEvent) -> None:
104
- """Handle telegram received event.
107
+ """
108
+ Handle telegram received event.
105
109
 
106
110
  Args:
107
111
  event: Telegram received event.
@@ -133,7 +137,8 @@ class ConbusExportService:
133
137
  )
134
138
 
135
139
  def _handle_discovery_response(self, serial_number: str) -> None:
136
- """Handle discovery response and query all datapoints.
140
+ """
141
+ Handle discovery response and query all datapoints.
137
142
 
138
143
  Args:
139
144
  serial_number: Serial number of discovered device.
@@ -175,7 +180,8 @@ class ConbusExportService:
175
180
  def _handle_datapoint_response(
176
181
  self, serial_number: str, datapoint_code: str, value: str
177
182
  ) -> None:
178
- """Handle datapoint response and store value.
183
+ """
184
+ Handle datapoint response and store value.
179
185
 
180
186
  Args:
181
187
  serial_number: Serial number of device.
@@ -201,7 +207,8 @@ class ConbusExportService:
201
207
  def _store_datapoint_value(
202
208
  self, serial_number: str, datapoint: DataPointType, value: str
203
209
  ) -> None:
204
- """Store datapoint value in device config.
210
+ """
211
+ Store datapoint value in device config.
205
212
 
206
213
  Args:
207
214
  serial_number: Serial number of device.
@@ -231,7 +238,8 @@ class ConbusExportService:
231
238
  self.logger.warning(f"Invalid value '{value}' for {datapoint.name}: {e}")
232
239
 
233
240
  def _is_device_complete(self, serial_number: str) -> bool:
234
- """Check if a device has all required datapoints.
241
+ """
242
+ Check if a device has all required datapoints.
235
243
 
236
244
  Args:
237
245
  serial_number: Serial number of device.
@@ -253,7 +261,8 @@ class ConbusExportService:
253
261
  )
254
262
 
255
263
  def _check_device_complete(self, serial_number: str) -> None:
256
- """Check if device has all datapoints and emit completion signal.
264
+ """
265
+ Check if device has all datapoints and emit completion signal.
257
266
 
258
267
  Args:
259
268
  serial_number: Serial number of device.
@@ -313,7 +322,8 @@ class ConbusExportService:
313
322
  self.on_finish.emit(self.export_result)
314
323
 
315
324
  def _write_export_file(self, path: str) -> None:
316
- """Write export to YAML file.
325
+ """
326
+ Write export to YAML file.
317
327
 
318
328
  Args:
319
329
  path: Output file path.
@@ -385,7 +395,8 @@ class ConbusExportService:
385
395
  self._finalize_export()
386
396
 
387
397
  def failed(self, message: str) -> None:
388
- """Handle connection failure event.
398
+ """
399
+ Handle connection failure event.
389
400
 
390
401
  Args:
391
402
  message: Failure message.
@@ -398,7 +409,8 @@ class ConbusExportService:
398
409
  self.on_finish.emit(self.export_result)
399
410
 
400
411
  def set_timeout(self, timeout_seconds: float) -> None:
401
- """Set timeout for export operation.
412
+ """
413
+ Set timeout for export operation.
402
414
 
403
415
  Args:
404
416
  timeout_seconds: Timeout in seconds.
@@ -407,7 +419,8 @@ class ConbusExportService:
407
419
  self.conbus_protocol.timeout_seconds = timeout_seconds
408
420
 
409
421
  def set_event_loop(self, event_loop: asyncio.AbstractEventLoop) -> None:
410
- """Set event loop for async operations.
422
+ """
423
+ Set event loop for async operations.
411
424
 
412
425
  Args:
413
426
  event_loop: Event loop to use.
@@ -424,7 +437,8 @@ class ConbusExportService:
424
437
  self.conbus_protocol.stop_reactor()
425
438
 
426
439
  def __enter__(self) -> "ConbusExportService":
427
- """Enter context manager.
440
+ """
441
+ Enter context manager.
428
442
 
429
443
  Returns:
430
444
  Self for context manager protocol.
@@ -1,7 +1,8 @@
1
- """Conbus Output Service for sending action telegrams to Conbus modules.
1
+ """
2
+ Conbus Output Service for sending action telegrams to Conbus modules.
2
3
 
3
- This service handles sending action telegrams (ON/OFF) to module outputs
4
- and processing ACK/NAK responses.
4
+ This service handles sending action telegrams (ON/OFF) to module outputs and processing
5
+ ACK/NAK responses.
5
6
  """
6
7
 
7
8
  import logging
@@ -49,7 +50,8 @@ class ConbusOutputService:
49
50
  conbus_protocol: ConbusEventProtocol,
50
51
  telegram_output_service: TelegramOutputService,
51
52
  ):
52
- """Initialize the Conbus output service.
53
+ """
54
+ Initialize the Conbus output service.
53
55
 
54
56
  Args:
55
57
  conbus_protocol: ConbusEventProtocol for communication.
@@ -105,7 +107,8 @@ class ConbusOutputService:
105
107
  )
106
108
 
107
109
  def telegram_sent(self, telegram_sent: str) -> None:
108
- """Handle telegram sent event.
110
+ """
111
+ Handle telegram sent event.
109
112
 
110
113
  Args:
111
114
  telegram_sent: The telegram that was sent.
@@ -113,7 +116,8 @@ class ConbusOutputService:
113
116
  self.service_response.sent_telegram = telegram_sent
114
117
 
115
118
  def telegram_received(self, telegram_received: TelegramReceivedEvent) -> None:
116
- """Handle telegram received event.
119
+ """
120
+ Handle telegram received event.
117
121
 
118
122
  Args:
119
123
  telegram_received: The telegram received event.
@@ -149,7 +153,8 @@ class ConbusOutputService:
149
153
  )
150
154
 
151
155
  def succeed(self, output_telegram: OutputTelegram) -> None:
152
- """Handle successful output action.
156
+ """
157
+ Handle successful output action.
153
158
 
154
159
  Args:
155
160
  output_telegram: The output telegram received as response.
@@ -169,7 +174,8 @@ class ConbusOutputService:
169
174
  self.failed("Timeout")
170
175
 
171
176
  def failed(self, message: str) -> None:
172
- """Handle failed connection event.
177
+ """
178
+ Handle failed connection event.
173
179
 
174
180
  Args:
175
181
  message: Failure message.
@@ -190,7 +196,8 @@ class ConbusOutputService:
190
196
  action_type: ActionType,
191
197
  timeout_seconds: Optional[float] = None,
192
198
  ) -> None:
193
- """Send an action telegram to a module output.
199
+ """
200
+ Send an action telegram to a module output.
194
201
 
195
202
  Args:
196
203
  serial_number: 10-digit module serial number.
@@ -206,7 +213,8 @@ class ConbusOutputService:
206
213
  self.action_type = action_type
207
214
 
208
215
  def set_timeout(self, timeout_seconds: float) -> None:
209
- """Set operation timeout.
216
+ """
217
+ Set operation timeout.
210
218
 
211
219
  Args:
212
220
  timeout_seconds: Timeout in seconds.
@@ -1,4 +1,5 @@
1
- """Conbus Raw Service for sending raw telegram sequences.
1
+ """
2
+ Conbus Raw Service for sending raw telegram sequences.
2
3
 
3
4
  This service handles sending raw telegram strings without prior validation.
4
5
  """
@@ -35,7 +36,8 @@ class ConbusRawService:
35
36
  self,
36
37
  conbus_protocol: ConbusEventProtocol,
37
38
  ) -> None:
38
- """Initialize the Conbus raw service.
39
+ """
40
+ Initialize the Conbus raw service.
39
41
 
40
42
  Args:
41
43
  conbus_protocol: ConbusEventProtocol instance.
@@ -62,7 +64,8 @@ class ConbusRawService:
62
64
  self.conbus_protocol.send_raw_telegram(self.raw_input)
63
65
 
64
66
  def telegram_sent(self, telegram_sent: str) -> None:
65
- """Handle telegram sent event.
67
+ """
68
+ Handle telegram sent event.
66
69
 
67
70
  Args:
68
71
  telegram_sent: The telegram that was sent.
@@ -73,7 +76,8 @@ class ConbusRawService:
73
76
  self.service_response.received_telegrams = []
74
77
 
75
78
  def telegram_received(self, telegram_received: TelegramReceivedEvent) -> None:
76
- """Handle telegram received event.
79
+ """
80
+ Handle telegram received event.
77
81
 
78
82
  Args:
79
83
  telegram_received: The telegram received event.
@@ -92,7 +96,8 @@ class ConbusRawService:
92
96
  self.on_finish.emit(self.service_response)
93
97
 
94
98
  def failed(self, message: str) -> None:
95
- """Handle failed connection event.
99
+ """
100
+ Handle failed connection event.
96
101
 
97
102
  Args:
98
103
  message: Failure message.
@@ -108,7 +113,8 @@ class ConbusRawService:
108
113
  raw_input: str,
109
114
  timeout_seconds: Optional[float] = None,
110
115
  ) -> None:
111
- """Send a raw telegram string to the Conbus server.
116
+ """
117
+ Send a raw telegram string to the Conbus server.
112
118
 
113
119
  Args:
114
120
  raw_input: Raw telegram string to send.
@@ -120,7 +126,8 @@ class ConbusRawService:
120
126
  self.raw_input = raw_input
121
127
 
122
128
  def set_timeout(self, timeout_seconds: float) -> None:
123
- """Set operation timeout.
129
+ """
130
+ Set operation timeout.
124
131
 
125
132
  Args:
126
133
  timeout_seconds: Timeout in seconds.
@@ -136,7 +143,8 @@ class ConbusRawService:
136
143
  self.conbus_protocol.stop_reactor()
137
144
 
138
145
  def __enter__(self) -> "ConbusRawService":
139
- """Enter context manager.
146
+ """
147
+ Enter context manager.
140
148
 
141
149
  Returns:
142
150
  Self for context manager protocol.
@@ -1,7 +1,8 @@
1
- """Conbus Receive Service for receiving telegrams from Conbus servers.
1
+ """
2
+ Conbus Receive Service for receiving telegrams from Conbus servers.
2
3
 
3
- This service uses ConbusEventProtocol to provide receive-only functionality,
4
- allowing clients to receive waiting event telegrams using empty telegram sends.
4
+ This service uses ConbusEventProtocol to provide receive-only functionality, allowing
5
+ clients to receive waiting event telegrams using empty telegram sends.
5
6
  """
6
7
 
7
8
  import asyncio
@@ -33,7 +34,8 @@ class ConbusReceiveService:
33
34
  on_finish: Signal = Signal(ConbusReceiveResponse)
34
35
 
35
36
  def __init__(self, conbus_protocol: ConbusEventProtocol) -> None:
36
- """Initialize the Conbus receive service.
37
+ """
38
+ Initialize the Conbus receive service.
37
39
 
38
40
  Args:
39
41
  conbus_protocol: ConbusEventProtocol instance.
@@ -57,7 +59,8 @@ class ConbusReceiveService:
57
59
  self.logger.debug("Connection established, waiting for telegrams.")
58
60
 
59
61
  def telegram_sent(self, telegram_sent: str) -> None:
60
- """Handle telegram sent event.
62
+ """
63
+ Handle telegram sent event.
61
64
 
62
65
  Args:
63
66
  telegram_sent: The telegram that was sent.
@@ -65,7 +68,8 @@ class ConbusReceiveService:
65
68
  pass
66
69
 
67
70
  def telegram_received(self, telegram_received: TelegramReceivedEvent) -> None:
68
- """Handle telegram received event.
71
+ """
72
+ Handle telegram received event.
69
73
 
70
74
  Args:
71
75
  telegram_received: The telegram received event.
@@ -85,7 +89,8 @@ class ConbusReceiveService:
85
89
  self.on_finish.emit(self.receive_response)
86
90
 
87
91
  def failed(self, message: str) -> None:
88
- """Handle failed connection event.
92
+ """
93
+ Handle failed connection event.
89
94
 
90
95
  Args:
91
96
  message: Failure message.
@@ -96,7 +101,8 @@ class ConbusReceiveService:
96
101
  self.on_finish.emit(self.receive_response)
97
102
 
98
103
  def set_timeout(self, timeout_seconds: float) -> None:
99
- """Setup callbacks and timeout for receiving telegrams.
104
+ """
105
+ Setup callbacks and timeout for receiving telegrams.
100
106
 
101
107
  Args:
102
108
  timeout_seconds: Optional timeout in seconds.
@@ -108,7 +114,8 @@ class ConbusReceiveService:
108
114
  self,
109
115
  event_loop: asyncio.AbstractEventLoop,
110
116
  ) -> None:
111
- """Setup callbacks and timeout for receiving telegrams.
117
+ """
118
+ Setup callbacks and timeout for receiving telegrams.
112
119
 
113
120
  Args:
114
121
  event_loop: Optional event loop to use for async operations.
@@ -125,7 +132,8 @@ class ConbusReceiveService:
125
132
  self.conbus_protocol.stop_reactor()
126
133
 
127
134
  def __enter__(self) -> "ConbusReceiveService":
128
- """Enter context manager.
135
+ """
136
+ Enter context manager.
129
137
 
130
138
  Returns:
131
139
  Self for context manager protocol.
@@ -1,7 +1,8 @@
1
- """Conbus Scan Service for TCP communication with Conbus servers.
1
+ """
2
+ Conbus Scan Service for TCP communication with Conbus servers.
2
3
 
3
- This service implements a TCP client that scans Conbus servers and sends
4
- telegrams to scan modules for all datapoints by function code.
4
+ This service implements a TCP client that scans Conbus servers and sends telegrams to
5
+ scan modules for all datapoints by function code.
5
6
  """
6
7
 
7
8
  import logging
@@ -35,7 +36,8 @@ class ConbusScanService:
35
36
  self,
36
37
  conbus_protocol: ConbusEventProtocol,
37
38
  ) -> None:
38
- """Initialize the Conbus scan service.
39
+ """
40
+ Initialize the Conbus scan service.
39
41
 
40
42
  Args:
41
43
  conbus_protocol: ConbusEventProtocol instance.
@@ -66,7 +68,8 @@ class ConbusScanService:
66
68
  self.scan_next_datacode()
67
69
 
68
70
  def scan_next_datacode(self) -> bool:
69
- """Scan the next data code.
71
+ """
72
+ Scan the next data code.
70
73
 
71
74
  Returns:
72
75
  True if scanning should continue, False if complete.
@@ -83,7 +86,8 @@ class ConbusScanService:
83
86
  return True
84
87
 
85
88
  def telegram_sent(self, telegram_sent: str) -> None:
86
- """Handle telegram sent event.
89
+ """
90
+ Handle telegram sent event.
87
91
 
88
92
  Args:
89
93
  telegram_sent: The telegram that was sent.
@@ -92,7 +96,8 @@ class ConbusScanService:
92
96
  self.service_response.sent_telegrams.append(telegram_sent)
93
97
 
94
98
  def telegram_received(self, telegram_received: TelegramReceivedEvent) -> None:
95
- """Handle telegram received event.
99
+ """
100
+ Handle telegram received event.
96
101
 
97
102
  Args:
98
103
  telegram_received: The telegram received event.
@@ -111,7 +116,8 @@ class ConbusScanService:
111
116
  self.scan_next_datacode()
112
117
 
113
118
  def failed(self, message: str) -> None:
114
- """Handle failed connection event.
119
+ """
120
+ Handle failed connection event.
115
121
 
116
122
  Args:
117
123
  message: Failure message.
@@ -128,7 +134,8 @@ class ConbusScanService:
128
134
  function_code: str,
129
135
  timeout_seconds: float = 0.25,
130
136
  ) -> None:
131
- """Scan a module for all datapoints by function code.
137
+ """
138
+ Scan a module for all datapoints by function code.
132
139
 
133
140
  Args:
134
141
  serial_number: 10-digit module serial number.
@@ -143,7 +150,8 @@ class ConbusScanService:
143
150
  self.function_code = function_code
144
151
 
145
152
  def set_timeout(self, timeout_seconds: float) -> None:
146
- """Set operation timeout.
153
+ """
154
+ Set operation timeout.
147
155
 
148
156
  Args:
149
157
  timeout_seconds: Timeout in seconds.
@@ -29,7 +29,8 @@ class MsActionTableUploadError(Exception):
29
29
 
30
30
 
31
31
  class MsActionTableUploadService:
32
- """TCP client service for uploading MS action tables to Conbus modules.
32
+ """
33
+ TCP client service for uploading MS action tables to Conbus modules.
33
34
 
34
35
  Manages TCP socket connections, handles telegram generation and transmission,
35
36
  and processes server responses for MS action table uploads.
@@ -53,7 +54,8 @@ class MsActionTableUploadService:
53
54
  telegram_service: TelegramService,
54
55
  conson_config: ConsonModuleListConfig,
55
56
  ) -> None:
56
- """Initialize the MS action table upload service.
57
+ """
58
+ Initialize the MS action table upload service.
57
59
 
58
60
  Args:
59
61
  conbus_protocol: ConbusEventProtocol for communication.
@@ -104,7 +106,8 @@ class MsActionTableUploadService:
104
106
  )
105
107
 
106
108
  def telegram_sent(self, telegram_sent: str) -> None:
107
- """Handle telegram sent event.
109
+ """
110
+ Handle telegram sent event.
108
111
 
109
112
  Args:
110
113
  telegram_sent: The telegram that was sent.
@@ -112,7 +115,8 @@ class MsActionTableUploadService:
112
115
  self.logger.debug(f"Telegram sent: {telegram_sent}")
113
116
 
114
117
  def telegram_received(self, telegram_received: TelegramReceivedEvent) -> None:
115
- """Handle telegram received event.
118
+ """
119
+ Handle telegram received event.
116
120
 
117
121
  Args:
118
122
  telegram_received: The telegram received event.
@@ -133,7 +137,8 @@ class MsActionTableUploadService:
133
137
  self._handle_upload_response(reply_telegram)
134
138
 
135
139
  def _handle_upload_response(self, reply_telegram: Any) -> None:
136
- """Handle telegram responses during upload.
140
+ """
141
+ Handle telegram responses during upload.
137
142
 
138
143
  Args:
139
144
  reply_telegram: Parsed reply telegram.
@@ -174,7 +179,8 @@ class MsActionTableUploadService:
174
179
  self.failed("Upload timeout")
175
180
 
176
181
  def failed(self, message: str) -> None:
177
- """Handle failed connection event.
182
+ """
183
+ Handle failed connection event.
178
184
 
179
185
  Args:
180
186
  message: Failure message.
@@ -188,7 +194,8 @@ class MsActionTableUploadService:
188
194
  xpmoduletype: str,
189
195
  timeout_seconds: Optional[float] = None,
190
196
  ) -> None:
191
- """Upload MS action table to module.
197
+ """
198
+ Upload MS action table to module.
192
199
 
193
200
  Uploads the MS action table configuration to the specified module.
194
201
 
@@ -273,14 +280,15 @@ class MsActionTableUploadService:
273
280
  return
274
281
 
275
282
  # Serialize to telegram data (68 characters: AAAA + 64 data chars)
276
- self.upload_data = self.serializer.to_data(msactiontable) # type: ignore[arg-type]
283
+ self.upload_data = self.serializer.to_encoded_string(msactiontable) # type: ignore[arg-type]
277
284
 
278
285
  self.logger.debug(
279
286
  f"Upload data encoded: {len(self.upload_data)} chars (single chunk)"
280
287
  )
281
288
 
282
289
  def set_timeout(self, timeout_seconds: float) -> None:
283
- """Set operation timeout.
290
+ """
291
+ Set operation timeout.
284
292
 
285
293
  Args:
286
294
  timeout_seconds: Timeout in seconds.