conson-xp 1.1.0__py3-none-any.whl → 1.2.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 (167) hide show
  1. {conson_xp-1.1.0.dist-info → conson_xp-1.2.0.dist-info}/METADATA +1 -1
  2. conson_xp-1.2.0.dist-info/RECORD +181 -0
  3. xp/__init__.py +4 -3
  4. xp/api/main.py +18 -3
  5. xp/api/models/api.py +13 -2
  6. xp/api/models/discover.py +12 -2
  7. xp/api/routers/conbus_blink.py +18 -6
  8. xp/api/routers/conbus_custom.py +11 -3
  9. xp/api/routers/conbus_datapoint.py +10 -3
  10. xp/api/routers/conbus_output.py +29 -9
  11. xp/api/routers/errors.py +6 -5
  12. xp/cli/__init__.py +1 -1
  13. xp/cli/commands/__init__.py +1 -0
  14. xp/cli/commands/api.py +1 -5
  15. xp/cli/commands/api_start_commands.py +14 -8
  16. xp/cli/commands/conbus/conbus.py +9 -37
  17. xp/cli/commands/conbus/conbus_actiontable_commands.py +21 -1
  18. xp/cli/commands/conbus/conbus_autoreport_commands.py +21 -11
  19. xp/cli/commands/conbus/conbus_blink_commands.py +53 -21
  20. xp/cli/commands/conbus/conbus_config_commands.py +7 -4
  21. xp/cli/commands/conbus/conbus_custom_commands.py +13 -4
  22. xp/cli/commands/conbus/conbus_datapoint_commands.py +28 -8
  23. xp/cli/commands/conbus/conbus_discover_commands.py +15 -4
  24. xp/cli/commands/conbus/conbus_lightlevel_commands.py +50 -11
  25. xp/cli/commands/conbus/conbus_linknumber_commands.py +21 -11
  26. xp/cli/commands/conbus/conbus_msactiontable_commands.py +25 -1
  27. xp/cli/commands/conbus/conbus_output_commands.py +46 -12
  28. xp/cli/commands/conbus/conbus_raw_commands.py +17 -6
  29. xp/cli/commands/conbus/conbus_receive_commands.py +15 -7
  30. xp/cli/commands/conbus/conbus_scan_commands.py +17 -4
  31. xp/cli/commands/file_commands.py +26 -15
  32. xp/cli/commands/homekit/homekit.py +14 -8
  33. xp/cli/commands/homekit/homekit_start_commands.py +5 -5
  34. xp/cli/commands/module_commands.py +26 -19
  35. xp/cli/commands/reverse_proxy_commands.py +24 -18
  36. xp/cli/commands/server/server_commands.py +18 -18
  37. xp/cli/commands/telegram/telegram.py +4 -12
  38. xp/cli/commands/telegram/telegram_blink_commands.py +10 -8
  39. xp/cli/commands/telegram/telegram_checksum_commands.py +19 -8
  40. xp/cli/commands/telegram/telegram_discover_commands.py +2 -4
  41. xp/cli/commands/telegram/telegram_linknumber_commands.py +11 -8
  42. xp/cli/commands/telegram/telegram_parse_commands.py +10 -9
  43. xp/cli/commands/telegram/telegram_version_commands.py +8 -4
  44. xp/cli/main.py +5 -1
  45. xp/cli/utils/click_tree.py +23 -3
  46. xp/cli/utils/datapoint_type_choice.py +20 -0
  47. xp/cli/utils/decorators.py +165 -14
  48. xp/cli/utils/error_handlers.py +49 -18
  49. xp/cli/utils/formatters.py +95 -10
  50. xp/cli/utils/serial_number_type.py +18 -0
  51. xp/cli/utils/system_function_choice.py +20 -0
  52. xp/cli/utils/xp_module_type.py +20 -0
  53. xp/connection/__init__.py +1 -1
  54. xp/connection/exceptions.py +5 -5
  55. xp/models/__init__.py +1 -1
  56. xp/models/actiontable/__init__.py +1 -0
  57. xp/models/actiontable/actiontable.py +17 -1
  58. xp/models/actiontable/msactiontable_xp20.py +10 -0
  59. xp/models/actiontable/msactiontable_xp24.py +20 -3
  60. xp/models/actiontable/msactiontable_xp33.py +27 -4
  61. xp/models/conbus/__init__.py +1 -0
  62. xp/models/conbus/conbus.py +34 -4
  63. xp/models/conbus/conbus_autoreport.py +20 -2
  64. xp/models/conbus/conbus_blink.py +22 -2
  65. xp/models/conbus/conbus_client_config.py +22 -1
  66. xp/models/conbus/conbus_connection_status.py +16 -2
  67. xp/models/conbus/conbus_custom.py +21 -2
  68. xp/models/conbus/conbus_datapoint.py +22 -2
  69. xp/models/conbus/conbus_discover.py +18 -2
  70. xp/models/conbus/conbus_lightlevel.py +20 -2
  71. xp/models/conbus/conbus_linknumber.py +20 -2
  72. xp/models/conbus/conbus_output.py +22 -2
  73. xp/models/conbus/conbus_raw.py +17 -2
  74. xp/models/conbus/conbus_receive.py +16 -2
  75. xp/models/homekit/__init__.py +1 -0
  76. xp/models/homekit/homekit_accessory.py +15 -1
  77. xp/models/homekit/homekit_config.py +52 -0
  78. xp/models/homekit/homekit_conson_config.py +32 -0
  79. xp/models/log_entry.py +49 -9
  80. xp/models/protocol/__init__.py +1 -0
  81. xp/models/protocol/conbus_protocol.py +130 -21
  82. xp/models/telegram/__init__.py +1 -0
  83. xp/models/telegram/action_type.py +16 -2
  84. xp/models/telegram/datapoint_type.py +36 -2
  85. xp/models/telegram/event_telegram.py +46 -10
  86. xp/models/telegram/event_type.py +8 -1
  87. xp/models/telegram/input_action_type.py +34 -2
  88. xp/models/telegram/input_type.py +9 -1
  89. xp/models/telegram/module_type.py +69 -19
  90. xp/models/telegram/module_type_code.py +43 -1
  91. xp/models/telegram/output_telegram.py +30 -6
  92. xp/models/telegram/reply_telegram.py +56 -11
  93. xp/models/telegram/system_function.py +35 -3
  94. xp/models/telegram/system_telegram.py +18 -4
  95. xp/models/telegram/telegram.py +12 -3
  96. xp/models/telegram/telegram_type.py +8 -1
  97. xp/models/telegram/timeparam_type.py +27 -0
  98. xp/models/write_config_type.py +17 -2
  99. xp/services/__init__.py +1 -1
  100. xp/services/conbus/__init__.py +1 -0
  101. xp/services/conbus/actiontable/__init__.py +1 -0
  102. xp/services/conbus/actiontable/actiontable_service.py +33 -2
  103. xp/services/conbus/actiontable/msactiontable_service.py +40 -3
  104. xp/services/conbus/actiontable/msactiontable_xp24_serializer.py +36 -4
  105. xp/services/conbus/actiontable/msactiontable_xp33_serializer.py +45 -5
  106. xp/services/conbus/conbus_autoreport_get_service.py +17 -8
  107. xp/services/conbus/conbus_autoreport_set_service.py +29 -16
  108. xp/services/conbus/conbus_blink_all_service.py +40 -21
  109. xp/services/conbus/conbus_blink_service.py +37 -13
  110. xp/services/conbus/conbus_custom_service.py +29 -13
  111. xp/services/conbus/conbus_datapoint_queryall_service.py +40 -16
  112. xp/services/conbus/conbus_datapoint_service.py +33 -12
  113. xp/services/conbus/conbus_discover_service.py +43 -7
  114. xp/services/conbus/conbus_lightlevel_get_service.py +22 -14
  115. xp/services/conbus/conbus_lightlevel_set_service.py +40 -20
  116. xp/services/conbus/conbus_linknumber_get_service.py +18 -10
  117. xp/services/conbus/conbus_linknumber_set_service.py +34 -8
  118. xp/services/conbus/conbus_output_service.py +33 -13
  119. xp/services/conbus/conbus_raw_service.py +36 -16
  120. xp/services/conbus/conbus_receive_service.py +38 -6
  121. xp/services/conbus/conbus_scan_service.py +44 -18
  122. xp/services/homekit/__init__.py +1 -0
  123. xp/services/homekit/homekit_cache_service.py +31 -6
  124. xp/services/homekit/homekit_conbus_service.py +33 -2
  125. xp/services/homekit/homekit_config_validator.py +97 -15
  126. xp/services/homekit/homekit_conson_validator.py +51 -7
  127. xp/services/homekit/homekit_dimminglight.py +47 -1
  128. xp/services/homekit/homekit_dimminglight_service.py +35 -1
  129. xp/services/homekit/homekit_hap_service.py +71 -18
  130. xp/services/homekit/homekit_lightbulb.py +35 -1
  131. xp/services/homekit/homekit_lightbulb_service.py +30 -2
  132. xp/services/homekit/homekit_module_service.py +23 -1
  133. xp/services/homekit/homekit_outlet.py +47 -1
  134. xp/services/homekit/homekit_outlet_service.py +44 -2
  135. xp/services/homekit/homekit_service.py +113 -19
  136. xp/services/log_file_service.py +37 -41
  137. xp/services/module_type_service.py +26 -5
  138. xp/services/protocol/__init__.py +1 -1
  139. xp/services/protocol/conbus_protocol.py +110 -16
  140. xp/services/protocol/protocol_factory.py +40 -0
  141. xp/services/protocol/telegram_protocol.py +38 -7
  142. xp/services/reverse_proxy_service.py +79 -14
  143. xp/services/server/__init__.py +1 -0
  144. xp/services/server/base_server_service.py +102 -14
  145. xp/services/server/cp20_server_service.py +12 -4
  146. xp/services/server/server_service.py +26 -11
  147. xp/services/server/xp130_server_service.py +11 -3
  148. xp/services/server/xp20_server_service.py +11 -3
  149. xp/services/server/xp230_server_service.py +11 -3
  150. xp/services/server/xp24_server_service.py +33 -6
  151. xp/services/server/xp33_server_service.py +41 -8
  152. xp/services/telegram/__init__.py +1 -0
  153. xp/services/telegram/telegram_blink_service.py +19 -31
  154. xp/services/telegram/telegram_checksum_service.py +10 -10
  155. xp/services/telegram/telegram_discover_service.py +58 -29
  156. xp/services/telegram/telegram_link_number_service.py +27 -40
  157. xp/services/telegram/telegram_output_service.py +46 -49
  158. xp/services/telegram/telegram_service.py +41 -41
  159. xp/services/telegram/telegram_version_service.py +4 -2
  160. xp/utils/__init__.py +1 -1
  161. xp/utils/dependencies.py +0 -1
  162. xp/utils/serialization.py +6 -0
  163. xp/utils/time_utils.py +6 -11
  164. conson_xp-1.1.0.dist-info/RECORD +0 -181
  165. {conson_xp-1.1.0.dist-info → conson_xp-1.2.0.dist-info}/WHEEL +0 -0
  166. {conson_xp-1.1.0.dist-info → conson_xp-1.2.0.dist-info}/entry_points.txt +0 -0
  167. {conson_xp-1.1.0.dist-info → conson_xp-1.2.0.dist-info}/licenses/LICENSE +0 -0
@@ -22,15 +22,15 @@ from xp.services.conbus.conbus_linknumber_set_service import ConbusLinknumberSet
22
22
  def set_linknumber_command(
23
23
  ctx: click.Context, serial_number: str, link_number: int
24
24
  ) -> None:
25
- """
26
- Set the link number for a specific module.
25
+ r"""Set the link number for a specific module.
27
26
 
28
- SERIAL_NUMBER: 10-digit module serial number
29
- LINK_NUMBER: Link number to set (0-99)
27
+ Args:
28
+ ctx: Click context object.
29
+ serial_number: 10-digit module serial number.
30
+ link_number: Link number to set (0-99).
30
31
 
31
32
  Examples:
32
-
33
- \b
33
+ \b
34
34
  xp conbus linknumber set 0123450001 25
35
35
  """
36
36
  service = (
@@ -38,6 +38,11 @@ def set_linknumber_command(
38
38
  )
39
39
 
40
40
  def on_finish(response: ConbusLinknumberResponse) -> None:
41
+ """Handle successful completion of link number set command.
42
+
43
+ Args:
44
+ response: Link number response object.
45
+ """
41
46
  click.echo(json.dumps(response.to_dict(), indent=2))
42
47
 
43
48
  with service:
@@ -53,14 +58,14 @@ def set_linknumber_command(
53
58
  @click.pass_context
54
59
  @connection_command()
55
60
  def get_linknumber_command(ctx: click.Context, serial_number: str) -> None:
56
- """
57
- Get the current link number for a specific module.
61
+ r"""Get the current link number for a specific module.
58
62
 
59
- SERIAL_NUMBER: 10-digit module serial number
63
+ Args:
64
+ ctx: Click context object.
65
+ serial_number: 10-digit module serial number.
60
66
 
61
67
  Examples:
62
-
63
- \b
68
+ \b
64
69
  xp conbus linknumber get 0123450001
65
70
  """
66
71
  service = (
@@ -68,6 +73,11 @@ def get_linknumber_command(ctx: click.Context, serial_number: str) -> None:
68
73
  )
69
74
 
70
75
  def on_finish(response: ConbusLinknumberResponse) -> None:
76
+ """Handle successful completion of link number get command.
77
+
78
+ Args:
79
+ response: Link number response object.
80
+ """
71
81
  click.echo(json.dumps(response.to_dict(), indent=2))
72
82
 
73
83
  with service:
@@ -26,13 +26,29 @@ from xp.services.conbus.actiontable.msactiontable_service import (
26
26
  def conbus_download_msactiontable(
27
27
  ctx: Context, serial_number: str, xpmoduletype: str
28
28
  ) -> None:
29
- """Download MS action table from XP24 module"""
29
+ """Download MS action table from XP24 module.
30
+
31
+ Args:
32
+ ctx: Click context object.
33
+ serial_number: 10-digit module serial number.
34
+ xpmoduletype: XP module type.
35
+ """
30
36
  service = ctx.obj.get("container").get_container().resolve(MsActionTableService)
31
37
 
32
38
  def progress_callback(progress: str) -> None:
39
+ """Handle progress updates during MS action table download.
40
+
41
+ Args:
42
+ progress: Progress message string.
43
+ """
33
44
  click.echo(progress, nl=False)
34
45
 
35
46
  def finish_callback(action_table: ActionTable) -> None:
47
+ """Handle successful completion of MS action table download.
48
+
49
+ Args:
50
+ action_table: Downloaded MS action table object.
51
+ """
36
52
  output = {
37
53
  "serial_number": serial_number,
38
54
  "xpmoduletype": xpmoduletype,
@@ -41,6 +57,14 @@ def conbus_download_msactiontable(
41
57
  click.echo(json.dumps(output, indent=2, default=str))
42
58
 
43
59
  def error_callback(error: str) -> None:
60
+ """Handle errors during MS action table download.
61
+
62
+ Args:
63
+ error: Error message string.
64
+
65
+ Raises:
66
+ Abort: Always raised to abort the command on error.
67
+ """
44
68
  click.echo(f"Error: {error}")
45
69
  raise click.Abort()
46
70
 
@@ -23,16 +23,25 @@ from xp.services.conbus.conbus_output_service import ConbusOutputService
23
23
  @click.pass_context
24
24
  @connection_command()
25
25
  def xp_output_on(ctx: click.Context, serial_number: str, output_number: int) -> None:
26
- """Send ON command for output_number XP module serial_number
26
+ r"""Send ON command for output_number XP module serial_number.
27
27
 
28
- Examples:
28
+ Args:
29
+ ctx: Click context object.
30
+ serial_number: 10-digit module serial number.
31
+ output_number: Output number.
29
32
 
30
- \b
33
+ Examples:
34
+ \b
31
35
  xp conbus output on 0011223344 0 # Turn on output 0
32
36
  """
33
37
  service = ctx.obj.get("container").get_container().resolve(ConbusOutputService)
34
38
 
35
39
  def on_finish(response: ConbusOutputResponse) -> None:
40
+ """Handle successful completion of output on command.
41
+
42
+ Args:
43
+ response: Output response object.
44
+ """
36
45
  click.echo(json.dumps(response.to_dict(), indent=2))
37
46
 
38
47
  with service:
@@ -50,16 +59,25 @@ def xp_output_on(ctx: click.Context, serial_number: str, output_number: int) ->
50
59
  @click.pass_context
51
60
  @connection_command()
52
61
  def xp_output_off(ctx: click.Context, serial_number: str, output_number: int) -> None:
53
- """Send OFF command for output_number XP module serial_number
62
+ r"""Send OFF command for output_number XP module serial_number.
54
63
 
55
- Examples:
64
+ Args:
65
+ ctx: Click context object.
66
+ serial_number: 10-digit module serial number.
67
+ output_number: Output number.
56
68
 
57
- \b
69
+ Examples:
70
+ \b
58
71
  xp conbus output off 0011223344 1 # Turn off output 1
59
72
  """
60
73
  service = ctx.obj.get("container").get_container().resolve(ConbusOutputService)
61
74
 
62
75
  def on_finish(response: ConbusOutputResponse) -> None:
76
+ """Handle successful completion of output off command.
77
+
78
+ Args:
79
+ response: Output response object.
80
+ """
63
81
  click.echo(json.dumps(response.to_dict(), indent=2))
64
82
 
65
83
  with service:
@@ -76,11 +94,14 @@ def xp_output_off(ctx: click.Context, serial_number: str, output_number: int) ->
76
94
  @click.pass_context
77
95
  @connection_command()
78
96
  def xp_output_status(ctx: click.Context, serial_number: str) -> None:
79
- """Query output state command to XP module serial_number.
97
+ r"""Query output state command to XP module serial_number.
80
98
 
81
- Examples:
99
+ Args:
100
+ ctx: Click context object.
101
+ serial_number: 10-digit module serial number.
82
102
 
83
- \b
103
+ Examples:
104
+ \b
84
105
  xp conbus output status 0011223344 # Query output status
85
106
  """
86
107
  service: ConbusDatapointService = (
@@ -88,6 +109,11 @@ def xp_output_status(ctx: click.Context, serial_number: str) -> None:
88
109
  )
89
110
 
90
111
  def on_finish(response: ConbusDatapointResponse) -> None:
112
+ """Handle successful completion of output status query.
113
+
114
+ Args:
115
+ response: Datapoint response object.
116
+ """
91
117
  click.echo(json.dumps(response.to_dict(), indent=2))
92
118
 
93
119
  with service:
@@ -103,11 +129,14 @@ def xp_output_status(ctx: click.Context, serial_number: str) -> None:
103
129
  @click.pass_context
104
130
  @connection_command()
105
131
  def xp_module_state(ctx: click.Context, serial_number: str) -> None:
106
- """Query module state of the XP module serial_number
132
+ r"""Query module state of the XP module serial_number.
107
133
 
108
- Examples:
134
+ Args:
135
+ ctx: Click context object.
136
+ serial_number: 10-digit module serial number.
109
137
 
110
- \b
138
+ Examples:
139
+ \b
111
140
  xp conbus output state 0011223344 # Query module state
112
141
  """
113
142
  service: ConbusDatapointService = (
@@ -115,6 +144,11 @@ def xp_module_state(ctx: click.Context, serial_number: str) -> None:
115
144
  )
116
145
 
117
146
  def on_finish(response: ConbusDatapointResponse) -> None:
147
+ """Handle successful completion of module state query.
148
+
149
+ Args:
150
+ response: Datapoint response object.
151
+ """
118
152
  click.echo(json.dumps(response.to_dict(), indent=2))
119
153
 
120
154
  with service:
@@ -18,28 +18,39 @@ from xp.services.conbus.conbus_raw_service import ConbusRawService
18
18
  @click.pass_context
19
19
  @connection_command()
20
20
  def send_raw_telegrams(ctx: Context, raw_telegrams: str) -> None:
21
- """
22
- Send raw telegram sequence to Conbus server.
21
+ r"""Send raw telegram sequence to Conbus server.
23
22
 
24
23
  Accepts a string containing one or more telegrams in format <...>.
25
24
  Multiple telegrams should be concatenated without separators.
26
25
 
27
- Examples:
26
+ Args:
27
+ ctx: Click context object.
28
+ raw_telegrams: Raw telegram string(s).
28
29
 
29
- \b
30
+ Examples:
31
+ \b
30
32
  xp conbus raw '<S2113010000F02D12>'
31
33
  xp conbus raw '<S2113010000F02D12><S2113010001F02D12><S2113010002F02D12>'
32
- xp conbus raw '<S0012345003F02D12FM><S0012345004F02D12FD><S0012345005F02D12FI><S0012345006F02D12FL><S0012345007F02D12FK><S0012345008F02D12FJ><S0012345009F02D12FF>'
34
+ xp conbus raw '<S0012345003F02D12FM>...<S0012345009F02D12FF>'
33
35
  """
34
36
  service: ConbusRawService = (
35
37
  ctx.obj.get("container").get_container().resolve(ConbusRawService)
36
38
  )
37
39
 
38
40
  def on_progress(message: str) -> None:
41
+ """Handle progress updates during raw telegram sending.
42
+
43
+ Args:
44
+ message: Progress message string.
45
+ """
39
46
  click.echo(message)
40
- pass
41
47
 
42
48
  def on_finish(service_response: ConbusRawResponse) -> None:
49
+ """Handle successful completion of raw telegram sending.
50
+
51
+ Args:
52
+ service_response: Raw response object.
53
+ """
43
54
  click.echo(json.dumps(service_response.to_dict(), indent=2))
44
55
 
45
56
  with service:
@@ -20,29 +20,37 @@ from xp.services.conbus.conbus_receive_service import (
20
20
  @connection_command()
21
21
  @click.pass_context
22
22
  def receive_telegrams(ctx: Context, timeout: float) -> None:
23
- """
24
- Receive waiting event telegrams from Conbus server.
23
+ r"""Receive waiting event telegrams from Conbus server.
25
24
 
26
25
  Connects to the Conbus server and receives any waiting event telegrams
27
26
  without sending any data first. Useful for collecting pending notifications
28
27
  or events from the server.
29
28
 
30
- Arguments:
31
- :param timeout: Timeout in seconds for receiving telegrams (default: 2.0)
29
+ Args:
30
+ ctx: Click context object.
31
+ timeout: Timeout in seconds for receiving telegrams (default: 2.0).
32
32
 
33
33
  Examples:
34
-
35
- \b
34
+ \b
36
35
  xp conbus receive
37
36
  xp conbus receive 5.0
38
37
  """
39
38
 
40
39
  def finish(response_received: ConbusReceiveResponse) -> None:
40
+ """Handle successful completion of telegram receive operation.
41
+
42
+ Args:
43
+ response_received: Receive response object with telegrams.
44
+ """
41
45
  click.echo(json.dumps(response_received.to_dict(), indent=2))
42
46
 
43
47
  def progress(telegram_received: str) -> None:
48
+ """Handle progress updates during telegram receive operation.
49
+
50
+ Args:
51
+ telegram_received: Received telegram string.
52
+ """
44
53
  click.echo(telegram_received)
45
- pass
46
54
 
47
55
  service = ctx.obj.get("container").get_container().resolve(ConbusReceiveService)
48
56
  with service:
@@ -18,12 +18,15 @@ from xp.services.conbus.conbus_scan_service import ConbusScanService
18
18
  @click.pass_context
19
19
  @connection_command()
20
20
  def scan_module(ctx: Context, serial_number: str, function_code: str) -> None:
21
- """
22
- Scan all datapoints of a function_code for a module.
21
+ r"""Scan all datapoints of a function_code for a module.
23
22
 
24
- Examples:
23
+ Args:
24
+ ctx: Click context object.
25
+ serial_number: 10-digit module serial number.
26
+ function_code: Function code.
25
27
 
26
- \b
28
+ Examples:
29
+ \b
27
30
  xp conbus scan 0012345011 02 # Scan all datapoints of function Read data points (02)
28
31
  """
29
32
  service: ConbusScanService = (
@@ -31,9 +34,19 @@ def scan_module(ctx: Context, serial_number: str, function_code: str) -> None:
31
34
  )
32
35
 
33
36
  def on_progress(progress: str) -> None:
37
+ """Handle progress updates during module scan.
38
+
39
+ Args:
40
+ progress: Progress message string.
41
+ """
34
42
  click.echo(progress)
35
43
 
36
44
  def on_finish(service_response: ConbusResponse) -> None:
45
+ """Handle successful completion of module scan.
46
+
47
+ Args:
48
+ service_response: Scan response object.
49
+ """
37
50
  click.echo(json.dumps(service_response.to_dict(), indent=2))
38
51
 
39
52
  with service:
@@ -18,9 +18,7 @@ from xp.cli.utils.formatters import OutputFormatter, StatisticsFormatter
18
18
  cls=HelpColorsGroup, help_headers_color="yellow", help_options_color="green"
19
19
  )
20
20
  def file() -> None:
21
- """
22
- File operations for console bus logs
23
- """
21
+ """Perform file operations for console bus logs."""
24
22
  pass
25
23
 
26
24
 
@@ -38,13 +36,22 @@ def decode_log_file(
38
36
  time_range: str,
39
37
  summary: bool,
40
38
  ) -> None:
41
- """
42
- Decode and parse console bus log file.
39
+ r"""Decode and parse console bus log file.
43
40
 
44
- Examples:
41
+ Args:
42
+ ctx: Click context object.
43
+ log_file_path: Path to the log file to decode.
44
+ filter_type: Filter by telegram type.
45
+ filter_direction: Filter by telegram direction.
46
+ time_range: Filter by time range.
47
+ summary: Show summary statistics only.
45
48
 
46
- \b
49
+ Examples:
50
+ \b
47
51
  xp file decode conbus.log
52
+
53
+ Raises:
54
+ SystemExit: If time range is invalid or log file cannot be parsed.
48
55
  """
49
56
  from xp.services.log_file_service import LogFileService
50
57
  from xp.utils.time_utils import TimeParsingError, parse_time_range
@@ -105,12 +112,14 @@ def decode_log_file(
105
112
  @click.pass_context
106
113
  @handle_service_errors(Exception)
107
114
  def analyze_log_file(ctx: Context, log_file_path: str) -> None:
108
- """
109
- Analyze console bus log file for patterns and statistics.
115
+ r"""Analyze console bus log file for patterns and statistics.
110
116
 
111
- Examples:
117
+ Args:
118
+ ctx: Click context object.
119
+ log_file_path: Path to the log file to analyze.
112
120
 
113
- \b
121
+ Examples:
122
+ \b
114
123
  xp file analyze conbus.log
115
124
  """
116
125
  from xp.services.log_file_service import LogFileService
@@ -135,12 +144,14 @@ def analyze_log_file(ctx: Context, log_file_path: str) -> None:
135
144
  @click.pass_context
136
145
  @handle_service_errors(Exception)
137
146
  def validate_log_file(ctx: Context, log_file_path: str) -> None:
138
- """
139
- Validate console bus log file format and telegram checksums.
147
+ r"""Validate console bus log file format and telegram checksums.
140
148
 
141
- Examples:
149
+ Args:
150
+ ctx: Click context object.
151
+ log_file_path: Path to the log file to validate.
142
152
 
143
- \b
153
+ Examples:
154
+ \b
144
155
  xp file validate conbus.log
145
156
  """
146
157
  from xp.services.log_file_service import LogFileService
@@ -10,11 +10,7 @@ from xp.cli.utils.decorators import service_command
10
10
  cls=HelpColorsGroup, help_headers_color="yellow", help_options_color="green"
11
11
  )
12
12
  def homekit() -> None:
13
- """
14
- HomeKit management commands.
15
-
16
- Manage the HomeKit server for XP Protocol operations.
17
- """
13
+ """Manage the HomeKit server for XP Protocol operations."""
18
14
  pass
19
15
 
20
16
 
@@ -22,7 +18,7 @@ def homekit() -> None:
22
18
  cls=HelpColorsGroup, help_headers_color="yellow", help_options_color="green"
23
19
  )
24
20
  def config() -> None:
25
- """HomeKit configuration management"""
21
+ """Manage HomeKit configuration."""
26
22
  pass
27
23
 
28
24
 
@@ -39,7 +35,12 @@ def config() -> None:
39
35
  )
40
36
  @service_command()
41
37
  def validate(conson_config: str, homekit_config: str) -> None:
42
- """Validate homekit.yml and conson.yml coherence"""
38
+ """Validate homekit.yml and conson.yml coherence.
39
+
40
+ Args:
41
+ conson_config: Path to conson.yml configuration file.
42
+ homekit_config: Path to homekit.yml configuration file.
43
+ """
43
44
  from xp.services.homekit.homekit_config_validator import ConfigValidationService
44
45
 
45
46
  try:
@@ -97,7 +98,12 @@ def validate(conson_config: str, homekit_config: str) -> None:
97
98
  )
98
99
  @service_command()
99
100
  def show_config(conson_config: str, homekit_config: str) -> None:
100
- """Display parsed configuration summary"""
101
+ """Display parsed configuration summary.
102
+
103
+ Args:
104
+ conson_config: Path to conson.yml configuration file.
105
+ homekit_config: Path to homekit.yml configuration file.
106
+ """
101
107
  from xp.services.homekit.homekit_config_validator import ConfigValidationService
102
108
 
103
109
  try:
@@ -12,18 +12,18 @@ from xp.services.homekit.homekit_service import HomeKitService
12
12
  @homekit.command("start")
13
13
  @click.pass_context
14
14
  def homekit_start(ctx: Context) -> None:
15
- """
16
- Start the HomeKit server.
15
+ r"""Start the HomeKit server.
17
16
 
18
17
  This command starts the XP Protocol HomeKit server using HAP-python.
19
18
  The server provides HomeKit endpoints for Conbus operations.
20
19
 
21
- Examples:
20
+ Args:
21
+ ctx: Click context object.
22
22
 
23
- \b
23
+ Examples:
24
+ \b
24
25
  # Start server on default host and port
25
26
  xp homekit start
26
-
27
27
  """
28
28
  click.echo("Starting XP Protocol HomeKit server...")
29
29
 
@@ -17,9 +17,7 @@ from xp.services.module_type_service import ModuleTypeNotFoundError, ModuleTypeS
17
17
  cls=HelpColorsGroup, help_headers_color="yellow", help_options_color="green"
18
18
  )
19
19
  def module() -> None:
20
- """
21
- Module type operations
22
- """
20
+ """Perform module type operations."""
23
21
  pass
24
22
 
25
23
 
@@ -28,12 +26,14 @@ def module() -> None:
28
26
  @click.pass_context
29
27
  @list_command(ModuleTypeNotFoundError)
30
28
  def module_info(ctx: Context, identifier: str) -> None:
31
- """
32
- Get information about a module type by code or name.
29
+ r"""Get information about a module type by code or name.
33
30
 
34
- Examples:
31
+ Args:
32
+ ctx: Click context object.
33
+ identifier: Module code or name.
35
34
 
36
- \b
35
+ Examples:
36
+ \b
37
37
  xp module info 14
38
38
  xp module info XP2606
39
39
  """
@@ -63,12 +63,15 @@ def module_info(ctx: Context, identifier: str) -> None:
63
63
  @click.pass_context
64
64
  @list_command(Exception)
65
65
  def module_list(ctx: Context, category: str, group_by_category: bool) -> None:
66
- """
67
- List module types, optionally filtered by category.
66
+ r"""List module types, optionally filtered by category.
68
67
 
69
- Examples:
68
+ Args:
69
+ ctx: Click context object.
70
+ category: Filter by category.
71
+ group_by_category: Group modules by category.
70
72
 
71
- \b
73
+ Examples:
74
+ \b
72
75
  xp module list
73
76
  xp module list --category "Interface Panels"
74
77
  xp module list --group-by-category
@@ -115,12 +118,15 @@ def module_list(ctx: Context, category: str, group_by_category: bool) -> None:
115
118
  @click.pass_context
116
119
  @list_command(Exception)
117
120
  def module_search(ctx: Context, query: str, field: tuple) -> None:
118
- """
119
- Search for module types by name or description.
121
+ r"""Search for module types by name or description.
120
122
 
121
- Examples:
123
+ Args:
124
+ ctx: Click context object.
125
+ query: Search query.
126
+ field: Fields to search in.
122
127
 
123
- \b
128
+ Examples:
129
+ \b
124
130
  xp module search "push button"
125
131
  xp module search --field name "XP"
126
132
  """
@@ -147,12 +153,13 @@ def module_search(ctx: Context, query: str, field: tuple) -> None:
147
153
  @click.pass_context
148
154
  @list_command(Exception)
149
155
  def module_categories(ctx: Context) -> None:
150
- """
151
- List all available module categories.
156
+ r"""List all available module categories.
152
157
 
153
- Examples:
158
+ Args:
159
+ ctx: Click context object.
154
160
 
155
- \b
161
+ Examples:
162
+ \b
156
163
  xp module categories
157
164
  """
158
165
  service = ctx.obj.get("container").get_container().resolve(ModuleTypeService)