conson-xp 1.1.0__tar.gz → 1.2.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 (309) hide show
  1. {conson_xp-1.1.0 → conson_xp-1.2.0}/PKG-INFO +1 -1
  2. {conson_xp-1.1.0 → conson_xp-1.2.0}/pyproject.toml +25 -1
  3. conson_xp-1.2.0/src/xp/__init__.py +9 -0
  4. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/api/main.py +18 -3
  5. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/api/models/api.py +13 -2
  6. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/api/models/discover.py +12 -2
  7. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/api/routers/conbus_blink.py +18 -6
  8. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/api/routers/conbus_custom.py +11 -3
  9. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/api/routers/conbus_datapoint.py +10 -3
  10. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/api/routers/conbus_output.py +29 -9
  11. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/api/routers/errors.py +6 -5
  12. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/__init__.py +1 -1
  13. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/__init__.py +1 -0
  14. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/api.py +1 -5
  15. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/api_start_commands.py +14 -8
  16. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/conbus/conbus.py +9 -37
  17. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/conbus/conbus_actiontable_commands.py +21 -1
  18. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/conbus/conbus_autoreport_commands.py +21 -11
  19. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/conbus/conbus_blink_commands.py +53 -21
  20. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/conbus/conbus_config_commands.py +7 -4
  21. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/conbus/conbus_custom_commands.py +13 -4
  22. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/conbus/conbus_datapoint_commands.py +28 -8
  23. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/conbus/conbus_discover_commands.py +15 -4
  24. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/conbus/conbus_lightlevel_commands.py +50 -11
  25. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/conbus/conbus_linknumber_commands.py +21 -11
  26. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/conbus/conbus_msactiontable_commands.py +25 -1
  27. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/conbus/conbus_output_commands.py +46 -12
  28. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/conbus/conbus_raw_commands.py +17 -6
  29. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/conbus/conbus_receive_commands.py +15 -7
  30. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/conbus/conbus_scan_commands.py +17 -4
  31. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/file_commands.py +26 -15
  32. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/homekit/homekit.py +14 -8
  33. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/homekit/homekit_start_commands.py +5 -5
  34. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/module_commands.py +26 -19
  35. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/reverse_proxy_commands.py +24 -18
  36. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/server/server_commands.py +18 -18
  37. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/telegram/telegram.py +4 -12
  38. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/telegram/telegram_blink_commands.py +10 -8
  39. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/telegram/telegram_checksum_commands.py +19 -8
  40. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/telegram/telegram_discover_commands.py +2 -4
  41. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/telegram/telegram_linknumber_commands.py +11 -8
  42. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/telegram/telegram_parse_commands.py +10 -9
  43. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/telegram/telegram_version_commands.py +8 -4
  44. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/main.py +5 -1
  45. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/utils/click_tree.py +23 -3
  46. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/utils/datapoint_type_choice.py +20 -0
  47. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/utils/decorators.py +165 -14
  48. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/utils/error_handlers.py +49 -18
  49. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/utils/formatters.py +95 -10
  50. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/utils/serial_number_type.py +18 -0
  51. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/utils/system_function_choice.py +20 -0
  52. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/utils/xp_module_type.py +20 -0
  53. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/connection/__init__.py +1 -1
  54. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/connection/exceptions.py +5 -5
  55. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/__init__.py +1 -1
  56. conson_xp-1.2.0/src/xp/models/actiontable/__init__.py +1 -0
  57. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/actiontable/actiontable.py +17 -1
  58. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/actiontable/msactiontable_xp20.py +10 -0
  59. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/actiontable/msactiontable_xp24.py +20 -3
  60. conson_xp-1.2.0/src/xp/models/actiontable/msactiontable_xp33.py +65 -0
  61. conson_xp-1.2.0/src/xp/models/conbus/__init__.py +1 -0
  62. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/conbus/conbus.py +34 -4
  63. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/conbus/conbus_autoreport.py +20 -2
  64. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/conbus/conbus_blink.py +22 -2
  65. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/conbus/conbus_client_config.py +22 -1
  66. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/conbus/conbus_connection_status.py +16 -2
  67. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/conbus/conbus_custom.py +21 -2
  68. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/conbus/conbus_datapoint.py +22 -2
  69. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/conbus/conbus_discover.py +18 -2
  70. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/conbus/conbus_lightlevel.py +20 -2
  71. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/conbus/conbus_linknumber.py +20 -2
  72. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/conbus/conbus_output.py +22 -2
  73. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/conbus/conbus_raw.py +17 -2
  74. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/conbus/conbus_receive.py +16 -2
  75. conson_xp-1.2.0/src/xp/models/homekit/__init__.py +1 -0
  76. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/homekit/homekit_accessory.py +15 -1
  77. conson_xp-1.2.0/src/xp/models/homekit/homekit_config.py +102 -0
  78. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/homekit/homekit_conson_config.py +32 -0
  79. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/log_entry.py +49 -9
  80. conson_xp-1.2.0/src/xp/models/protocol/__init__.py +1 -0
  81. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/protocol/conbus_protocol.py +130 -21
  82. conson_xp-1.2.0/src/xp/models/telegram/__init__.py +1 -0
  83. conson_xp-1.2.0/src/xp/models/telegram/action_type.py +31 -0
  84. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/telegram/datapoint_type.py +36 -2
  85. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/telegram/event_telegram.py +46 -10
  86. conson_xp-1.2.0/src/xp/models/telegram/event_type.py +15 -0
  87. conson_xp-1.2.0/src/xp/models/telegram/input_action_type.py +69 -0
  88. conson_xp-1.2.0/src/xp/models/telegram/input_type.py +17 -0
  89. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/telegram/module_type.py +69 -19
  90. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/telegram/module_type_code.py +43 -1
  91. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/telegram/output_telegram.py +30 -6
  92. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/telegram/reply_telegram.py +56 -11
  93. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/telegram/system_function.py +35 -3
  94. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/telegram/system_telegram.py +18 -4
  95. conson_xp-1.2.0/src/xp/models/telegram/telegram.py +28 -0
  96. conson_xp-1.2.0/src/xp/models/telegram/telegram_type.py +19 -0
  97. conson_xp-1.2.0/src/xp/models/telegram/timeparam_type.py +51 -0
  98. conson_xp-1.2.0/src/xp/models/write_config_type.py +33 -0
  99. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/__init__.py +1 -1
  100. conson_xp-1.2.0/src/xp/services/conbus/__init__.py +1 -0
  101. conson_xp-1.2.0/src/xp/services/conbus/actiontable/__init__.py +1 -0
  102. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/conbus/actiontable/actiontable_service.py +33 -2
  103. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/conbus/actiontable/msactiontable_service.py +40 -3
  104. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/conbus/actiontable/msactiontable_xp24_serializer.py +36 -4
  105. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/conbus/actiontable/msactiontable_xp33_serializer.py +45 -5
  106. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/conbus/conbus_autoreport_get_service.py +17 -8
  107. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/conbus/conbus_autoreport_set_service.py +29 -16
  108. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/conbus/conbus_blink_all_service.py +40 -21
  109. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/conbus/conbus_blink_service.py +37 -13
  110. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/conbus/conbus_custom_service.py +29 -13
  111. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/conbus/conbus_datapoint_queryall_service.py +40 -16
  112. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/conbus/conbus_datapoint_service.py +33 -12
  113. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/conbus/conbus_discover_service.py +43 -7
  114. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/conbus/conbus_lightlevel_get_service.py +22 -14
  115. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/conbus/conbus_lightlevel_set_service.py +40 -20
  116. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/conbus/conbus_linknumber_get_service.py +18 -10
  117. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/conbus/conbus_linknumber_set_service.py +34 -8
  118. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/conbus/conbus_output_service.py +33 -13
  119. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/conbus/conbus_raw_service.py +36 -16
  120. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/conbus/conbus_receive_service.py +38 -6
  121. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/conbus/conbus_scan_service.py +44 -18
  122. conson_xp-1.2.0/src/xp/services/homekit/__init__.py +1 -0
  123. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/homekit/homekit_cache_service.py +31 -6
  124. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/homekit/homekit_conbus_service.py +33 -2
  125. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/homekit/homekit_config_validator.py +97 -15
  126. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/homekit/homekit_conson_validator.py +51 -7
  127. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/homekit/homekit_dimminglight.py +47 -1
  128. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/homekit/homekit_dimminglight_service.py +35 -1
  129. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/homekit/homekit_hap_service.py +71 -18
  130. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/homekit/homekit_lightbulb.py +35 -1
  131. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/homekit/homekit_lightbulb_service.py +30 -2
  132. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/homekit/homekit_module_service.py +23 -1
  133. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/homekit/homekit_outlet.py +47 -1
  134. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/homekit/homekit_outlet_service.py +44 -2
  135. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/homekit/homekit_service.py +113 -19
  136. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/log_file_service.py +37 -41
  137. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/module_type_service.py +26 -5
  138. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/protocol/__init__.py +1 -1
  139. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/protocol/conbus_protocol.py +110 -16
  140. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/protocol/protocol_factory.py +40 -0
  141. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/protocol/telegram_protocol.py +38 -7
  142. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/reverse_proxy_service.py +79 -14
  143. conson_xp-1.2.0/src/xp/services/server/__init__.py +1 -0
  144. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/server/base_server_service.py +102 -14
  145. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/server/cp20_server_service.py +12 -4
  146. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/server/server_service.py +26 -11
  147. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/server/xp130_server_service.py +11 -3
  148. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/server/xp20_server_service.py +11 -3
  149. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/server/xp230_server_service.py +11 -3
  150. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/server/xp24_server_service.py +33 -6
  151. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/server/xp33_server_service.py +41 -8
  152. conson_xp-1.2.0/src/xp/services/telegram/__init__.py +1 -0
  153. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/telegram/telegram_blink_service.py +19 -31
  154. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/telegram/telegram_checksum_service.py +10 -10
  155. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/telegram/telegram_discover_service.py +58 -29
  156. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/telegram/telegram_link_number_service.py +27 -40
  157. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/telegram/telegram_output_service.py +46 -49
  158. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/telegram/telegram_service.py +41 -41
  159. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/telegram/telegram_version_service.py +4 -2
  160. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/utils/__init__.py +1 -1
  161. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/utils/dependencies.py +0 -1
  162. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/utils/serialization.py +6 -0
  163. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/utils/time_utils.py +6 -11
  164. conson_xp-1.2.0/tests/__init__.py +1 -0
  165. conson_xp-1.2.0/tests/integration/__init__.py +1 -0
  166. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/telegram_test_data.py +13 -2
  167. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/test_actiontable_integration.py +18 -10
  168. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/test_blink_integration.py +11 -11
  169. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/test_checksum_integration.py +1 -1
  170. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/test_conbus_autoreport_integration.py +70 -20
  171. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/test_conbus_blink_integration.py +24 -0
  172. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/test_conbus_datapoint_integration.py +32 -15
  173. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/test_conbus_lightlevel_integration.py +34 -0
  174. conson_xp-1.2.0/tests/integration/test_conbus_linknumber_integration.py +394 -0
  175. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/test_conbus_raw_integration.py +32 -0
  176. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/test_discovery_integration.py +7 -7
  177. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/test_event_telegram_integration.py +18 -16
  178. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/test_homekit_config_integration.py +23 -3
  179. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/test_link_number_integration.py +10 -10
  180. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/test_module_integration.py +27 -25
  181. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/test_reverse_proxy_integration.py +24 -15
  182. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/test_xp20_action_table_integration.py +9 -9
  183. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/test_xp24_action_table_integration.py +31 -7
  184. conson_xp-1.2.0/tests/unit/__init__.py +1 -0
  185. conson_xp-1.2.0/tests/unit/test_cli/__init__.py +1 -0
  186. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_cli/test_click_tree.py +22 -22
  187. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_cli/test_conbus_actiontable_commands.py +27 -11
  188. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_cli/test_conbus_blink_commands.py +6 -6
  189. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_cli/test_formatters.py +8 -0
  190. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_cli/test_serial_number_type.py +19 -0
  191. conson_xp-1.2.0/tests/unit/test_connection/__init__.py +1 -0
  192. conson_xp-1.2.0/tests/unit/test_encoding/__init__.py +1 -0
  193. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_encoding/test_latin1_edge_cases.py +14 -9
  194. conson_xp-1.2.0/tests/unit/test_models/__init__.py +1 -0
  195. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_models/test_conbus_client_send.py +17 -15
  196. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_models/test_conbus_linknumber.py +12 -10
  197. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_models/test_event_telegram.py +11 -9
  198. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_models/test_log_entry.py +15 -15
  199. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_models/test_module_type.py +20 -18
  200. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_models/test_system_telegram_enhancements.py +13 -13
  201. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_models/test_version_telegram.py +0 -2
  202. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_models/test_xp20_action_table.py +14 -14
  203. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_models/test_xp24_action_table.py +11 -11
  204. conson_xp-1.2.0/tests/unit/test_services/__init__.py +1 -0
  205. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_actiontable_service.py +16 -16
  206. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_base_server_service.py +5 -0
  207. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_blink_service.py +13 -13
  208. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_conbus_blink_service.py +14 -14
  209. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_conbus_lightlevel_service.py +15 -15
  210. conson_xp-1.2.0/tests/unit/test_services/test_conbus_linknumber_service.py +392 -0
  211. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_conbus_raw_service.py +11 -11
  212. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_conbus_reverse_proxy_service.py +20 -20
  213. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_discovery_service.py +20 -20
  214. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_homekit_cache_service.py +19 -19
  215. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_homekit_config_validator.py +18 -2
  216. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_homekit_conson_service.py +3 -0
  217. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_homekit_services.py +49 -45
  218. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_link_number_service.py +14 -14
  219. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_log_file_service.py +34 -22
  220. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_module_type_service.py +29 -27
  221. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_protocol.py +29 -27
  222. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_telegram_input_service.py +18 -16
  223. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_telegram_protocol.py +21 -21
  224. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_telegram_service.py +51 -49
  225. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_xp20_action_table_serializer.py +14 -14
  226. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_xp24_action_table_serializer.py +10 -11
  227. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_xp24_action_table_service.py +23 -23
  228. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_xp33_action_table_serializer.py +17 -17
  229. conson_xp-1.2.0/tests/unit/test_utils/__init__.py +1 -0
  230. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_utils/test_checksum.py +1 -1
  231. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_utils/test_event_helper.py +17 -0
  232. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_utils/test_time_utils.py +16 -16
  233. conson_xp-1.1.0/src/xp/__init__.py +0 -8
  234. conson_xp-1.1.0/src/xp/models/actiontable/__init__.py +0 -0
  235. conson_xp-1.1.0/src/xp/models/actiontable/msactiontable_xp33.py +0 -42
  236. conson_xp-1.1.0/src/xp/models/conbus/__init__.py +0 -0
  237. conson_xp-1.1.0/src/xp/models/homekit/__init__.py +0 -0
  238. conson_xp-1.1.0/src/xp/models/homekit/homekit_config.py +0 -50
  239. conson_xp-1.1.0/src/xp/models/protocol/__init__.py +0 -0
  240. conson_xp-1.1.0/src/xp/models/telegram/__init__.py +0 -0
  241. conson_xp-1.1.0/src/xp/models/telegram/action_type.py +0 -17
  242. conson_xp-1.1.0/src/xp/models/telegram/event_type.py +0 -8
  243. conson_xp-1.1.0/src/xp/models/telegram/input_action_type.py +0 -37
  244. conson_xp-1.1.0/src/xp/models/telegram/input_type.py +0 -9
  245. conson_xp-1.1.0/src/xp/models/telegram/telegram.py +0 -19
  246. conson_xp-1.1.0/src/xp/models/telegram/telegram_type.py +0 -12
  247. conson_xp-1.1.0/src/xp/models/telegram/timeparam_type.py +0 -24
  248. conson_xp-1.1.0/src/xp/models/write_config_type.py +0 -18
  249. conson_xp-1.1.0/src/xp/services/conbus/__init__.py +0 -0
  250. conson_xp-1.1.0/src/xp/services/conbus/actiontable/__init__.py +0 -0
  251. conson_xp-1.1.0/src/xp/services/homekit/__init__.py +0 -0
  252. conson_xp-1.1.0/src/xp/services/server/__init__.py +0 -0
  253. conson_xp-1.1.0/src/xp/services/telegram/__init__.py +0 -0
  254. conson_xp-1.1.0/tests/__init__.py +0 -0
  255. conson_xp-1.1.0/tests/integration/__init__.py +0 -0
  256. conson_xp-1.1.0/tests/integration/test_conbus_linknumber_integration.py +0 -469
  257. conson_xp-1.1.0/tests/unit/__init__.py +0 -0
  258. conson_xp-1.1.0/tests/unit/test_cli/__init__.py +0 -0
  259. conson_xp-1.1.0/tests/unit/test_connection/__init__.py +0 -0
  260. conson_xp-1.1.0/tests/unit/test_encoding/__init__.py +0 -1
  261. conson_xp-1.1.0/tests/unit/test_models/__init__.py +0 -0
  262. conson_xp-1.1.0/tests/unit/test_services/__init__.py +0 -0
  263. conson_xp-1.1.0/tests/unit/test_services/test_conbus_linknumber_service.py +0 -427
  264. conson_xp-1.1.0/tests/unit/test_utils/__init__.py +0 -0
  265. {conson_xp-1.1.0 → conson_xp-1.2.0}/LICENSE +0 -0
  266. {conson_xp-1.1.0 → conson_xp-1.2.0}/README.md +0 -0
  267. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/api/__init__.py +0 -0
  268. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/api/models/__init__.py +0 -0
  269. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/api/routers/__init__.py +0 -0
  270. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/api/routers/conbus.py +0 -0
  271. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/__main__.py +0 -0
  272. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/conbus/__init__.py +0 -0
  273. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/homekit/__init__.py +0 -0
  274. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/server/__init__.py +0 -0
  275. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/commands/telegram/__init__.py +0 -0
  276. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/cli/utils/__init__.py +0 -0
  277. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/models/response.py +0 -0
  278. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/conbus/actiontable/actiontable_serializer.py +0 -0
  279. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/services/conbus/actiontable/msactiontable_xp20_serializer.py +0 -0
  280. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/utils/checksum.py +0 -0
  281. {conson_xp-1.1.0 → conson_xp-1.2.0}/src/xp/utils/event_helper.py +0 -0
  282. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/.coverage +0 -0
  283. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/conftest.py +0 -0
  284. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/.coverage +0 -0
  285. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/test_api/.coverage +0 -0
  286. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/test_api/__init__.py +0 -0
  287. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/test_conbus_receive_integration.py +0 -0
  288. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/test_output_integration.py +0 -0
  289. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/test_system_reply_telegram_integration.py +0 -0
  290. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/integration/test_version_integration.py +0 -0
  291. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_api/__init__.py +0 -0
  292. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_cli/test_datapoint_type_choice.py +0 -0
  293. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_cli/test_decorators.py +0 -0
  294. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_cli/test_error_handlers.py +0 -0
  295. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_cli/test_system_function_choice.py +0 -0
  296. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_connection/test_connection_init.py +0 -0
  297. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_connection/test_exceptions.py +0 -0
  298. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_models/test_conbus.py +0 -0
  299. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_models/test_conbus_discover.py +0 -0
  300. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_models/test_reply_telegram.py +0 -0
  301. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_models/test_system_telegram.py +0 -0
  302. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_models/test_write_config_type.py +0 -0
  303. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_models/test_xp24_action_telegram.py +0 -0
  304. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_checksum_service.py +0 -0
  305. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_server_service.py +0 -0
  306. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_version_service.py +0 -0
  307. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_xp24_action_service.py +0 -0
  308. {conson_xp-1.1.0 → conson_xp-1.2.0}/tests/unit/test_services/test_xp_server_services.py +0 -0
  309. {conson_xp-1.1.0 → conson_xp-1.2.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.2.0
4
4
  Summary: XP Protocol Communication Tools
5
5
  Author-Email: ldvchosal <ldvchosal@github.com>
6
6
  License: MIT License
@@ -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.2.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.2.0"
7
+ __manufacturer__ = "salchichon"
8
+ __model__ = "xp.cli"
9
+ __serial__ = "2025.09.23.000"
@@ -18,7 +18,11 @@ logger = logging.getLogger(__name__)
18
18
 
19
19
 
20
20
  def load_api_config() -> dict[str, Any]:
21
- """Load API configuration from api.yml or environment variables."""
21
+ """Load API configuration from api.yml or environment variables.
22
+
23
+ Returns:
24
+ Dictionary containing API configuration settings.
25
+ """
22
26
  config = {
23
27
  "title": "XP Protocol API",
24
28
  "description": "REST API for XP Protocol Conbus operations",
@@ -63,6 +67,9 @@ def create_app(container: ServiceContainer) -> FastAPI:
63
67
 
64
68
  Args:
65
69
  container: Optional ServiceContainer instance. If not provided, a new one will be created.
70
+
71
+ Returns:
72
+ Configured FastAPI application instance.
66
73
  """
67
74
  config = load_api_config()
68
75
 
@@ -92,13 +99,21 @@ def create_app(container: ServiceContainer) -> FastAPI:
92
99
  # Health check endpoint
93
100
  @fastapi.get("/health")
94
101
  async def health_check() -> dict[str, str]:
95
- """Health check endpoint."""
102
+ """Return health status of the API.
103
+
104
+ Returns:
105
+ Dictionary containing status and service information.
106
+ """
96
107
  return {"status": "healthy", "service": "xp-api"}
97
108
 
98
109
  # Root endpoint
99
110
  @fastapi.get("/")
100
111
  async def root() -> dict[str, str]:
101
- """Root endpoint with API information."""
112
+ """Return API information and available endpoints.
113
+
114
+ Returns:
115
+ Dictionary containing API metadata and endpoint links.
116
+ """
102
117
  return {
103
118
  "message": "XP Protocol API",
104
119
  "version": config["version"],
@@ -6,7 +6,13 @@ from pydantic import BaseModel, Field
6
6
 
7
7
 
8
8
  class ApiResponse(BaseModel):
9
- """Response model for successful Input operation."""
9
+ """Response model for successful Input operation.
10
+
11
+ Attributes:
12
+ success: Operation success status.
13
+ result: Result value.
14
+ description: Description of the result.
15
+ """
10
16
 
11
17
  success: bool = Field(default=True, description="Operation success status")
12
18
  result: Optional[str] = Field(default=None, description="Result")
@@ -14,7 +20,12 @@ class ApiResponse(BaseModel):
14
20
 
15
21
 
16
22
  class ApiErrorResponse(BaseModel):
17
- """Response model for failed Input operation."""
23
+ """Response model for failed Input operation.
24
+
25
+ Attributes:
26
+ success: Operation success status (always False).
27
+ error: Error message describing what went wrong.
28
+ """
18
29
 
19
30
  success: bool = Field(default=False, description="Operation success status")
20
31
  error: str = Field(..., description="Error message")
@@ -6,7 +6,12 @@ from pydantic import BaseModel, Field
6
6
 
7
7
 
8
8
  class DiscoverResponse(BaseModel):
9
- """Response model for successful discover operation."""
9
+ """Response model for successful discover operation.
10
+
11
+ Attributes:
12
+ success: Operation success status.
13
+ devices: List of discovered device information strings.
14
+ """
10
15
 
11
16
  success: bool = Field(default=True, description="Operation success status")
12
17
  devices: List[str] = Field(
@@ -15,7 +20,12 @@ class DiscoverResponse(BaseModel):
15
20
 
16
21
 
17
22
  class DiscoverErrorResponse(BaseModel):
18
- """Response model for failed discover operation."""
23
+ """Response model for failed discover operation.
24
+
25
+ Attributes:
26
+ success: Operation success status (always False).
27
+ error: Error message describing what went wrong.
28
+ """
19
29
 
20
30
  success: bool = Field(default=False, description="Operation success status")
21
31
  error: str = Field(..., description="Error message")
@@ -29,10 +29,16 @@ async def blink_on(
29
29
  request: Request,
30
30
  serial_number: str = "1702033007",
31
31
  ) -> Union[ApiResponse, ApiErrorResponse, JSONResponse]:
32
- """
33
- Initiate Input operation to find devices on the network.
32
+ """Turn on device blinking.
33
+
34
+ Sends a blink on telegram to make the device blink.
35
+
36
+ Args:
37
+ request: FastAPI request object.
38
+ serial_number: Serial number of the device.
34
39
 
35
- Sends a broadcastInput telegram and collects responses from all connected devices.
40
+ Returns:
41
+ API response with blink result or error.
36
42
  """
37
43
  service = request.app.state.container.get_container().resolve(ConbusBlinkService)
38
44
 
@@ -74,10 +80,16 @@ async def blink_off(
74
80
  request: Request,
75
81
  serial_number: str = "1702033007",
76
82
  ) -> Union[ApiResponse, ApiErrorResponse, JSONResponse]:
77
- """
78
- Initiate Input operation to find devices on the network.
83
+ """Turn off device blinking.
84
+
85
+ Sends a blink off telegram to stop the device from blinking.
86
+
87
+ Args:
88
+ request: FastAPI request object.
89
+ serial_number: Serial number of the device.
79
90
 
80
- Sends a broadcastInput telegram and collects responses from all connected devices.
91
+ Returns:
92
+ API response with blink result or error.
81
93
  """
82
94
  service = request.app.state.container.get_container().resolve(ConbusBlinkService)
83
95
 
@@ -30,10 +30,18 @@ async def custom_function(
30
30
  function_code: str = "02",
31
31
  data: str = "00",
32
32
  ) -> Union[ApiResponse, ApiErrorResponse, JSONResponse]:
33
- """
34
- Initiate a Datapoint operation to find devices on the network.
33
+ """Execute a custom function on a device.
34
+
35
+ Sends a custom telegram with specified function code and data.
36
+
37
+ Args:
38
+ request: FastAPI request object.
39
+ serial_number: Serial number of the device.
40
+ function_code: Function code to execute.
41
+ data: Data to send with the function.
35
42
 
36
- Sends a broadcastDatapoint telegram and collects responses from all connected devices.
43
+ Returns:
44
+ API response with custom function result or error.
37
45
  """
38
46
  service = request.app.state.container.get_container().resolve(ConbusCustomService)
39
47
  # SendDatapoint telegram and receive responses
@@ -30,10 +30,17 @@ async def datapoint_devices(
30
30
  datapoint: DataPointType = DataPointType.SW_VERSION,
31
31
  serial_number: str = "1702033007",
32
32
  ) -> Union[ApiResponse, ApiErrorResponse, JSONResponse]:
33
- """
34
- Initiate a Datapoint operation to find devices on the network.
33
+ """Query a datapoint value from a device.
34
+
35
+ Sends a datapoint query telegram and retrieves the requested datapoint value.
36
+
37
+ Args:
38
+ request: FastAPI request object.
39
+ datapoint: Type of datapoint to query (default: SW_VERSION).
40
+ serial_number: Serial number of the device.
35
41
 
36
- Sends a broadcastDatapoint telegram and collects responses from all connected devices.
42
+ Returns:
43
+ API response with datapoint value or error.
37
44
  """
38
45
  service = request.app.state.container.get_container().resolve(
39
46
  ConbusDatapointService
@@ -32,10 +32,18 @@ async def input_action(
32
32
  serial: str = "1702033007",
33
33
  device_input: int = 0,
34
34
  ) -> Union[ApiResponse, ApiErrorResponse, JSONResponse]:
35
- """
36
- Initiate Input operation to find devices on the network.
35
+ """Initiate Input operation to find devices on the network.
36
+
37
+ Sends a broadcast Input telegram and collects responses from all connected devices.
38
+
39
+ Args:
40
+ request: FastAPI request object.
41
+ action: Action type to perform (default: OFF_PRESS).
42
+ serial: Serial number of the device.
43
+ device_input: Device input number.
37
44
 
38
- Sends a broadcastInput telegram and collects responses from all connected devices.
45
+ Returns:
46
+ API response with operation result or error.
39
47
  """
40
48
  service = request.app.state.container.get_container().resolve(ConbusOutputService)
41
49
 
@@ -77,10 +85,16 @@ async def output_status(
77
85
  request: Request,
78
86
  serial_number: str,
79
87
  ) -> Union[ApiResponse, ApiErrorResponse, JSONResponse]:
80
- """
81
- Initiate Input operation to find devices on the network.
88
+ """Query output status from a device.
89
+
90
+ Sends a status query telegram and retrieves the output state.
82
91
 
83
- Sends a broadcastInput telegram and collects responses from all connected devices.
92
+ Args:
93
+ request: FastAPI request object.
94
+ serial_number: Serial number of the device to query.
95
+
96
+ Returns:
97
+ API response with output status or error.
84
98
  """
85
99
  service = request.app.state.container.get_container().resolve(ConbusOutputService)
86
100
 
@@ -119,10 +133,16 @@ async def output_state(
119
133
  request: Request,
120
134
  serial_number: str,
121
135
  ) -> Union[ApiResponse, ApiErrorResponse, JSONResponse]:
122
- """
123
- Initiate Input operation to find devices on the network.
136
+ """Query module state from a device.
137
+
138
+ Sends a state query telegram and retrieves the module state.
139
+
140
+ Args:
141
+ request: FastAPI request object.
142
+ serial_number: Serial number of the device to query.
124
143
 
125
- Sends a broadcastInput telegram and collects responses from all connected devices.
144
+ Returns:
145
+ API response with module state or error.
126
146
  """
127
147
  service = request.app.state.container.get_container().resolve(ConbusOutputService)
128
148
 
@@ -1,3 +1,5 @@
1
+ """Error handling utilities for API endpoints."""
2
+
1
3
  from starlette import status
2
4
  from starlette.responses import JSONResponse
3
5
 
@@ -7,15 +9,14 @@ from xp.api.models.discover import DiscoverErrorResponse
7
9
  def handle_service_error(
8
10
  error: str, default_status_code: int = status.HTTP_500_INTERNAL_SERVER_ERROR
9
11
  ) -> JSONResponse:
10
- """
11
- Handle service errors by creating a standardized JSON error response.
12
+ """Handle service errors by creating a standardized JSON error response.
12
13
 
13
14
  Args:
14
- error: Service response object with success and error attributes
15
- default_status_code: HTTP status code to use (defaults to 500)
15
+ error: Service response object with success and error attributes.
16
+ default_status_code: HTTP status code to use (defaults to 500).
16
17
 
17
18
  Returns:
18
- JSONResponse with error details
19
+ JSONResponse with error details.
19
20
  """
20
21
  error_msg = error or "Unknown service error"
21
22
 
@@ -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
 
@@ -38,6 +38,7 @@ from xp.cli.commands.conbus.conbus_datapoint_commands import (
38
38
  )
39
39
  from xp.cli.commands.conbus.conbus_discover_commands import send_discover_telegram
40
40
  from xp.cli.commands.conbus.conbus_lightlevel_commands import (
41
+ xp_lightlevel_get,
41
42
  xp_lightlevel_off,
42
43
  xp_lightlevel_on,
43
44
  xp_lightlevel_set,
@@ -8,9 +8,5 @@ from click_help_colors import HelpColorsGroup
8
8
  cls=HelpColorsGroup, help_headers_color="yellow", help_options_color="green"
9
9
  )
10
10
  def api() -> None:
11
- """
12
- API server management commands.
13
-
14
- Manage the FastAPI server for XP Protocol operations.
15
- """
11
+ """Manage the FastAPI server for XP Protocol operations."""
16
12
  pass
@@ -58,31 +58,37 @@ def start_api_server(
58
58
  log_level: str,
59
59
  access_log: bool,
60
60
  ) -> None:
61
- """
62
- Start the FastAPI server.
61
+ r"""Start the FastAPI server.
63
62
 
64
63
  This command starts the XP Protocol FastAPI server using uvicorn.
65
64
  The server provides REST API endpoints for Conbus operations.
66
65
 
67
- Examples:
66
+ Args:
67
+ context: Click context object.
68
+ host: Host to bind the server to.
69
+ port: Port to bind the server to.
70
+ reload: Enable auto-reload for development.
71
+ workers: Number of worker processes.
72
+ log_level: Log level for the server.
73
+ access_log: Enable/disable access log.
68
74
 
69
- \b
75
+ Examples:
76
+ \b
70
77
  # Start server on default host and port
71
78
  xp api start
72
79
 
73
- \b
80
+ \b
74
81
  # Start server on specific host and port
75
82
  xp api start --host 0.0.0.0 --port 8080
76
83
 
77
- \b
84
+ \b
78
85
  # Start development server with auto-reload
79
86
  xp api start --reload
80
87
 
81
- \b
88
+ \b
82
89
  # Start production server with multiple workers
83
90
  xp api start --host 0.0.0.0 --workers 4 --no-access-log
84
91
  """
85
-
86
92
  # Validate workers and reload options
87
93
  if reload and workers > 1:
88
94
  click.echo(
@@ -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,28 @@ 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"""
25
+ """Download action table from XP module.
26
+
27
+ Args:
28
+ ctx: Click context object.
29
+ serial_number: 10-digit module serial number.
30
+ """
26
31
  service = ctx.obj.get("container").get_container().resolve(ActionTableService)
27
32
 
28
33
  def progress_callback(progress: str) -> None:
34
+ """Handle progress updates during action table download.
35
+
36
+ Args:
37
+ progress: Progress message string.
38
+ """
29
39
  click.echo(progress)
30
40
 
31
41
  def finish_callback(actiontable: ActionTable) -> None:
42
+ """Handle successful completion of action table download.
43
+
44
+ Args:
45
+ actiontable: Downloaded action table object.
46
+ """
32
47
  output = {
33
48
  "serial_number": serial_number,
34
49
  "actiontable": asdict(actiontable),
@@ -36,6 +51,11 @@ def conbus_download_actiontable(ctx: Context, serial_number: str) -> None:
36
51
  click.echo(json.dumps(output, indent=2, default=str))
37
52
 
38
53
  def error_callback(error: str) -> None:
54
+ """Handle errors during action table download.
55
+
56
+ Args:
57
+ error: Error message string.
58
+ """
39
59
  click.echo(error)
40
60
 
41
61
  with service:
@@ -22,14 +22,14 @@ from xp.services.conbus.conbus_autoreport_set_service import ConbusAutoreportSet
22
22
  @connection_command()
23
23
  @click.pass_context
24
24
  def get_autoreport_command(ctx: Context, serial_number: str) -> None:
25
- """
26
- Get the current auto report status for a specific module.
25
+ r"""Get the current auto report status for a specific module.
27
26
 
28
- SERIAL_NUMBER: 10-digit module serial number
27
+ Args:
28
+ ctx: Click context object.
29
+ serial_number: 10-digit module serial number.
29
30
 
30
31
  Examples:
31
-
32
- \b
32
+ \b
33
33
  xp conbus autoreport get 0123450001
34
34
  """
35
35
  # Get service from container
@@ -38,6 +38,11 @@ def get_autoreport_command(ctx: Context, serial_number: str) -> None:
38
38
  )
39
39
 
40
40
  def on_finish(service_response: ConbusAutoreportResponse) -> None:
41
+ """Handle successful completion of auto report status retrieval.
42
+
43
+ Args:
44
+ service_response: Auto report response object.
45
+ """
41
46
  click.echo(json.dumps(service_response.to_dict(), indent=2))
42
47
 
43
48
  with service:
@@ -53,15 +58,15 @@ def get_autoreport_command(ctx: Context, serial_number: str) -> None:
53
58
  @connection_command()
54
59
  @click.pass_context
55
60
  def set_autoreport_command(ctx: Context, serial_number: str, status: str) -> None:
56
- """
57
- Set the auto report status for a specific module.
61
+ r"""Set the auto report status for a specific module.
58
62
 
59
- SERIAL_NUMBER: 10-digit module serial number
60
- STATUS: Auto report status - either 'on' or 'off'
63
+ Args:
64
+ ctx: Click context object.
65
+ serial_number: 10-digit module serial number.
66
+ status: Auto report status - either 'on' or 'off'.
61
67
 
62
68
  Examples:
63
-
64
- \b
69
+ \b
65
70
  xp conbus autoreport set 0123450001 on
66
71
  xp conbus autoreport set 0123450001 off
67
72
  """
@@ -72,6 +77,11 @@ def set_autoreport_command(ctx: Context, serial_number: str, status: str) -> Non
72
77
  status_bool = status.lower() == "on"
73
78
 
74
79
  def on_finish(service_response: ConbusAutoreportResponse) -> None:
80
+ """Handle successful completion of auto report status setting.
81
+
82
+ Args:
83
+ service_response: Auto report response object.
84
+ """
75
85
  click.echo(json.dumps(service_response.to_dict(), indent=2))
76
86
 
77
87
  with service: