conson-xp 1.1.0__tar.gz → 1.3.0__tar.gz

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 (313) hide show
  1. {conson_xp-1.1.0 → conson_xp-1.3.0}/PKG-INFO +1 -5
  2. {conson_xp-1.1.0 → conson_xp-1.3.0}/README.md +0 -4
  3. {conson_xp-1.1.0 → conson_xp-1.3.0}/pyproject.toml +25 -1
  4. conson_xp-1.3.0/src/xp/__init__.py +9 -0
  5. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/__init__.py +1 -1
  6. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/__init__.py +1 -2
  7. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus.py +9 -37
  8. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus_actiontable_commands.py +26 -4
  9. conson_xp-1.3.0/src/xp/cli/commands/conbus/conbus_autoreport_commands.py +108 -0
  10. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus_blink_commands.py +61 -29
  11. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus_config_commands.py +10 -5
  12. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus_custom_commands.py +16 -5
  13. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus_datapoint_commands.py +32 -10
  14. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus_discover_commands.py +20 -7
  15. conson_xp-1.3.0/src/xp/cli/commands/conbus/conbus_lightlevel_commands.py +207 -0
  16. conson_xp-1.3.0/src/xp/cli/commands/conbus/conbus_linknumber_commands.py +102 -0
  17. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus_msactiontable_commands.py +36 -5
  18. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus_output_commands.py +52 -14
  19. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus_raw_commands.py +17 -6
  20. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus_receive_commands.py +20 -10
  21. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus_scan_commands.py +17 -4
  22. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/file_commands.py +35 -18
  23. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/homekit/homekit.py +14 -8
  24. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/homekit/homekit_start_commands.py +8 -6
  25. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/module_commands.py +38 -23
  26. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/reverse_proxy_commands.py +27 -19
  27. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/server/server_commands.py +18 -18
  28. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/telegram/telegram.py +4 -12
  29. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/telegram/telegram_blink_commands.py +10 -8
  30. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/telegram/telegram_checksum_commands.py +19 -8
  31. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/telegram/telegram_discover_commands.py +2 -4
  32. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/telegram/telegram_linknumber_commands.py +11 -8
  33. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/telegram/telegram_parse_commands.py +10 -9
  34. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/telegram/telegram_version_commands.py +8 -4
  35. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/main.py +5 -3
  36. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/utils/click_tree.py +23 -3
  37. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/utils/datapoint_type_choice.py +20 -0
  38. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/utils/decorators.py +165 -14
  39. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/utils/error_handlers.py +49 -18
  40. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/utils/formatters.py +95 -10
  41. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/utils/serial_number_type.py +18 -0
  42. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/utils/system_function_choice.py +20 -0
  43. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/utils/xp_module_type.py +20 -0
  44. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/connection/__init__.py +1 -1
  45. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/connection/exceptions.py +5 -5
  46. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/__init__.py +1 -1
  47. conson_xp-1.3.0/src/xp/models/actiontable/__init__.py +1 -0
  48. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/actiontable/actiontable.py +17 -1
  49. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/actiontable/msactiontable_xp20.py +10 -0
  50. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/actiontable/msactiontable_xp24.py +20 -3
  51. conson_xp-1.3.0/src/xp/models/actiontable/msactiontable_xp33.py +65 -0
  52. conson_xp-1.3.0/src/xp/models/conbus/__init__.py +1 -0
  53. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus.py +34 -4
  54. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_autoreport.py +20 -2
  55. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_blink.py +22 -2
  56. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_client_config.py +22 -1
  57. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_connection_status.py +16 -2
  58. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_custom.py +21 -2
  59. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_datapoint.py +25 -2
  60. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_discover.py +18 -2
  61. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_lightlevel.py +20 -2
  62. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_linknumber.py +20 -2
  63. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_output.py +22 -2
  64. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_raw.py +17 -2
  65. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_receive.py +16 -2
  66. conson_xp-1.3.0/src/xp/models/conbus/conbus_writeconfig.py +60 -0
  67. conson_xp-1.3.0/src/xp/models/homekit/__init__.py +1 -0
  68. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/homekit/homekit_accessory.py +15 -1
  69. conson_xp-1.3.0/src/xp/models/homekit/homekit_config.py +102 -0
  70. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/homekit/homekit_conson_config.py +32 -0
  71. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/log_entry.py +49 -9
  72. conson_xp-1.3.0/src/xp/models/protocol/__init__.py +1 -0
  73. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/protocol/conbus_protocol.py +130 -21
  74. conson_xp-1.3.0/src/xp/models/telegram/__init__.py +1 -0
  75. conson_xp-1.3.0/src/xp/models/telegram/action_type.py +31 -0
  76. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/telegram/datapoint_type.py +36 -2
  77. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/telegram/event_telegram.py +46 -10
  78. conson_xp-1.3.0/src/xp/models/telegram/event_type.py +15 -0
  79. conson_xp-1.3.0/src/xp/models/telegram/input_action_type.py +69 -0
  80. conson_xp-1.3.0/src/xp/models/telegram/input_type.py +17 -0
  81. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/telegram/module_type.py +69 -19
  82. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/telegram/module_type_code.py +43 -1
  83. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/telegram/output_telegram.py +30 -6
  84. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/telegram/reply_telegram.py +56 -11
  85. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/telegram/system_function.py +35 -3
  86. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/telegram/system_telegram.py +18 -4
  87. conson_xp-1.3.0/src/xp/models/telegram/telegram.py +28 -0
  88. conson_xp-1.3.0/src/xp/models/telegram/telegram_type.py +19 -0
  89. conson_xp-1.3.0/src/xp/models/telegram/timeparam_type.py +51 -0
  90. conson_xp-1.3.0/src/xp/models/write_config_type.py +33 -0
  91. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/__init__.py +1 -1
  92. conson_xp-1.3.0/src/xp/services/conbus/__init__.py +1 -0
  93. conson_xp-1.3.0/src/xp/services/conbus/actiontable/__init__.py +1 -0
  94. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/actiontable/actiontable_service.py +33 -2
  95. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/actiontable/msactiontable_service.py +40 -3
  96. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/actiontable/msactiontable_xp24_serializer.py +36 -4
  97. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/actiontable/msactiontable_xp33_serializer.py +45 -5
  98. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/conbus_blink_all_service.py +40 -21
  99. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/conbus_blink_service.py +37 -13
  100. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/conbus_custom_service.py +29 -13
  101. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/conbus_datapoint_queryall_service.py +40 -16
  102. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/conbus_datapoint_service.py +42 -18
  103. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/conbus_discover_service.py +43 -7
  104. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/conbus_output_service.py +33 -13
  105. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/conbus_raw_service.py +36 -16
  106. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/conbus_receive_service.py +38 -6
  107. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/conbus_scan_service.py +44 -18
  108. conson_xp-1.3.0/src/xp/services/conbus/write_config_service.py +193 -0
  109. conson_xp-1.3.0/src/xp/services/homekit/__init__.py +1 -0
  110. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_cache_service.py +31 -6
  111. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_conbus_service.py +33 -2
  112. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_config_validator.py +97 -15
  113. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_conson_validator.py +51 -7
  114. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_dimminglight.py +47 -1
  115. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_dimminglight_service.py +35 -1
  116. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_hap_service.py +71 -18
  117. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_lightbulb.py +35 -1
  118. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_lightbulb_service.py +30 -2
  119. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_module_service.py +23 -1
  120. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_outlet.py +47 -1
  121. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_outlet_service.py +44 -2
  122. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_service.py +113 -19
  123. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/log_file_service.py +37 -41
  124. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/module_type_service.py +26 -5
  125. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/protocol/__init__.py +1 -1
  126. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/protocol/conbus_protocol.py +110 -16
  127. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/protocol/protocol_factory.py +40 -0
  128. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/protocol/telegram_protocol.py +38 -7
  129. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/reverse_proxy_service.py +79 -14
  130. conson_xp-1.3.0/src/xp/services/server/__init__.py +1 -0
  131. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/server/base_server_service.py +102 -14
  132. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/server/cp20_server_service.py +12 -4
  133. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/server/server_service.py +26 -11
  134. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/server/xp130_server_service.py +11 -3
  135. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/server/xp20_server_service.py +11 -3
  136. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/server/xp230_server_service.py +11 -3
  137. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/server/xp24_server_service.py +33 -6
  138. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/server/xp33_server_service.py +41 -8
  139. conson_xp-1.3.0/src/xp/services/telegram/__init__.py +1 -0
  140. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/telegram/telegram_blink_service.py +19 -31
  141. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/telegram/telegram_checksum_service.py +10 -10
  142. conson_xp-1.3.0/src/xp/services/telegram/telegram_datapoint_service.py +70 -0
  143. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/telegram/telegram_discover_service.py +58 -29
  144. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/telegram/telegram_link_number_service.py +27 -40
  145. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/telegram/telegram_output_service.py +46 -49
  146. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/telegram/telegram_service.py +41 -41
  147. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/telegram/telegram_version_service.py +4 -2
  148. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/utils/__init__.py +1 -1
  149. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/utils/dependencies.py +4 -47
  150. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/utils/serialization.py +6 -0
  151. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/utils/time_utils.py +6 -11
  152. conson_xp-1.3.0/tests/__init__.py +1 -0
  153. conson_xp-1.3.0/tests/integration/__init__.py +1 -0
  154. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/telegram_test_data.py +13 -2
  155. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_actiontable_integration.py +18 -10
  156. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_blink_integration.py +11 -11
  157. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_checksum_integration.py +1 -1
  158. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_conbus_blink_integration.py +24 -0
  159. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_conbus_datapoint_integration.py +33 -16
  160. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_conbus_raw_integration.py +32 -0
  161. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_discovery_integration.py +7 -7
  162. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_event_telegram_integration.py +18 -16
  163. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_homekit_config_integration.py +23 -3
  164. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_link_number_integration.py +10 -10
  165. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_module_integration.py +27 -25
  166. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_reverse_proxy_integration.py +24 -15
  167. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_xp20_action_table_integration.py +9 -9
  168. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_xp24_action_table_integration.py +31 -7
  169. conson_xp-1.3.0/tests/unit/__init__.py +1 -0
  170. conson_xp-1.3.0/tests/unit/test_cli/__init__.py +1 -0
  171. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_cli/test_click_tree.py +22 -22
  172. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_cli/test_conbus_actiontable_commands.py +27 -11
  173. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_cli/test_conbus_blink_commands.py +6 -6
  174. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_cli/test_formatters.py +8 -0
  175. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_cli/test_serial_number_type.py +19 -0
  176. conson_xp-1.3.0/tests/unit/test_connection/__init__.py +1 -0
  177. conson_xp-1.3.0/tests/unit/test_encoding/__init__.py +1 -0
  178. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_encoding/test_latin1_edge_cases.py +14 -9
  179. conson_xp-1.3.0/tests/unit/test_models/__init__.py +1 -0
  180. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_conbus_client_send.py +17 -15
  181. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_conbus_linknumber.py +12 -10
  182. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_event_telegram.py +11 -9
  183. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_log_entry.py +15 -15
  184. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_module_type.py +20 -18
  185. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_system_telegram_enhancements.py +13 -13
  186. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_version_telegram.py +0 -2
  187. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_xp20_action_table.py +14 -14
  188. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_xp24_action_table.py +11 -11
  189. conson_xp-1.3.0/tests/unit/test_services/__init__.py +1 -0
  190. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_actiontable_service.py +16 -16
  191. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_base_server_service.py +5 -0
  192. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_blink_service.py +13 -13
  193. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_conbus_blink_service.py +14 -14
  194. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_conbus_raw_service.py +11 -11
  195. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_conbus_reverse_proxy_service.py +20 -20
  196. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_discovery_service.py +20 -20
  197. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_homekit_cache_service.py +19 -19
  198. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_homekit_config_validator.py +18 -2
  199. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_homekit_conson_service.py +3 -0
  200. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_homekit_services.py +49 -45
  201. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_log_file_service.py +34 -22
  202. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_module_type_service.py +29 -27
  203. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_protocol.py +29 -27
  204. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_telegram_input_service.py +18 -16
  205. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_telegram_protocol.py +21 -21
  206. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_telegram_service.py +51 -49
  207. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_xp20_action_table_serializer.py +14 -14
  208. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_xp24_action_table_serializer.py +10 -11
  209. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_xp24_action_table_service.py +23 -23
  210. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_xp33_action_table_serializer.py +17 -17
  211. conson_xp-1.3.0/tests/unit/test_utils/__init__.py +1 -0
  212. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_utils/test_checksum.py +1 -1
  213. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_utils/test_event_helper.py +17 -0
  214. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_utils/test_time_utils.py +16 -16
  215. conson_xp-1.1.0/src/xp/__init__.py +0 -8
  216. conson_xp-1.1.0/src/xp/api/__init__.py +0 -1
  217. conson_xp-1.1.0/src/xp/api/main.py +0 -110
  218. conson_xp-1.1.0/src/xp/api/models/__init__.py +0 -1
  219. conson_xp-1.1.0/src/xp/api/models/api.py +0 -20
  220. conson_xp-1.1.0/src/xp/api/models/discover.py +0 -21
  221. conson_xp-1.1.0/src/xp/api/routers/__init__.py +0 -17
  222. conson_xp-1.1.0/src/xp/api/routers/conbus.py +0 -5
  223. conson_xp-1.1.0/src/xp/api/routers/conbus_blink.py +0 -105
  224. conson_xp-1.1.0/src/xp/api/routers/conbus_custom.py +0 -63
  225. conson_xp-1.1.0/src/xp/api/routers/conbus_datapoint.py +0 -67
  226. conson_xp-1.1.0/src/xp/api/routers/conbus_output.py +0 -147
  227. conson_xp-1.1.0/src/xp/api/routers/errors.py +0 -37
  228. conson_xp-1.1.0/src/xp/cli/commands/api.py +0 -16
  229. conson_xp-1.1.0/src/xp/cli/commands/api_start_commands.py +0 -126
  230. conson_xp-1.1.0/src/xp/cli/commands/conbus/conbus_autoreport_commands.py +0 -80
  231. conson_xp-1.1.0/src/xp/cli/commands/conbus/conbus_lightlevel_commands.py +0 -132
  232. conson_xp-1.1.0/src/xp/cli/commands/conbus/conbus_linknumber_commands.py +0 -77
  233. conson_xp-1.1.0/src/xp/models/actiontable/__init__.py +0 -0
  234. conson_xp-1.1.0/src/xp/models/actiontable/msactiontable_xp33.py +0 -42
  235. conson_xp-1.1.0/src/xp/models/conbus/__init__.py +0 -0
  236. conson_xp-1.1.0/src/xp/models/homekit/__init__.py +0 -0
  237. conson_xp-1.1.0/src/xp/models/homekit/homekit_config.py +0 -50
  238. conson_xp-1.1.0/src/xp/models/protocol/__init__.py +0 -0
  239. conson_xp-1.1.0/src/xp/models/telegram/__init__.py +0 -0
  240. conson_xp-1.1.0/src/xp/models/telegram/action_type.py +0 -17
  241. conson_xp-1.1.0/src/xp/models/telegram/event_type.py +0 -8
  242. conson_xp-1.1.0/src/xp/models/telegram/input_action_type.py +0 -37
  243. conson_xp-1.1.0/src/xp/models/telegram/input_type.py +0 -9
  244. conson_xp-1.1.0/src/xp/models/telegram/telegram.py +0 -19
  245. conson_xp-1.1.0/src/xp/models/telegram/telegram_type.py +0 -12
  246. conson_xp-1.1.0/src/xp/models/telegram/timeparam_type.py +0 -24
  247. conson_xp-1.1.0/src/xp/models/write_config_type.py +0 -18
  248. conson_xp-1.1.0/src/xp/services/conbus/__init__.py +0 -0
  249. conson_xp-1.1.0/src/xp/services/conbus/actiontable/__init__.py +0 -0
  250. conson_xp-1.1.0/src/xp/services/conbus/conbus_autoreport_get_service.py +0 -85
  251. conson_xp-1.1.0/src/xp/services/conbus/conbus_autoreport_set_service.py +0 -128
  252. conson_xp-1.1.0/src/xp/services/conbus/conbus_lightlevel_get_service.py +0 -101
  253. conson_xp-1.1.0/src/xp/services/conbus/conbus_lightlevel_set_service.py +0 -205
  254. conson_xp-1.1.0/src/xp/services/conbus/conbus_linknumber_get_service.py +0 -86
  255. conson_xp-1.1.0/src/xp/services/conbus/conbus_linknumber_set_service.py +0 -155
  256. conson_xp-1.1.0/src/xp/services/homekit/__init__.py +0 -0
  257. conson_xp-1.1.0/src/xp/services/server/__init__.py +0 -0
  258. conson_xp-1.1.0/src/xp/services/telegram/__init__.py +0 -0
  259. conson_xp-1.1.0/tests/__init__.py +0 -0
  260. conson_xp-1.1.0/tests/integration/__init__.py +0 -0
  261. conson_xp-1.1.0/tests/integration/test_conbus_autoreport_integration.py +0 -309
  262. conson_xp-1.1.0/tests/integration/test_conbus_lightlevel_integration.py +0 -224
  263. conson_xp-1.1.0/tests/integration/test_conbus_linknumber_integration.py +0 -469
  264. conson_xp-1.1.0/tests/unit/__init__.py +0 -0
  265. conson_xp-1.1.0/tests/unit/test_cli/__init__.py +0 -0
  266. conson_xp-1.1.0/tests/unit/test_connection/__init__.py +0 -0
  267. conson_xp-1.1.0/tests/unit/test_encoding/__init__.py +0 -1
  268. conson_xp-1.1.0/tests/unit/test_models/__init__.py +0 -0
  269. conson_xp-1.1.0/tests/unit/test_services/__init__.py +0 -0
  270. conson_xp-1.1.0/tests/unit/test_services/test_conbus_lightlevel_service.py +0 -187
  271. conson_xp-1.1.0/tests/unit/test_services/test_conbus_linknumber_service.py +0 -427
  272. conson_xp-1.1.0/tests/unit/test_services/test_link_number_service.py +0 -229
  273. conson_xp-1.1.0/tests/unit/test_utils/__init__.py +0 -0
  274. {conson_xp-1.1.0 → conson_xp-1.3.0}/LICENSE +0 -0
  275. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/__main__.py +0 -0
  276. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/__init__.py +0 -0
  277. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/homekit/__init__.py +0 -0
  278. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/server/__init__.py +0 -0
  279. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/telegram/__init__.py +0 -0
  280. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/utils/__init__.py +0 -0
  281. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/response.py +0 -0
  282. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/actiontable/actiontable_serializer.py +0 -0
  283. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/actiontable/msactiontable_xp20_serializer.py +0 -0
  284. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/utils/checksum.py +0 -0
  285. {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/utils/event_helper.py +0 -0
  286. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/.coverage +0 -0
  287. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/conftest.py +0 -0
  288. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/.coverage +0 -0
  289. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_api/.coverage +0 -0
  290. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_api/__init__.py +0 -0
  291. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_conbus_receive_integration.py +0 -0
  292. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_output_integration.py +0 -0
  293. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_system_reply_telegram_integration.py +0 -0
  294. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_version_integration.py +0 -0
  295. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_api/__init__.py +0 -0
  296. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_cli/test_datapoint_type_choice.py +0 -0
  297. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_cli/test_decorators.py +0 -0
  298. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_cli/test_error_handlers.py +0 -0
  299. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_cli/test_system_function_choice.py +0 -0
  300. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_connection/test_connection_init.py +0 -0
  301. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_connection/test_exceptions.py +0 -0
  302. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_conbus.py +0 -0
  303. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_conbus_discover.py +0 -0
  304. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_reply_telegram.py +0 -0
  305. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_system_telegram.py +0 -0
  306. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_write_config_type.py +0 -0
  307. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_xp24_action_telegram.py +0 -0
  308. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_checksum_service.py +0 -0
  309. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_server_service.py +0 -0
  310. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_version_service.py +0 -0
  311. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_xp24_action_service.py +0 -0
  312. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_xp_server_services.py +0 -0
  313. {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_utils/test_serialization.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: conson-xp
3
- Version: 1.1.0
3
+ Version: 1.3.0
4
4
  Summary: XP Protocol Communication Tools
5
5
  Author-Email: ldvchosal <ldvchosal@github.com>
6
6
  License: MIT License
@@ -272,10 +272,6 @@ src/xp/
272
272
 
273
273
  xp
274
274
 
275
- xp api
276
- xp api start
277
-
278
-
279
275
  xp conbus
280
276
 
281
277
  xp conbus actiontable
@@ -221,10 +221,6 @@ src/xp/
221
221
 
222
222
  xp
223
223
 
224
- xp api
225
- xp api start
226
-
227
-
228
224
  xp conbus
229
225
 
230
226
  xp conbus actiontable
@@ -20,7 +20,7 @@ dependencies = [
20
20
  ]
21
21
  requires-python = ">=3.11"
22
22
  readme = "README.md"
23
- version = "1.1.0"
23
+ version = "1.3.0"
24
24
 
25
25
  [project.license]
26
26
  file = "LICENSE"
@@ -41,6 +41,9 @@ dev = [
41
41
  "pytest-cov>=7.0",
42
42
  "black>=25.9",
43
43
  "flake8>=7.3",
44
+ "flake8-docstrings>=1.7.0",
45
+ "flake8-docstrings-complete>=1.3.0",
46
+ "interrogate>=1.7.0",
44
47
  "mypy>=1.18",
45
48
  "ruff>=0.13.0",
46
49
  "vulture>=2.14",
@@ -165,6 +168,8 @@ test-cov = "env PYTHONPATH=src python -m pytest tests/ --quiet --cov=src/xp --co
165
168
  lint = "ruff check --fix src/ tests/"
166
169
  format = "black src/ tests/"
167
170
  typecheck = "mypy src/ tests/"
171
+ flake8 = "flake8 src/ tests/"
172
+ interrogate = "interrogate -vv src/"
168
173
  vulture = "vulture src/ tests/"
169
174
  refurb = "refurb src/ tests/"
170
175
  isort = "isort src/ tests/"
@@ -189,6 +194,8 @@ composite = [
189
194
  "lint",
190
195
  "format",
191
196
  "typecheck",
197
+ "flake8",
198
+ "interrogate",
192
199
  "vulture",
193
200
  "refurb",
194
201
  "isort",
@@ -222,6 +229,23 @@ version-files = [
222
229
  "src/xp/__init__.py:__version__",
223
230
  ]
224
231
 
232
+ [tool.interrogate]
233
+ ignore-init-method = true
234
+ ignore-init-module = false
235
+ fail-under = 95
236
+ exclude = [
237
+ "tests",
238
+ "docs",
239
+ "build",
240
+ "dist",
241
+ ]
242
+ verbose = 1
243
+ quiet = false
244
+ whitelist-regex = []
245
+ color = true
246
+ generate-badge = "."
247
+ badge-format = "svg"
248
+
225
249
  [build-system]
226
250
  requires = [
227
251
  "pdm-backend",
@@ -0,0 +1,9 @@
1
+ """XP CLI tool for remote console bus operations.
2
+
3
+ conson-xp package.
4
+ """
5
+
6
+ __version__ = "1.3.0"
7
+ __manufacturer__ = "salchichon"
8
+ __model__ = "xp.cli"
9
+ __serial__ = "2025.09.23.000"
@@ -1,4 +1,4 @@
1
- """CLI interface for XP tool"""
1
+ """CLI interface for XP tool."""
2
2
 
3
3
  from xp.cli.main import cli
4
4
 
@@ -1,7 +1,6 @@
1
1
  """Command modules for XP CLI."""
2
2
 
3
3
  # Main command groups
4
- from xp.cli.commands.api_start_commands import start_api_server
5
4
 
6
5
  # Import conbus command groups (but not 'conbus' itself to avoid module shadowing in Python 3.10)
7
6
  from xp.cli.commands.conbus.conbus import (
@@ -38,6 +37,7 @@ from xp.cli.commands.conbus.conbus_datapoint_commands import (
38
37
  )
39
38
  from xp.cli.commands.conbus.conbus_discover_commands import send_discover_telegram
40
39
  from xp.cli.commands.conbus.conbus_lightlevel_commands import (
40
+ xp_lightlevel_get,
41
41
  xp_lightlevel_off,
42
42
  xp_lightlevel_on,
43
43
  xp_lightlevel_set,
@@ -99,7 +99,6 @@ __all__ = [
99
99
  "linknumber",
100
100
  "blink",
101
101
  "checksum",
102
- "start_api_server",
103
102
  "homekit",
104
103
  "homekit_start",
105
104
  # Individual command functions
@@ -8,9 +8,7 @@ from click_help_colors import HelpColorsGroup
8
8
  cls=HelpColorsGroup, help_headers_color="yellow", help_options_color="green"
9
9
  )
10
10
  def conbus() -> None:
11
- """
12
- Conbus client operations for sending telegrams to remote servers
13
- """
11
+ """Perform Conbus client operations for sending telegrams to remote servers."""
14
12
  pass
15
13
 
16
14
 
@@ -21,9 +19,7 @@ def conbus() -> None:
21
19
  help_options_color="green",
22
20
  )
23
21
  def conbus_blink() -> None:
24
- """
25
- Conbus client operations for sending blink telegrams to remote servers
26
- """
22
+ """Perform Conbus client operations for sending blink telegrams to remote servers."""
27
23
  pass
28
24
 
29
25
 
@@ -34,9 +30,7 @@ def conbus_blink() -> None:
34
30
  help_options_color="green",
35
31
  )
36
32
  def conbus_output() -> None:
37
- """
38
- Conbus input operations to remote servers
39
- """
33
+ """Perform Conbus input operations to remote servers."""
40
34
  pass
41
35
 
42
36
 
@@ -47,9 +41,7 @@ def conbus_output() -> None:
47
41
  help_options_color="green",
48
42
  )
49
43
  def conbus_datapoint() -> None:
50
- """
51
- Conbus datapoint operations for querying module datapoints
52
- """
44
+ """Perform Conbus datapoint operations for querying module datapoints."""
53
45
  pass
54
46
 
55
47
 
@@ -61,11 +53,7 @@ def conbus_datapoint() -> None:
61
53
  short_help="Link number operations",
62
54
  )
63
55
  def conbus_linknumber() -> None:
64
- """
65
- Link number operations for modules.
66
-
67
- Set or get the link number for specific modules.
68
- """
56
+ """Set or get the link number for specific modules."""
69
57
  pass
70
58
 
71
59
 
@@ -77,11 +65,7 @@ def conbus_linknumber() -> None:
77
65
  short_help="Auto report status operations",
78
66
  )
79
67
  def conbus_autoreport() -> None:
80
- """
81
- Auto report status operations for modules.
82
-
83
- Get or set the auto report status for specific modules.
84
- """
68
+ """Get or set the auto report status for specific modules."""
85
69
  pass
86
70
 
87
71
 
@@ -93,11 +77,7 @@ def conbus_autoreport() -> None:
93
77
  short_help="Light level operations",
94
78
  )
95
79
  def conbus_lightlevel() -> None:
96
- """
97
- Light level operations for modules.
98
-
99
- Control light level (dimming) of outputs on Conbus modules.
100
- """
80
+ """Control light level (dimming) of outputs on Conbus modules."""
101
81
  pass
102
82
 
103
83
 
@@ -109,11 +89,7 @@ def conbus_lightlevel() -> None:
109
89
  short_help="MSActionTable operations",
110
90
  )
111
91
  def conbus_msactiontable() -> None:
112
- """
113
- msactiontable operations for modules.
114
-
115
- Download msactiontable on Conbus modules.
116
- """
92
+ """Download msactiontable on Conbus modules."""
117
93
  pass
118
94
 
119
95
 
@@ -125,11 +101,7 @@ def conbus_msactiontable() -> None:
125
101
  short_help="ActionTable operations",
126
102
  )
127
103
  def conbus_actiontable() -> None:
128
- """
129
- ActionTable operations for modules.
130
-
131
- Download ActionTable from Conbus modules.
132
- """
104
+ """Download ActionTable from Conbus modules."""
133
105
  pass
134
106
 
135
107
 
@@ -22,13 +22,30 @@ from xp.services.conbus.actiontable.actiontable_service import (
22
22
  @click.pass_context
23
23
  @connection_command()
24
24
  def conbus_download_actiontable(ctx: Context, serial_number: str) -> None:
25
- """Download action table from XP module"""
26
- service = ctx.obj.get("container").get_container().resolve(ActionTableService)
25
+ """Download action table from XP module.
26
+
27
+ Args:
28
+ ctx: Click context object.
29
+ serial_number: 10-digit module serial number.
30
+ """
31
+ service: ActionTableService = (
32
+ ctx.obj.get("container").get_container().resolve(ActionTableService)
33
+ )
27
34
 
28
35
  def progress_callback(progress: str) -> None:
36
+ """Handle progress updates during action table download.
37
+
38
+ Args:
39
+ progress: Progress message string.
40
+ """
29
41
  click.echo(progress)
30
42
 
31
- def finish_callback(actiontable: ActionTable) -> None:
43
+ def on_finish(actiontable: ActionTable) -> None:
44
+ """Handle successful completion of action table download.
45
+
46
+ Args:
47
+ actiontable: Downloaded action table object.
48
+ """
32
49
  output = {
33
50
  "serial_number": serial_number,
34
51
  "actiontable": asdict(actiontable),
@@ -36,12 +53,17 @@ def conbus_download_actiontable(ctx: Context, serial_number: str) -> None:
36
53
  click.echo(json.dumps(output, indent=2, default=str))
37
54
 
38
55
  def error_callback(error: str) -> None:
56
+ """Handle errors during action table download.
57
+
58
+ Args:
59
+ error: Error message string.
60
+ """
39
61
  click.echo(error)
40
62
 
41
63
  with service:
42
64
  service.start(
43
65
  serial_number=serial_number,
44
66
  progress_callback=progress_callback,
45
- finish_callback=finish_callback,
67
+ finish_callback=on_finish,
46
68
  error_callback=error_callback,
47
69
  )
@@ -0,0 +1,108 @@
1
+ """Conbus auto report CLI commands."""
2
+
3
+ import json
4
+
5
+ import click
6
+ from click import Context
7
+
8
+ from xp.cli.commands.conbus.conbus import conbus_autoreport
9
+ from xp.cli.utils.decorators import (
10
+ connection_command,
11
+ )
12
+ from xp.cli.utils.serial_number_type import SERIAL
13
+ from xp.models import ConbusDatapointResponse
14
+ from xp.models.conbus.conbus_writeconfig import ConbusWriteConfigResponse
15
+ from xp.models.telegram.datapoint_type import DataPointType
16
+ from xp.services.conbus.conbus_datapoint_service import ConbusDatapointService
17
+ from xp.services.conbus.write_config_service import WriteConfigService
18
+ from xp.services.telegram.telegram_datapoint_service import TelegramDatapointService
19
+
20
+
21
+ @conbus_autoreport.command("get", short_help="Get auto report status for a module")
22
+ @click.argument("serial_number", type=SERIAL)
23
+ @connection_command()
24
+ @click.pass_context
25
+ def get_autoreport_command(ctx: Context, serial_number: str) -> None:
26
+ r"""Get the current auto report status for a specific module.
27
+
28
+ Args:
29
+ ctx: Click context object.
30
+ serial_number: 10-digit module serial number.
31
+
32
+ Examples:
33
+ \b
34
+ xp conbus autoreport get 0123450001
35
+ """
36
+ # Get service from container
37
+ service: ConbusDatapointService = (
38
+ ctx.obj.get("container").get_container().resolve(ConbusDatapointService)
39
+ )
40
+ telegram_service: TelegramDatapointService = (
41
+ ctx.obj.get("container").get_container().resolve(TelegramDatapointService)
42
+ )
43
+
44
+ def on_finish(service_response: ConbusDatapointResponse) -> None:
45
+ """Handle successful completion of auto report status retrieval.
46
+
47
+ Args:
48
+ service_response: Auto report response object.
49
+ """
50
+ auto_report_status = telegram_service.get_autoreport_status(
51
+ service_response.data_value
52
+ )
53
+ result = service_response.to_dict()
54
+ result["auto_report_status"] = auto_report_status
55
+ click.echo(json.dumps(result, indent=2))
56
+
57
+ with service:
58
+ service.query_datapoint(
59
+ serial_number=serial_number,
60
+ datapoint_type=DataPointType.AUTO_REPORT_STATUS,
61
+ finish_callback=on_finish,
62
+ )
63
+
64
+
65
+ @conbus_autoreport.command("set", short_help="Set auto report status for a module")
66
+ @click.argument("serial_number", type=SERIAL)
67
+ @click.argument("status", type=click.Choice(["on", "off"], case_sensitive=False))
68
+ @connection_command()
69
+ @click.pass_context
70
+ def set_autoreport_command(ctx: Context, serial_number: str, status: str) -> None:
71
+ r"""Set the auto report status for a specific module.
72
+
73
+ Args:
74
+ ctx: Click context object.
75
+ serial_number: 10-digit module serial number.
76
+ status: Auto report status - either 'on' or 'off'.
77
+
78
+ Examples:
79
+ \b
80
+ xp conbus autoreport set 0123450001 on
81
+ xp conbus autoreport set 0123450001 off
82
+ """
83
+
84
+ def on_finish(response: "ConbusWriteConfigResponse") -> None:
85
+ """Handle successful completion of light level on command.
86
+
87
+ Args:
88
+ response: Light level response object.
89
+ """
90
+ click.echo(json.dumps(response.to_dict(), indent=2))
91
+
92
+ service: WriteConfigService = (
93
+ ctx.obj.get("container").get_container().resolve(WriteConfigService)
94
+ )
95
+ telegram_service: TelegramDatapointService = (
96
+ ctx.obj.get("container").get_container().resolve(TelegramDatapointService)
97
+ )
98
+ status_value = True if status == "on" else False
99
+ data_value = telegram_service.get_autoreport_status_data_value(status_value)
100
+
101
+ with service:
102
+ service.write_config(
103
+ serial_number=serial_number,
104
+ datapoint_type=DataPointType.AUTO_REPORT_STATUS,
105
+ data_value=data_value,
106
+ finish_callback=on_finish,
107
+ timeout_seconds=0.5,
108
+ )
@@ -23,23 +23,30 @@ from xp.services.telegram.telegram_blink_service import BlinkError
23
23
  @connection_command()
24
24
  @handle_service_errors(BlinkError)
25
25
  def send_blink_on_telegram(ctx: Context, serial_number: str) -> None:
26
- """
27
- Send blink command to start blinking module LED.
26
+ r"""Send blink command to start blinking module LED.
28
27
 
29
- Examples:
28
+ Args:
29
+ ctx: Click context object.
30
+ serial_number: 10-digit module serial number.
30
31
 
31
- \b
32
+ Examples:
33
+ \b
32
34
  xp conbus blink on 0012345008
33
35
  """
34
36
 
35
- def finish(service_response: ConbusBlinkResponse) -> None:
37
+ def on_finish(service_response: ConbusBlinkResponse) -> None:
38
+ """Handle successful completion of blink on command.
39
+
40
+ Args:
41
+ service_response: Blink response object.
42
+ """
36
43
  click.echo(json.dumps(service_response.to_dict(), indent=2))
37
44
 
38
45
  service: ConbusBlinkService = (
39
46
  ctx.obj.get("container").get_container().resolve(ConbusBlinkService)
40
47
  )
41
48
  with service:
42
- service.send_blink_telegram(serial_number, "on", finish, 0.5)
49
+ service.send_blink_telegram(serial_number, "on", on_finish, 0.5)
43
50
 
44
51
 
45
52
  @conbus_blink.command("off")
@@ -48,30 +55,35 @@ def send_blink_on_telegram(ctx: Context, serial_number: str) -> None:
48
55
  @connection_command()
49
56
  @handle_service_errors(BlinkError)
50
57
  def send_blink_off_telegram(ctx: Context, serial_number: str) -> None:
51
- """
52
- Send blink command to start blinking module LED.
58
+ r"""Send blink command to stop blinking module LED.
53
59
 
54
- Examples:
60
+ Args:
61
+ ctx: Click context object.
62
+ serial_number: 10-digit module serial number.
55
63
 
56
- \b
64
+ Examples:
65
+ \b
57
66
  xp conbus blink off 0012345008
58
67
  """
59
68
 
60
- def finish(service_response: ConbusBlinkResponse) -> None:
69
+ def on_finish(service_response: ConbusBlinkResponse) -> None:
70
+ """Handle successful completion of blink off command.
71
+
72
+ Args:
73
+ service_response: Blink response object.
74
+ """
61
75
  click.echo(json.dumps(service_response.to_dict(), indent=2))
62
76
 
63
77
  service: ConbusBlinkService = (
64
78
  ctx.obj.get("container").get_container().resolve(ConbusBlinkService)
65
79
  )
66
80
  with service:
67
- service.send_blink_telegram(serial_number, "off", finish, 0.5)
81
+ service.send_blink_telegram(serial_number, "off", on_finish, 0.5)
68
82
 
69
83
 
70
84
  @conbus_blink.group("all", short_help="Control blink state for all devices")
71
85
  def conbus_blink_all() -> None:
72
- """
73
- Control blink state for all discovered devices.
74
- """
86
+ """Control blink state for all discovered devices."""
75
87
  pass
76
88
 
77
89
 
@@ -80,27 +92,37 @@ def conbus_blink_all() -> None:
80
92
  @connection_command()
81
93
  @handle_service_errors(BlinkError)
82
94
  def blink_all_off(ctx: Context) -> None:
83
- """
84
- Turn off blinking for all discovered devices.
95
+ r"""Turn off blinking for all discovered devices.
85
96
 
86
- Examples:
97
+ Args:
98
+ ctx: Click context object.
87
99
 
88
- \b
100
+ Examples:
101
+ \b
89
102
  xp conbus blink all off
90
103
  """
91
104
 
92
- def finish(discovered_devices: ConbusBlinkResponse) -> None:
105
+ def on_finish(discovered_devices: ConbusBlinkResponse) -> None:
106
+ """Handle successful completion of blink all off command.
107
+
108
+ Args:
109
+ discovered_devices: Blink response with all devices.
110
+ """
93
111
  click.echo(json.dumps(discovered_devices.to_dict(), indent=2))
94
112
 
95
113
  def progress(message: str) -> None:
114
+ """Handle progress updates during blink all off operation.
115
+
116
+ Args:
117
+ message: Progress message string.
118
+ """
96
119
  click.echo(message)
97
- pass
98
120
 
99
121
  service: ConbusBlinkAllService = (
100
122
  ctx.obj.get("container").get_container().resolve(ConbusBlinkAllService)
101
123
  )
102
124
  with service:
103
- service.send_blink_all_telegram("off", progress, finish, 0.5)
125
+ service.send_blink_all_telegram("off", progress, on_finish, 0.5)
104
126
 
105
127
 
106
128
  @conbus_blink_all.command("on", short_help="Turn on blinking for all devices")
@@ -108,24 +130,34 @@ def blink_all_off(ctx: Context) -> None:
108
130
  @connection_command()
109
131
  @handle_service_errors(BlinkError)
110
132
  def blink_all_on(ctx: Context) -> None:
111
- """
112
- Turn on blinking for all discovered devices.
133
+ r"""Turn on blinking for all discovered devices.
113
134
 
114
- Examples:
135
+ Args:
136
+ ctx: Click context object.
115
137
 
116
- \b
138
+ Examples:
139
+ \b
117
140
  xp conbus blink all on
118
141
  """
119
142
 
120
- def finish(discovered_devices: ConbusBlinkResponse) -> None:
143
+ def on_finish(discovered_devices: ConbusBlinkResponse) -> None:
144
+ """Handle successful completion of blink all on command.
145
+
146
+ Args:
147
+ discovered_devices: Blink response with all devices.
148
+ """
121
149
  click.echo(json.dumps(discovered_devices.to_dict(), indent=2))
122
150
 
123
151
  def progress(message: str) -> None:
152
+ """Handle progress updates during blink all on operation.
153
+
154
+ Args:
155
+ message: Progress message string.
156
+ """
124
157
  click.echo(message)
125
- pass
126
158
 
127
159
  service: ConbusBlinkAllService = (
128
160
  ctx.obj.get("container").get_container().resolve(ConbusBlinkAllService)
129
161
  )
130
162
  with service:
131
- service.send_blink_all_telegram("on", progress, finish, 0.5)
163
+ service.send_blink_all_telegram("on", progress, on_finish, 0.5)
@@ -1,3 +1,5 @@
1
+ """Conbus configuration CLI commands."""
2
+
1
3
  import json
2
4
 
3
5
  import click
@@ -12,13 +14,16 @@ from xp.models import ConbusClientConfig
12
14
  @click.pass_context
13
15
  @handle_service_errors(Exception)
14
16
  def show_config(ctx: Context) -> None:
15
- """
16
- Display current Conbus client configuration.
17
+ r"""Display current Conbus client configuration.
17
18
 
18
- Examples:
19
+ Args:
20
+ ctx: Click context object.
19
21
 
20
- \b
22
+ Examples:
23
+ \b
21
24
  xp conbus config
22
25
  """
23
- config = ctx.obj.get("container").get_container().resolve(ConbusClientConfig)
26
+ config: ConbusClientConfig = (
27
+ ctx.obj.get("container").get_container().resolve(ConbusClientConfig)
28
+ )
24
29
  click.echo(json.dumps(config.conbus.model_dump(mode="json"), indent=2))
@@ -23,18 +23,29 @@ from xp.services.conbus.conbus_custom_service import ConbusCustomService
23
23
  def send_custom_telegram(
24
24
  ctx: Context, serial_number: str, function_code: str, datapoint_code: str
25
25
  ) -> None:
26
- """
27
- Send custom telegram with specified function and data point codes.
26
+ r"""Send custom telegram with specified function and data point codes.
28
27
 
29
- Examples:
28
+ Args:
29
+ ctx: Click context object.
30
+ serial_number: 10-digit module serial number.
31
+ function_code: Function code.
32
+ datapoint_code: Data point code.
30
33
 
31
- \b
34
+ Examples:
35
+ \b
32
36
  xp conbus custom 0012345011 02 E2
33
37
  xp conbus custom 0012345011 17 AA
34
38
  """
35
- service = ctx.obj.get("container").get_container().resolve(ConbusCustomService)
39
+ service: ConbusCustomService = (
40
+ ctx.obj.get("container").get_container().resolve(ConbusCustomService)
41
+ )
36
42
 
37
43
  def on_finish(service_response: "ConbusCustomResponse") -> None:
44
+ """Handle successful completion of custom telegram.
45
+
46
+ Args:
47
+ service_response: Custom response object.
48
+ """
38
49
  click.echo(json.dumps(service_response.to_dict(), indent=2))
39
50
 
40
51
  with service: