conson-xp 1.46.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.46.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/{conbus/actiontable/actiontable_download_state_machine.py → actiontable/download_state_machine.py} +13 -8
  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 +63 -29
  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 +46 -24
  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 +25 -30
  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.46.0.dist-info/RECORD +0 -211
  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.46.0.dist-info → conson_xp-1.47.0.dist-info}/WHEEL +0 -0
  178. {conson_xp-1.46.0.dist-info → conson_xp-1.47.0.dist-info}/entry_points.txt +0 -0
  179. {conson_xp-1.46.0.dist-info → conson_xp-1.47.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,7 +1,8 @@
1
- """XP230 Server Service for device emulation.
1
+ """
2
+ XP230 Server Service for device emulation.
2
3
 
3
- This service provides XP230-specific device emulation functionality,
4
- including response generation and device configuration handling.
4
+ This service provides XP230-specific device emulation functionality, including response
5
+ generation and device configuration handling.
5
6
  """
6
7
 
7
8
  from typing import Dict, Optional
@@ -21,8 +22,8 @@ class XP230ServerService(BaseServerService):
21
22
  """
22
23
  XP230 device emulation service.
23
24
 
24
- Generates XP230-specific responses, handles XP230 device configuration,
25
- and implements XP230 telegram format.
25
+ Generates XP230-specific responses, handles XP230 device configuration, and
26
+ implements XP230 telegram format.
26
27
  """
27
28
 
28
29
  def __init__(
@@ -31,7 +32,8 @@ class XP230ServerService(BaseServerService):
31
32
  _variant: str = "",
32
33
  _msactiontable_serializer: Optional[MsActionTableSerializer] = None,
33
34
  ):
34
- """Initialize XP230 server service.
35
+ """
36
+ Initialize XP230 server service.
35
37
 
36
38
  Args:
37
39
  serial_number: The device serial number.
@@ -44,7 +46,8 @@ class XP230ServerService(BaseServerService):
44
46
  self.firmware_version = "XP230_V1.00.04"
45
47
 
46
48
  def get_device_info(self) -> Dict:
47
- """Get XP230 device information.
49
+ """
50
+ Get XP230 device information.
48
51
 
49
52
  Returns:
50
53
  Dictionary containing device information.
@@ -1,7 +1,8 @@
1
- """XP24 Server Service for device emulation.
1
+ """
2
+ XP24 Server Service for device emulation.
2
3
 
3
- This service provides XP24-specific device emulation functionality,
4
- including response generation and device configuration handling.
4
+ This service provides XP24-specific device emulation functionality, including response
5
+ generation and device configuration handling.
5
6
  """
6
7
 
7
8
  from typing import Dict, Optional
@@ -26,7 +27,8 @@ class XP24ServerError(Exception):
26
27
 
27
28
 
28
29
  class XP24Output:
29
- """Represents an XP24 output state.
30
+ """
31
+ Represents an XP24 output state.
30
32
 
31
33
  Attributes:
32
34
  state: Current state of the output (True=on, False=off).
@@ -39,8 +41,8 @@ class XP24ServerService(BaseServerService):
39
41
  """
40
42
  XP24 device emulation service.
41
43
 
42
- Generates XP24-specific responses, handles XP24 device configuration,
43
- and implements XP24 telegram format.
44
+ Generates XP24-specific responses, handles XP24 device configuration, and implements
45
+ XP24 telegram format.
44
46
  """
45
47
 
46
48
  def __init__(
@@ -49,7 +51,8 @@ class XP24ServerService(BaseServerService):
49
51
  _variant: str = "",
50
52
  msactiontable_serializer: Optional[Xp24MsActionTableSerializer] = None,
51
53
  ):
52
- """Initialize XP24 server service.
54
+ """
55
+ Initialize XP24 server service.
53
56
 
54
57
  Args:
55
58
  serial_number: The device serial number.
@@ -108,7 +111,8 @@ class XP24ServerService(BaseServerService):
108
111
  return telegrams
109
112
 
110
113
  def _build_ack_nak_response_telegram(self, ack_or_nak: bool) -> str:
111
- """Build a complete ACK or NAK response telegram with checksum.
114
+ """
115
+ Build a complete ACK or NAK response telegram with checksum.
112
116
 
113
117
  Args:
114
118
  ack_or_nak: true: ACK telegram response, false: NAK telegram response.
@@ -125,7 +129,8 @@ class XP24ServerService(BaseServerService):
125
129
  def _build_make_break_response_telegram(
126
130
  self, make_or_break: bool, output_number: int
127
131
  ) -> str:
128
- """Build a complete ACK or NAK response telegram with checksum.
132
+ """
133
+ Build a complete ACK or NAK response telegram with checksum.
129
134
 
130
135
  Args:
131
136
  make_or_break: true: MAKE event response, false: BREAK event response.
@@ -192,7 +197,8 @@ class XP24ServerService(BaseServerService):
192
197
  )
193
198
 
194
199
  def _get_msactiontable_serializer(self) -> Optional[Xp24MsActionTableSerializer]:
195
- """Get the MsActionTable serializer for XP24.
200
+ """
201
+ Get the MsActionTable serializer for XP24.
196
202
 
197
203
  Returns:
198
204
  The XP24 MsActionTable serializer instance.
@@ -200,7 +206,8 @@ class XP24ServerService(BaseServerService):
200
206
  return self.msactiontable_serializer
201
207
 
202
208
  def _get_msactiontable(self) -> Optional[Xp24MsActionTable]:
203
- """Get the MsActionTable for XP24.
209
+ """
210
+ Get the MsActionTable for XP24.
204
211
 
205
212
  Returns:
206
213
  The XP24 MsActionTable instance.
@@ -208,7 +215,8 @@ class XP24ServerService(BaseServerService):
208
215
  return self.msactiontable
209
216
 
210
217
  def _get_default_msactiontable(self) -> Xp24MsActionTable:
211
- """Generate default MsActionTable configuration.
218
+ """
219
+ Generate default MsActionTable configuration.
212
220
 
213
221
  Returns:
214
222
  Default XP24 MsActionTable with all inputs set to VOID.
@@ -226,7 +234,8 @@ class XP24ServerService(BaseServerService):
226
234
  )
227
235
 
228
236
  def get_device_info(self) -> Dict:
229
- """Get XP24 device information.
237
+ """
238
+ Get XP24 device information.
230
239
 
231
240
  Returns:
232
241
  Dictionary containing device information.
@@ -1,8 +1,8 @@
1
- """XP33 Server Service for device emulation.
1
+ """
2
+ XP33 Server Service for device emulation.
2
3
 
3
- This service provides XP33-specific device emulation functionality,
4
- including response generation and device configuration handling for
5
- 3-channel light dimmer modules.
4
+ This service provides XP33-specific device emulation functionality, including response
5
+ generation and device configuration handling for 3-channel light dimmer modules.
6
6
  """
7
7
 
8
8
  import socket
@@ -30,8 +30,8 @@ class XP33ServerService(BaseServerService):
30
30
  """
31
31
  XP33 device emulation service.
32
32
 
33
- Generates XP33-specific responses, handles XP33 device configuration,
34
- and implements XP33 telegram format for 3-channel dimmer modules.
33
+ Generates XP33-specific responses, handles XP33 device configuration, and implements
34
+ XP33 telegram format for 3-channel dimmer modules.
35
35
  """
36
36
 
37
37
  def __init__(
@@ -40,7 +40,8 @@ class XP33ServerService(BaseServerService):
40
40
  variant: str = "XP33LR",
41
41
  msactiontable_serializer: Optional[Xp33MsActionTableSerializer] = None,
42
42
  ):
43
- """Initialize XP33 server service.
43
+ """
44
+ Initialize XP33 server service.
44
45
 
45
46
  Args:
46
47
  serial_number: The device serial number.
@@ -110,7 +111,8 @@ class XP33ServerService(BaseServerService):
110
111
  return telegrams
111
112
 
112
113
  def _handle_action_channel_dimming(self, data_value: str) -> str:
113
- """Handle XP33-specific channel dimming action.
114
+ """
115
+ Handle XP33-specific channel dimming action.
114
116
 
115
117
  Args:
116
118
  data_value: Action data in format channel_number:dimming_level.
@@ -151,7 +153,8 @@ class XP33ServerService(BaseServerService):
151
153
  return telegrams
152
154
 
153
155
  def _build_ack_nak_response_telegram(self, ack_or_nak: bool) -> str:
154
- """Build a complete ACK or NAK response telegram with checksum.
156
+ """
157
+ Build a complete ACK or NAK response telegram with checksum.
155
158
 
156
159
  Args:
157
160
  ack_or_nak: true: ACK telegram response, false: NAK telegram response.
@@ -168,7 +171,8 @@ class XP33ServerService(BaseServerService):
168
171
  def _build_dimming_event_telegram(
169
172
  self, dimming_level: int, channel_number: int
170
173
  ) -> str:
171
- """Build a complete dimming event telegram with checksum.
174
+ """
175
+ Build a complete dimming event telegram with checksum.
172
176
 
173
177
  Args:
174
178
  dimming_level: Dimming level 0-100%.
@@ -239,7 +243,8 @@ class XP33ServerService(BaseServerService):
239
243
  return telegram
240
244
 
241
245
  def _handle_read_module_output_state(self) -> str:
242
- """Handle XP33-specific module output state.
246
+ """
247
+ Handle XP33-specific module output state.
243
248
 
244
249
  Returns:
245
250
  String representation of the output state for 3 channels.
@@ -252,7 +257,8 @@ class XP33ServerService(BaseServerService):
252
257
  )
253
258
 
254
259
  def _handle_read_module_state(self) -> str:
255
- """Handle XP33-specific module state.
260
+ """
261
+ Handle XP33-specific module state.
256
262
 
257
263
  Returns:
258
264
  'ON' if any channel is active, 'OFF' otherwise.
@@ -262,7 +268,8 @@ class XP33ServerService(BaseServerService):
262
268
  return "OFF"
263
269
 
264
270
  def _handle_read_module_operating_hours(self) -> str:
265
- """Handle XP33-specific module operating hours.
271
+ """
272
+ Handle XP33-specific module operating hours.
266
273
 
267
274
  Returns:
268
275
  Operating hours for all 3 channels.
@@ -270,7 +277,8 @@ class XP33ServerService(BaseServerService):
270
277
  return "00:000[H],01:000[H],02:000[H]"
271
278
 
272
279
  def _handle_read_light_level(self) -> str:
273
- """Handle XP33-specific light level reading.
280
+ """
281
+ Handle XP33-specific light level reading.
274
282
 
275
283
  Returns:
276
284
  Light levels for all channels in format "00:000[%],01:000[%],02:000[%]".
@@ -281,7 +289,8 @@ class XP33ServerService(BaseServerService):
281
289
  return ",".join(levels)
282
290
 
283
291
  def _trigger_storm_mode(self) -> Optional[str]:
284
- """Trigger storm mode via D99 query.
292
+ """
293
+ Trigger storm mode via D99 query.
285
294
 
286
295
  Starts a background thread that sends 2 packets per second.
287
296
  If storm is already active, this is a no-op.
@@ -322,7 +331,8 @@ class XP33ServerService(BaseServerService):
322
331
  return None # No response when entering storm mode
323
332
 
324
333
  def _exit_storm_mode(self) -> str:
325
- """Exit storm mode and return error code FE.
334
+ """
335
+ Exit storm mode and return error code FE.
326
336
 
327
337
  Stops the background storm thread and returns error code.
328
338
 
@@ -350,7 +360,8 @@ class XP33ServerService(BaseServerService):
350
360
  return self._build_error_code_response("FE")
351
361
 
352
362
  def _storm_sender_thread(self) -> None:
353
- """Background thread that sends storm telegrams continuously.
363
+ """
364
+ Background thread that sends storm telegrams continuously.
354
365
 
355
366
  Sends 2 packets per second (500ms delay) until:
356
367
  - 200 packets have been sent, or
@@ -412,7 +423,8 @@ class XP33ServerService(BaseServerService):
412
423
  self.storm_mode = False
413
424
 
414
425
  def _build_error_code_response(self, error_code: str) -> str:
415
- """Build MODULE_ERROR_CODE response telegram.
426
+ """
427
+ Build MODULE_ERROR_CODE response telegram.
416
428
 
417
429
  Args:
418
430
  error_code: Error code (00 = normal, FE = buffer overflow).
@@ -432,7 +444,8 @@ class XP33ServerService(BaseServerService):
432
444
  return telegram
433
445
 
434
446
  def set_channel_dimming(self, channel: int, level: int) -> bool:
435
- """Set individual channel dimming level.
447
+ """
448
+ Set individual channel dimming level.
436
449
 
437
450
  Args:
438
451
  channel: Channel number (1-3).
@@ -448,7 +461,8 @@ class XP33ServerService(BaseServerService):
448
461
  return False
449
462
 
450
463
  def activate_scene(self, scene: int) -> bool:
451
- """Activate a pre-programmed scene.
464
+ """
465
+ Activate a pre-programmed scene.
452
466
 
453
467
  Args:
454
468
  scene: Scene number (1-4).
@@ -463,7 +477,8 @@ class XP33ServerService(BaseServerService):
463
477
  return False
464
478
 
465
479
  def _get_msactiontable_serializer(self) -> Optional[Xp33MsActionTableSerializer]:
466
- """Get the MsActionTable serializer for XP33.
480
+ """
481
+ Get the MsActionTable serializer for XP33.
467
482
 
468
483
  Returns:
469
484
  The XP33 MsActionTable serializer instance.
@@ -471,7 +486,8 @@ class XP33ServerService(BaseServerService):
471
486
  return self.msactiontable_serializer
472
487
 
473
488
  def _get_msactiontable(self) -> Optional[Xp33MsActionTable]:
474
- """Get the MsActionTable for XP33.
489
+ """
490
+ Get the MsActionTable for XP33.
475
491
 
476
492
  Returns:
477
493
  The XP33 MsActionTable instance.
@@ -479,7 +495,8 @@ class XP33ServerService(BaseServerService):
479
495
  return self.msactiontable
480
496
 
481
497
  def _get_default_msactiontable(self) -> Xp33MsActionTable:
482
- """Generate default MsActionTable configuration.
498
+ """
499
+ Generate default MsActionTable configuration.
483
500
 
484
501
  Returns:
485
502
  Default XP33 MsActionTable with all outputs at 0-100% range, no scenes configured.
@@ -488,7 +505,8 @@ class XP33ServerService(BaseServerService):
488
505
  return Xp33MsActionTable()
489
506
 
490
507
  def get_device_info(self) -> Dict:
491
- """Get XP33 device information.
508
+ """
509
+ Get XP33 device information.
492
510
 
493
511
  Returns:
494
512
  Dictionary containing device information.
@@ -508,7 +526,8 @@ class XP33ServerService(BaseServerService):
508
526
  }
509
527
 
510
528
  def get_technical_specs(self) -> Dict:
511
- """Get technical specifications.
529
+ """
530
+ Get technical specifications.
512
531
 
513
532
  Returns:
514
533
  Dictionary containing technical specifications.
@@ -1,7 +1,8 @@
1
- """Service for blink/unblink telegram operations.
1
+ """
2
+ Service for blink/unblink telegram operations.
2
3
 
3
- This service handles generation and parsing of blink/unblink system telegrams
4
- used for controlling module LED status.
4
+ This service handles generation and parsing of blink/unblink system telegrams used for
5
+ controlling module LED status.
5
6
  """
6
7
 
7
8
  from xp.models.telegram.reply_telegram import ReplyTelegram
@@ -31,7 +32,8 @@ class TelegramBlinkService:
31
32
 
32
33
  @staticmethod
33
34
  def generate_blink_telegram(serial_number: str, on_or_off: str) -> str:
34
- """Generate a telegram to start blinking a module's LED.
35
+ """
36
+ Generate a telegram to start blinking a module's LED.
35
37
 
36
38
  Args:
37
39
  serial_number: The 10-digit module serial number.
@@ -66,7 +68,8 @@ class TelegramBlinkService:
66
68
  return telegram
67
69
 
68
70
  def create_blink_telegram_object(self, serial_number: str) -> SystemTelegram:
69
- """Create a SystemTelegram object for blinking LED.
71
+ """
72
+ Create a SystemTelegram object for blinking LED.
70
73
 
71
74
  Args:
72
75
  serial_number: The 10-digit module serial number.
@@ -90,7 +93,8 @@ class TelegramBlinkService:
90
93
  return telegram
91
94
 
92
95
  def create_unblink_telegram_object(self, serial_number: str) -> SystemTelegram:
93
- """Create a SystemTelegram object for unblink LED.
96
+ """
97
+ Create a SystemTelegram object for unblink LED.
94
98
 
95
99
  Args:
96
100
  serial_number: The 10-digit module serial number.
@@ -115,7 +119,8 @@ class TelegramBlinkService:
115
119
 
116
120
  @staticmethod
117
121
  def is_ack_response(reply_telegram: ReplyTelegram) -> bool:
118
- """Check if a reply telegram is an ACK response.
122
+ """
123
+ Check if a reply telegram is an ACK response.
119
124
 
120
125
  Args:
121
126
  reply_telegram: Reply telegram to check.
@@ -127,7 +132,8 @@ class TelegramBlinkService:
127
132
 
128
133
  @staticmethod
129
134
  def is_nak_response(reply_telegram: ReplyTelegram) -> bool:
130
- """Check if a reply telegram is a NAK response.
135
+ """
136
+ Check if a reply telegram is a NAK response.
131
137
 
132
138
  Args:
133
139
  reply_telegram: Reply telegram to check.
@@ -1,7 +1,8 @@
1
- """Checksum service for telegram protocol validation and generation.
1
+ """
2
+ Checksum service for telegram protocol validation and generation.
2
3
 
3
- This service provides business logic for checksum operations,
4
- following the layered architecture pattern.
4
+ This service provides business logic for checksum operations, following the layered
5
+ architecture pattern.
5
6
  """
6
7
 
7
8
  from typing import Union
@@ -19,7 +20,8 @@ class TelegramChecksumService:
19
20
 
20
21
  @staticmethod
21
22
  def calculate_simple_checksum(data: str) -> Response:
22
- """Calculate simple XOR checksum for string data.
23
+ """
24
+ Calculate simple XOR checksum for string data.
23
25
 
24
26
  Args:
25
27
  data: String data to calculate checksum for.
@@ -42,7 +44,8 @@ class TelegramChecksumService:
42
44
 
43
45
  @staticmethod
44
46
  def calculate_crc32_checksum(data: Union[str, bytes]) -> Response:
45
- """Calculate CRC32 checksum for data.
47
+ """
48
+ Calculate CRC32 checksum for data.
46
49
 
47
50
  Args:
48
51
  data: String or bytes data to calculate checksum for.
@@ -79,7 +82,8 @@ class TelegramChecksumService:
79
82
 
80
83
  @staticmethod
81
84
  def validate_checksum(data: str, expected_checksum: str) -> Response:
82
- """Validate data against expected simple checksum.
85
+ """
86
+ Validate data against expected simple checksum.
83
87
 
84
88
  Args:
85
89
  data: Original data.
@@ -111,7 +115,8 @@ class TelegramChecksumService:
111
115
  def validate_crc32_checksum(
112
116
  data: Union[str, bytes], expected_checksum: str
113
117
  ) -> Response:
114
- """Validate data against expected CRC32 checksum.
118
+ """
119
+ Validate data against expected CRC32 checksum.
115
120
 
116
121
  Args:
117
122
  data: Original data (string or bytes).
@@ -2,15 +2,16 @@
2
2
 
3
3
 
4
4
  class TelegramDatapointService:
5
- """Service for processing Telegram protocol datapoint values.
5
+ """
6
+ Service for processing Telegram protocol datapoint values.
6
7
 
7
- Provides methods to parse and extract values from different types of
8
- Telegram datapoints including autoreport status, light level outputs,
9
- and link number values.
8
+ Provides methods to parse and extract values from different types of Telegram
9
+ datapoints including autoreport status, light level outputs, and link number values.
10
10
  """
11
11
 
12
12
  def get_autoreport_status(self, data_value: str) -> bool:
13
- """Get the autoreport status value.
13
+ """
14
+ Get the autoreport status value.
14
15
 
15
16
  Args:
16
17
  data_value: The raw autoreport status data value (PP or AA).
@@ -22,7 +23,8 @@ class TelegramDatapointService:
22
23
  return status_value
23
24
 
24
25
  def get_autoreport_status_data_value(self, status_value: bool) -> str:
25
- """Get the autoreport status data_value.
26
+ """
27
+ Get the autoreport status data_value.
26
28
 
27
29
  Args:
28
30
  status_value: Enable (True) or disable (False).
@@ -34,7 +36,8 @@ class TelegramDatapointService:
34
36
  return data_value
35
37
 
36
38
  def get_lightlevel(self, data_value: str, output_number: int) -> int:
37
- """Extract the light level for a specific output number.
39
+ """
40
+ Extract the light level for a specific output number.
38
41
 
39
42
  Parses comma-separated output data in the format "output:level[%]"
40
43
  and returns the level for the requested output number.
@@ -58,7 +61,8 @@ class TelegramDatapointService:
58
61
  return level
59
62
 
60
63
  def get_linknumber(self, data_value: str) -> int:
61
- """Parse and return the link number value.
64
+ """
65
+ Parse and return the link number value.
62
66
 
63
67
  Args:
64
68
  data_value: The raw link number data value as a string.
@@ -70,7 +74,8 @@ class TelegramDatapointService:
70
74
  return link_number_value
71
75
 
72
76
  def get_modulenumber(self, data_value: str) -> int:
73
- """Parse and return the module number value.
77
+ """
78
+ Parse and return the module number value.
74
79
 
75
80
  Args:
76
81
  data_value: The raw module number data value as a string.
@@ -1,7 +1,8 @@
1
- """Service for device discover telegram operations.
1
+ """
2
+ Service for device discover telegram operations.
2
3
 
3
- This service handles generation and parsing of device discover system telegrams
4
- used for enumerating all connected devices on the console bus.
4
+ This service handles generation and parsing of device discover system telegrams used for
5
+ enumerating all connected devices on the console bus.
5
6
  """
6
7
 
7
8
  from typing import List, Set
@@ -24,7 +25,8 @@ class DeviceInfo:
24
25
  def __init__(
25
26
  self, serial_number: str, checksum_valid: bool = True, raw_telegram: str = ""
26
27
  ):
27
- """Initialize device info.
28
+ """
29
+ Initialize device info.
28
30
 
29
31
  Args:
30
32
  serial_number: 10-digit module serial number.
@@ -36,7 +38,8 @@ class DeviceInfo:
36
38
  self.raw_telegram = raw_telegram
37
39
 
38
40
  def __str__(self) -> str:
39
- """Return string representation of device.
41
+ """
42
+ Return string representation of device.
40
43
 
41
44
  Returns:
42
45
  String with serial number and checksum status.
@@ -45,7 +48,8 @@ class DeviceInfo:
45
48
  return f"Device {self.serial_number} ({status})"
46
49
 
47
50
  def __repr__(self) -> str:
48
- """Return repr representation of device.
51
+ """
52
+ Return repr representation of device.
49
53
 
50
54
  Returns:
51
55
  DeviceInfo constructor representation.
@@ -53,7 +57,8 @@ class DeviceInfo:
53
57
  return f"DeviceInfo(serial='{self.serial_number}', checksum_valid={self.checksum_valid})"
54
58
 
55
59
  def to_dict(self) -> dict:
56
- """Convert to dictionary for JSON serialization.
60
+ """
61
+ Convert to dictionary for JSON serialization.
57
62
 
58
63
  Returns:
59
64
  Dictionary with device information.
@@ -99,7 +104,8 @@ class TelegramDiscoverService:
99
104
  return telegram
100
105
 
101
106
  def create_discover_telegram_object(self) -> SystemTelegram:
102
- """Create a SystemTelegram object for discover broadcast.
107
+ """
108
+ Create a SystemTelegram object for discover broadcast.
103
109
 
104
110
  Returns:
105
111
  SystemTelegram object representing the discover command.
@@ -121,7 +127,8 @@ class TelegramDiscoverService:
121
127
 
122
128
  @staticmethod
123
129
  def is_discover_response(reply_telegram: ReplyTelegram) -> bool:
124
- """Check if a reply telegram is a discover response.
130
+ """
131
+ Check if a reply telegram is a discover response.
125
132
 
126
133
  Args:
127
134
  reply_telegram: Reply telegram to check.
@@ -133,7 +140,8 @@ class TelegramDiscoverService:
133
140
 
134
141
  @staticmethod
135
142
  def _generate_discover_response(serial_number: str) -> str:
136
- """Generate discover response telegram for a device.
143
+ """
144
+ Generate discover response telegram for a device.
137
145
 
138
146
  Args:
139
147
  serial_number: 10-digit module serial number.
@@ -149,7 +157,8 @@ class TelegramDiscoverService:
149
157
 
150
158
  @staticmethod
151
159
  def get_unique_devices(devices: List[DeviceInfo]) -> List[DeviceInfo]:
152
- """Filter out duplicate devices based on serial number.
160
+ """
161
+ Filter out duplicate devices based on serial number.
153
162
 
154
163
  Args:
155
164
  devices: List of discovered devices.
@@ -169,7 +178,8 @@ class TelegramDiscoverService:
169
178
 
170
179
  @staticmethod
171
180
  def validate_discover_response_format(raw_telegram: str) -> bool:
172
- """Validate if a raw telegram matches discover response format.
181
+ """
182
+ Validate if a raw telegram matches discover response format.
173
183
 
174
184
  Args:
175
185
  raw_telegram: Raw telegram string to validate.
@@ -187,7 +197,8 @@ class TelegramDiscoverService:
187
197
  return match is not None
188
198
 
189
199
  def generate_discover_summary(self, devices: List[DeviceInfo]) -> dict:
190
- """Generate a summary of a discover results.
200
+ """
201
+ Generate a summary of a discover results.
191
202
 
192
203
  Args:
193
204
  devices: List of discovered devices.
@@ -223,7 +234,8 @@ class TelegramDiscoverService:
223
234
  }
224
235
 
225
236
  def format_discover_results(self, devices: List[DeviceInfo]) -> str:
226
- """Format discover results for human-readable output.
237
+ """
238
+ Format discover results for human-readable output.
227
239
 
228
240
  Args:
229
241
  devices: List of discovered devices.
@@ -263,7 +275,8 @@ class TelegramDiscoverService:
263
275
 
264
276
  @staticmethod
265
277
  def is_discover_request(telegram: SystemTelegram) -> bool:
266
- """Check if telegram is a discover request.
278
+ """
279
+ Check if telegram is a discover request.
267
280
 
268
281
  Args:
269
282
  telegram: System telegram to check.