conson-xp 1.0.1__py3-none-any.whl → 1.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. {conson_xp-1.0.1.dist-info → conson_xp-1.2.0.dist-info}/METADATA +1 -1
  2. conson_xp-1.2.0.dist-info/RECORD +181 -0
  3. xp/__init__.py +4 -3
  4. xp/api/main.py +18 -3
  5. xp/api/models/api.py +13 -2
  6. xp/api/models/discover.py +12 -2
  7. xp/api/routers/conbus_blink.py +18 -6
  8. xp/api/routers/conbus_custom.py +11 -3
  9. xp/api/routers/conbus_datapoint.py +10 -3
  10. xp/api/routers/conbus_output.py +29 -9
  11. xp/api/routers/errors.py +6 -5
  12. xp/cli/__init__.py +1 -1
  13. xp/cli/commands/__init__.py +1 -0
  14. xp/cli/commands/api.py +1 -5
  15. xp/cli/commands/api_start_commands.py +14 -8
  16. xp/cli/commands/conbus/conbus.py +9 -37
  17. xp/cli/commands/conbus/conbus_actiontable_commands.py +21 -1
  18. xp/cli/commands/conbus/conbus_autoreport_commands.py +21 -11
  19. xp/cli/commands/conbus/conbus_blink_commands.py +53 -21
  20. xp/cli/commands/conbus/conbus_config_commands.py +7 -4
  21. xp/cli/commands/conbus/conbus_custom_commands.py +13 -4
  22. xp/cli/commands/conbus/conbus_datapoint_commands.py +28 -8
  23. xp/cli/commands/conbus/conbus_discover_commands.py +15 -4
  24. xp/cli/commands/conbus/conbus_lightlevel_commands.py +50 -11
  25. xp/cli/commands/conbus/conbus_linknumber_commands.py +21 -11
  26. xp/cli/commands/conbus/conbus_msactiontable_commands.py +25 -1
  27. xp/cli/commands/conbus/conbus_output_commands.py +46 -12
  28. xp/cli/commands/conbus/conbus_raw_commands.py +17 -6
  29. xp/cli/commands/conbus/conbus_receive_commands.py +15 -7
  30. xp/cli/commands/conbus/conbus_scan_commands.py +35 -102
  31. xp/cli/commands/file_commands.py +26 -15
  32. xp/cli/commands/homekit/homekit.py +14 -8
  33. xp/cli/commands/homekit/homekit_start_commands.py +5 -5
  34. xp/cli/commands/module_commands.py +26 -19
  35. xp/cli/commands/reverse_proxy_commands.py +24 -18
  36. xp/cli/commands/server/server_commands.py +18 -18
  37. xp/cli/commands/telegram/telegram.py +4 -12
  38. xp/cli/commands/telegram/telegram_blink_commands.py +10 -8
  39. xp/cli/commands/telegram/telegram_checksum_commands.py +19 -8
  40. xp/cli/commands/telegram/telegram_discover_commands.py +2 -4
  41. xp/cli/commands/telegram/telegram_linknumber_commands.py +11 -8
  42. xp/cli/commands/telegram/telegram_parse_commands.py +10 -9
  43. xp/cli/commands/telegram/telegram_version_commands.py +8 -4
  44. xp/cli/main.py +5 -1
  45. xp/cli/utils/click_tree.py +23 -3
  46. xp/cli/utils/datapoint_type_choice.py +20 -0
  47. xp/cli/utils/decorators.py +165 -14
  48. xp/cli/utils/error_handlers.py +49 -18
  49. xp/cli/utils/formatters.py +95 -10
  50. xp/cli/utils/serial_number_type.py +18 -0
  51. xp/cli/utils/system_function_choice.py +20 -0
  52. xp/cli/utils/xp_module_type.py +20 -0
  53. xp/connection/__init__.py +1 -1
  54. xp/connection/exceptions.py +5 -5
  55. xp/models/__init__.py +1 -1
  56. xp/models/actiontable/__init__.py +1 -0
  57. xp/models/actiontable/actiontable.py +17 -1
  58. xp/models/actiontable/msactiontable_xp20.py +10 -0
  59. xp/models/actiontable/msactiontable_xp24.py +20 -3
  60. xp/models/actiontable/msactiontable_xp33.py +27 -4
  61. xp/models/conbus/__init__.py +1 -0
  62. xp/models/conbus/conbus.py +34 -4
  63. xp/models/conbus/conbus_autoreport.py +20 -2
  64. xp/models/conbus/conbus_blink.py +22 -2
  65. xp/models/conbus/conbus_client_config.py +22 -1
  66. xp/models/conbus/conbus_connection_status.py +16 -2
  67. xp/models/conbus/conbus_custom.py +21 -2
  68. xp/models/conbus/conbus_datapoint.py +22 -2
  69. xp/models/conbus/conbus_discover.py +18 -2
  70. xp/models/conbus/conbus_lightlevel.py +20 -2
  71. xp/models/conbus/conbus_linknumber.py +20 -2
  72. xp/models/conbus/conbus_output.py +22 -2
  73. xp/models/conbus/conbus_raw.py +17 -2
  74. xp/models/conbus/conbus_receive.py +16 -2
  75. xp/models/homekit/__init__.py +1 -0
  76. xp/models/homekit/homekit_accessory.py +15 -1
  77. xp/models/homekit/homekit_config.py +52 -0
  78. xp/models/homekit/homekit_conson_config.py +32 -0
  79. xp/models/log_entry.py +49 -9
  80. xp/models/protocol/__init__.py +1 -0
  81. xp/models/protocol/conbus_protocol.py +130 -21
  82. xp/models/telegram/__init__.py +1 -0
  83. xp/models/telegram/action_type.py +16 -2
  84. xp/models/telegram/datapoint_type.py +36 -2
  85. xp/models/telegram/event_telegram.py +46 -10
  86. xp/models/telegram/event_type.py +8 -1
  87. xp/models/telegram/input_action_type.py +34 -2
  88. xp/models/telegram/input_type.py +9 -1
  89. xp/models/telegram/module_type.py +69 -19
  90. xp/models/telegram/module_type_code.py +43 -1
  91. xp/models/telegram/output_telegram.py +30 -6
  92. xp/models/telegram/reply_telegram.py +56 -11
  93. xp/models/telegram/system_function.py +35 -3
  94. xp/models/telegram/system_telegram.py +18 -4
  95. xp/models/telegram/telegram.py +12 -3
  96. xp/models/telegram/telegram_type.py +8 -1
  97. xp/models/telegram/timeparam_type.py +27 -0
  98. xp/models/write_config_type.py +17 -2
  99. xp/services/__init__.py +1 -1
  100. xp/services/conbus/__init__.py +1 -0
  101. xp/services/conbus/actiontable/__init__.py +1 -0
  102. xp/services/conbus/actiontable/actiontable_service.py +33 -2
  103. xp/services/conbus/actiontable/msactiontable_service.py +40 -3
  104. xp/services/conbus/actiontable/msactiontable_xp24_serializer.py +36 -4
  105. xp/services/conbus/actiontable/msactiontable_xp33_serializer.py +45 -5
  106. xp/services/conbus/conbus_autoreport_get_service.py +17 -8
  107. xp/services/conbus/conbus_autoreport_set_service.py +29 -16
  108. xp/services/conbus/conbus_blink_all_service.py +40 -21
  109. xp/services/conbus/conbus_blink_service.py +37 -13
  110. xp/services/conbus/conbus_custom_service.py +29 -13
  111. xp/services/conbus/conbus_datapoint_queryall_service.py +40 -16
  112. xp/services/conbus/conbus_datapoint_service.py +33 -12
  113. xp/services/conbus/conbus_discover_service.py +43 -7
  114. xp/services/conbus/conbus_lightlevel_get_service.py +22 -14
  115. xp/services/conbus/conbus_lightlevel_set_service.py +40 -20
  116. xp/services/conbus/conbus_linknumber_get_service.py +18 -10
  117. xp/services/conbus/conbus_linknumber_set_service.py +34 -8
  118. xp/services/conbus/conbus_output_service.py +33 -13
  119. xp/services/conbus/conbus_raw_service.py +36 -16
  120. xp/services/conbus/conbus_receive_service.py +38 -6
  121. xp/services/conbus/conbus_scan_service.py +45 -19
  122. xp/services/homekit/__init__.py +1 -0
  123. xp/services/homekit/homekit_cache_service.py +31 -6
  124. xp/services/homekit/homekit_conbus_service.py +33 -2
  125. xp/services/homekit/homekit_config_validator.py +97 -15
  126. xp/services/homekit/homekit_conson_validator.py +51 -7
  127. xp/services/homekit/homekit_dimminglight.py +47 -1
  128. xp/services/homekit/homekit_dimminglight_service.py +35 -1
  129. xp/services/homekit/homekit_hap_service.py +71 -18
  130. xp/services/homekit/homekit_lightbulb.py +35 -1
  131. xp/services/homekit/homekit_lightbulb_service.py +30 -2
  132. xp/services/homekit/homekit_module_service.py +23 -1
  133. xp/services/homekit/homekit_outlet.py +47 -1
  134. xp/services/homekit/homekit_outlet_service.py +44 -2
  135. xp/services/homekit/homekit_service.py +113 -19
  136. xp/services/log_file_service.py +37 -41
  137. xp/services/module_type_service.py +26 -5
  138. xp/services/protocol/__init__.py +1 -1
  139. xp/services/protocol/conbus_protocol.py +115 -20
  140. xp/services/protocol/protocol_factory.py +40 -0
  141. xp/services/protocol/telegram_protocol.py +38 -7
  142. xp/services/reverse_proxy_service.py +79 -14
  143. xp/services/server/__init__.py +1 -0
  144. xp/services/server/base_server_service.py +102 -14
  145. xp/services/server/cp20_server_service.py +12 -4
  146. xp/services/server/server_service.py +26 -11
  147. xp/services/server/xp130_server_service.py +11 -3
  148. xp/services/server/xp20_server_service.py +11 -3
  149. xp/services/server/xp230_server_service.py +11 -3
  150. xp/services/server/xp24_server_service.py +33 -6
  151. xp/services/server/xp33_server_service.py +41 -8
  152. xp/services/telegram/__init__.py +1 -0
  153. xp/services/telegram/telegram_blink_service.py +19 -31
  154. xp/services/telegram/telegram_checksum_service.py +10 -10
  155. xp/services/telegram/telegram_discover_service.py +58 -29
  156. xp/services/telegram/telegram_link_number_service.py +27 -40
  157. xp/services/telegram/telegram_output_service.py +46 -49
  158. xp/services/telegram/telegram_service.py +41 -41
  159. xp/services/telegram/telegram_version_service.py +4 -2
  160. xp/utils/__init__.py +1 -1
  161. xp/utils/dependencies.py +0 -1
  162. xp/utils/serialization.py +6 -0
  163. xp/utils/time_utils.py +6 -11
  164. conson_xp-1.0.1.dist-info/RECORD +0 -181
  165. {conson_xp-1.0.1.dist-info → conson_xp-1.2.0.dist-info}/WHEEL +0 -0
  166. {conson_xp-1.0.1.dist-info → conson_xp-1.2.0.dist-info}/entry_points.txt +0 -0
  167. {conson_xp-1.0.1.dist-info → conson_xp-1.2.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: conson-xp
3
- Version: 1.0.1
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
@@ -0,0 +1,181 @@
1
+ conson_xp-1.2.0.dist-info/METADATA,sha256=JTKojoXqau2dvYetTThkWY_0RNIkEd6aYEyZvS_aF10,9296
2
+ conson_xp-1.2.0.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
3
+ conson_xp-1.2.0.dist-info/entry_points.txt,sha256=1OcdIcDM1hz3ljCXgybaPUh1IOFEwkaTgLIW9u9zGeg,50
4
+ conson_xp-1.2.0.dist-info/licenses/LICENSE,sha256=rxj6woMM-r3YCyGq_UHFtbh7kHTAJgrccH6O-33IDE4,1419
5
+ xp/__init__.py,sha256=4lneUikSaz2sNyKRi2wiB1O6JXvfPO_CZK-5rG6jq5g,180
6
+ xp/api/__init__.py,sha256=fCWjkuTzDlyJ8hIpU_QEBNcah3BB2bqVSfZwmP4ee5k,51
7
+ xp/api/main.py,sha256=Iih3u-T7eLRtQC0bUW6WH72k-kgfS8p85meXnJd9cC4,3738
8
+ xp/api/models/__init__.py,sha256=Xl8j2qiHc-Vb8b1ZmNZaMj7RtMvk0G_2SOvMgQumYzs,54
9
+ xp/api/models/api.py,sha256=nq70i1rhAntf7dUFAS4LrtEz4VNzP8Q-9AZD0tR7hTg,944
10
+ xp/api/models/discover.py,sha256=uKRB8JaTf1nnlgnDPtpHKYOFfTTVkG8A2GQHvoCXSEU,903
11
+ xp/api/routers/__init__.py,sha256=yVfLRQz6iw48vZF_i1cqTCrmy9gycmmmny6iG_1dM24,307
12
+ xp/api/routers/conbus.py,sha256=OUlsiAQwH5Xk38ueywvWVhD7LoTfyuUoHnqGtOF4ZCU,134
13
+ xp/api/routers/conbus_blink.py,sha256=sTAwYmF1Giw3ykoJT7BNzT0lr8eZ0e94_lGbQX2hqpw,3832
14
+ xp/api/routers/conbus_custom.py,sha256=EcnqUhVOPKCprG3PkUQQYBUI2pspNZioTqAFgltT4_o,2466
15
+ xp/api/routers/conbus_datapoint.py,sha256=v-czN-9e79kjZt0VsTUI2UNFwRwRE9VPHx9m1EMrTGA,2578
16
+ xp/api/routers/conbus_output.py,sha256=hgkwi_74kNQZGT9XHYpq6IDREXL9z8Ckz1W84ZhIzOI,5862
17
+ xp/api/routers/errors.py,sha256=jnZQ4fdLT6hb-PXwLphIuhpZtlBT8cViDG1q_IAmAEU,1316
18
+ xp/cli/__init__.py,sha256=QjnKB1KaI2aIyKlzrnvCwfbBuUj8HNgwNMvNJVQofbI,81
19
+ xp/cli/__main__.py,sha256=l2iKwMdat5rTGd3JWs-uGksnYYDDffp_Npz05QdKEeU,117
20
+ xp/cli/commands/__init__.py,sha256=_Ia9P0gK7tCeiWbuU7p8RPgvBhQx1kFC6i3b1g1UuOo,4482
21
+ xp/cli/commands/api.py,sha256=Q7IkrVRhGK8ya2aoY0R1UvifHqwUPCnQZtAvqEDne-w,293
22
+ xp/cli/commands/api_start_commands.py,sha256=qs7UVFfIfgAldu-09gCRz3VAlQNApiQNLfueDXhDTvU,3449
23
+ xp/cli/commands/conbus/__init__.py,sha256=gE3K5OEoXkkZX8UOc2v3nreQQzwkOQi7n0VZ-Z2juXA,495
24
+ xp/cli/commands/conbus/conbus.py,sha256=OTebWu-V-_1tOq2nWExPLtDuAeqy7fB7ltUqzHfgcY8,2705
25
+ xp/cli/commands/conbus/conbus_actiontable_commands.py,sha256=Jf7m0e38JCbdWD30UU_EsUVhWsm9WeGQzNvqmJttzl8,1954
26
+ xp/cli/commands/conbus/conbus_autoreport_commands.py,sha256=pvSG2OF1Iiu1lCm2G0wOU8mPo4zlvqTR1YkfXWaz5Xs,2920
27
+ xp/cli/commands/conbus/conbus_blink_commands.py,sha256=2Ke25uqhErgJOkOth4v91aIaxa9WadS2M30CY-tsf9k,4824
28
+ xp/cli/commands/conbus/conbus_config_commands.py,sha256=JY2YdQFgMNreJBPNDv5WKsqxXTxKIc0yzNrhfqvdUro,680
29
+ xp/cli/commands/conbus/conbus_custom_commands.py,sha256=4SJEIumv7AUwqpgSZg5PKbKJQ9SGozKok2cPBagCyXQ,1655
30
+ xp/cli/commands/conbus/conbus_datapoint_commands.py,sha256=cOrfFczu0edvYoarkwlfZ5OuolY5n-unoQdUgytg420,3558
31
+ xp/cli/commands/conbus/conbus_discover_commands.py,sha256=cvHHyJv5GH7v3flu1_73egiA2c343G5PBFlwwNNsFZg,1328
32
+ xp/cli/commands/conbus/conbus_lightlevel_commands.py,sha256=dLfwb1P9spxj_KSrJHTzzzSbfyG549zgNW6j7UjzfuA,5378
33
+ xp/cli/commands/conbus/conbus_linknumber_commands.py,sha256=q9QeQmerfZ4XhTLBW2icvE_dCB2jKYZrFLtKQpJciIM,2651
34
+ xp/cli/commands/conbus/conbus_msactiontable_commands.py,sha256=kgShIbsVPkAj1EUYdvU7sePV3LZKLN-an-Z5XhOTsyI,2378
35
+ xp/cli/commands/conbus/conbus_output_commands.py,sha256=Hse0IVojR7IYqJsnlqIaySqLqIfmVfS0SDsywBRaHeA,4945
36
+ xp/cli/commands/conbus/conbus_raw_commands.py,sha256=8BKUarwvHgz-sxML7n99YVsb8B1HJNExjQpRsuY_tQw,1829
37
+ xp/cli/commands/conbus/conbus_receive_commands.py,sha256=iFqb2A1MfKOBekb_0cJohTGYDwVxYzfWg9gPdHwUQ_c,1713
38
+ xp/cli/commands/conbus/conbus_scan_commands.py,sha256=JfXucOwOadvLEKT_fW9fwvqWKHaEODOojLjnO8JV_00,1730
39
+ xp/cli/commands/file_commands.py,sha256=BnHaDg1sNll8nS-0BevNt0k0dgTlInw1Sawv4Ba2nfk,5436
40
+ xp/cli/commands/homekit/__init__.py,sha256=qqwY8ulxTx1S74Mzpb6EKjBLT6fWTNdf9PQ3HKuERKY,50
41
+ xp/cli/commands/homekit/homekit.py,sha256=fiPBlE_nSndyO1ftEyTjL6xmgTh44Q3uZJEIcsf6W9I,3594
42
+ xp/cli/commands/homekit/homekit_start_commands.py,sha256=sW1Hvts5UU28FgDrQM8jtgWaBHHqVjR8vjn6DweYBNA,1080
43
+ xp/cli/commands/module_commands.py,sha256=1AmQpCqH1XhTZ6a69oESVn_SlvBzKk1p2zJrpyS-YmQ,5246
44
+ xp/cli/commands/reverse_proxy_commands.py,sha256=wrxQreOnOAfdRntVumB8YLmA4JoajqN8YvSiNPDPmak,5412
45
+ xp/cli/commands/server/__init__.py,sha256=iunDmcaax9U-SHymgGzUlPadGdZLFl9LlhXu2mnyb64,49
46
+ xp/cli/commands/server/server_commands.py,sha256=I7A8qaHL01H4JKMbaw_WTHVUCIurpZJBMR9wVJwaKhM,3877
47
+ xp/cli/commands/telegram/__init__.py,sha256=KPhwoU5uscHe3tFAxWXxgFV5OKi9bISBh_TSREnxBFQ,181
48
+ xp/cli/commands/telegram/telegram.py,sha256=6bF0RGZhWaa9vlkor5vNGvsOlj7J3YpwMowZLauUGHw,960
49
+ xp/cli/commands/telegram/telegram_blink_commands.py,sha256=_WGBRO9cHkuCYMiUbdwpRdvPl-EpOuKvE6LNY2u4fyY,2188
50
+ xp/cli/commands/telegram/telegram_checksum_commands.py,sha256=6Z8EOqzQ49eG1UBJe9x3B5HkbT_d-F6xELnmuAupy7I,3353
51
+ xp/cli/commands/telegram/telegram_discover_commands.py,sha256=0UArJinw1eWFbee5EGMNRILE-wmECMSaJjBcCuc35xc,1114
52
+ xp/cli/commands/telegram/telegram_linknumber_commands.py,sha256=7j0-E5Moqqga4NrKDch82C6glaFDFMQn5_3hMwie7BQ,2511
53
+ xp/cli/commands/telegram/telegram_parse_commands.py,sha256=_OYOso1hS4f_ox96qlkYL2SuFnmimpAvqqdYlLzX9yo,2232
54
+ xp/cli/commands/telegram/telegram_version_commands.py,sha256=WQyx1-B9yJ8V9WrFyBpOvULJ-jq12GoZZDDoRbM7eyw,1553
55
+ xp/cli/main.py,sha256=LV67RU0O1EPU0YZNwQ4i04yoeCQsis9Hxa-N8bsXnYw,2869
56
+ xp/cli/utils/__init__.py,sha256=gTGIj60Uai0iE7sr9_TtEpl04fD7krtTzbbigXUsUVU,46
57
+ xp/cli/utils/click_tree.py,sha256=ilmM2IMa_c-TqUMsv2alrZXuS0BNhvVlrBlSfyN8lzM,1670
58
+ xp/cli/utils/datapoint_type_choice.py,sha256=HcydhlqxZ7YyorEeTjFGkypF2JnYNPvOzkl1rhZ93Fc,1666
59
+ xp/cli/utils/decorators.py,sha256=iAWm75VK_opqjX2h7ATZXlMzPINhF1FeeACzukm7ldQ,10149
60
+ xp/cli/utils/error_handlers.py,sha256=zL4f6996Is0lWl8uITNqiLyPNaeW6uUbkew7BRCFi8Y,6581
61
+ xp/cli/utils/formatters.py,sha256=fl7UmX6yLypqc0_QWevgPO2L6XA2Kd_0d_GSLUV5U30,9776
62
+ xp/cli/utils/serial_number_type.py,sha256=GUs3jtVI6EVulvt6fCDN6H6vxhiJwdMmdIvLjDlGGZ4,1466
63
+ xp/cli/utils/system_function_choice.py,sha256=0J02EMgAQcsrE-9rEkv6YHelBoBkZ73T8VLBSm6YO5k,1623
64
+ xp/cli/utils/xp_module_type.py,sha256=qSFJBRceqPi_cUFPxAWtLUNq37-KwUEjo9ekYOj7kLQ,1471
65
+ xp/connection/__init__.py,sha256=ClJsVWALYZgAGYZK_Jznd3YKLrHDu17kBfwugjuPfu0,209
66
+ xp/connection/exceptions.py,sha256=7CcRUzkyay5zA6Z9-5dIDRzua806v5N7pCcJazP_1dE,365
67
+ xp/models/__init__.py,sha256=wCyJNKBd8J2ziOm0g00eUZH4OeTaLO5vHuoQGd_AJbg,1111
68
+ xp/models/actiontable/__init__.py,sha256=6kVq1rTOlpc24sZxGGVWkY48tqR42YWHLQHqakWqlPc,43
69
+ xp/models/actiontable/actiontable.py,sha256=D24fftW51fYhz03LzTy21KJLoFLE7KaC6bgiiQcjQRY,1255
70
+ xp/models/actiontable/msactiontable_xp20.py,sha256=C_lYYIQagEFap0S5S40_S7AhLO2UZG2EmXjjeem7uw8,1967
71
+ xp/models/actiontable/msactiontable_xp24.py,sha256=hugTkpEfiFwzLNU2xCJgpRtTXglpYG_wC_dRdYCAog4,2093
72
+ xp/models/actiontable/msactiontable_xp33.py,sha256=2IEA0CBPvnatOueBPZiV0DPc7YFzTQIqIMqed8TKXeM,1932
73
+ xp/models/conbus/__init__.py,sha256=VIusMWQdBtlwDgj7oSj06wQkklihTp4oWFShvP_JUgA,35
74
+ xp/models/conbus/conbus.py,sha256=mZQzKPfrdttT-qUnYUSyrEYyc_eHs8z301E5ejeiyvk,2689
75
+ xp/models/conbus/conbus_autoreport.py,sha256=lKotDfxRBb7h2Z1d4qI3KhhLJhFDwKqLbSdG5Makm8Y,2289
76
+ xp/models/conbus/conbus_blink.py,sha256=XEAPtA-O76ulX6Zh1oYzsWF6L4css6xJBuUTwNcDQKc,2911
77
+ xp/models/conbus/conbus_client_config.py,sha256=fWPmHM-OVUzSASKq667JzP7e9_Qp9ZUyYcTaijWkVlY,1484
78
+ xp/models/conbus/conbus_connection_status.py,sha256=iGbmtBaAMwV6UD7XG3H3tnB0fl2MR8rJhpjrLH2KjsE,1097
79
+ xp/models/conbus/conbus_custom.py,sha256=8H2sPR6_LIlksuOvL7-8bPkzAJLR0rpYiiwfYYFVjEo,1965
80
+ xp/models/conbus/conbus_datapoint.py,sha256=JOdztERFMyeJd5-UySIc9A2D8z9KujEDSgyTSRn7Rm0,3275
81
+ xp/models/conbus/conbus_discover.py,sha256=oYIHLLsXmgSQHrayS-JgcEpEaK_01Q1WTQEQj79h4j4,1642
82
+ xp/models/conbus/conbus_lightlevel.py,sha256=GQGhzrCBEJROosNHInXIzBy6MD2AskEIMoFEGgZ60-0,1695
83
+ xp/models/conbus/conbus_linknumber.py,sha256=uFzKzfB06oIzZEKCb5X2JEI80JjMPFuYglsT1W1k8j4,1815
84
+ xp/models/conbus/conbus_output.py,sha256=q7QKsD_CWT7YOk-V3otKWD1VM7qThrSLIUOunntMrMc,1953
85
+ xp/models/conbus/conbus_raw.py,sha256=xqvYao6IE1SXum7JBgZpSuWXm9x_QZquS9N_3_r0Hjs,1460
86
+ xp/models/conbus/conbus_receive.py,sha256=-1u1qK-texfKCNZV-GYf_9KyLtJdIrx7HuZsKzu26Ow,1322
87
+ xp/models/homekit/__init__.py,sha256=5HDSOClCu0ArK3IICn3_LDMMLBAzLjBxUUSF73bxSSk,34
88
+ xp/models/homekit/homekit_accessory.py,sha256=NsHFhskuxIdJpF9-MvXHtjkLYvNHmSGFOy0GmQv3PY4,1038
89
+ xp/models/homekit/homekit_config.py,sha256=Y1WwrbISRtJOkKVBnXQULb3vAOzcOdt95hBAI8cM_MU,2771
90
+ xp/models/homekit/homekit_conson_config.py,sha256=S8DbFVV6qL99M8sQlvY4nbb5JC-CeSKdxOJ5WyJ8pnI,1972
91
+ xp/models/log_entry.py,sha256=kPcYuAirCXugfL3YkOK9cQVlkNWxG_8a4AVuhsykHL0,4355
92
+ xp/models/protocol/__init__.py,sha256=TJ_CJKchA-xgQiv5vCo_ndBBZjrcaTmjT74bR0T-5Cw,38
93
+ xp/models/protocol/conbus_protocol.py,sha256=tSnI5pxBTP_f1DUzEM3XbyjK7vsqwm0gpzHIH1gTg8E,8854
94
+ xp/models/response.py,sha256=h6_B1k_v6IrWhgNWBohEGQGRCp5TcVhgQ3RJS8gTkhY,1230
95
+ xp/models/telegram/__init__.py,sha256=-_exhjlRLbBNuPxHC4tLA2SAgf8M0yHJMeyEoQIk9PI,53
96
+ xp/models/telegram/action_type.py,sha256=vkw_chTgmsadksGXvZ9D_qYGpjOwCw-OgbEi8Bml17g,783
97
+ xp/models/telegram/datapoint_type.py,sha256=clmgqCsTNKuHmWN6ol2Hwj_71I10f36Oq-S5D5ZA9a8,2942
98
+ xp/models/telegram/event_telegram.py,sha256=FCCfyZXQEUPB6Uo1m7B9nvFCJ0Ipv2CApmImAZo_Xa4,4689
99
+ xp/models/telegram/event_type.py,sha256=VZhaDpey7KYWnmwN-gstj-r4Vd5hiGdzQuRazUdixB8,333
100
+ xp/models/telegram/input_action_type.py,sha256=jELnLL10CilKp19r1-IUn4v3pHXvIGefChC6ln3nJOM,1874
101
+ xp/models/telegram/input_type.py,sha256=X3AcKKMNHswNZs5xgT_AnxeKQpSx_U7ctGnr6AYqNoU,491
102
+ xp/models/telegram/module_type.py,sha256=TdrcQC3UcdESzyUmS9PaVeJuF5VxH1WUtDWdf4QRA50,5223
103
+ xp/models/telegram/module_type_code.py,sha256=bg8Zi58yKs5DDnEF0bGnZ9vvpqzmIZzd1k9Wu4ufB-Y,8177
104
+ xp/models/telegram/output_telegram.py,sha256=vTSdeAGk7va89pZ8-oh0cna98N3T6if-6UcrstWsN6s,3473
105
+ xp/models/telegram/reply_telegram.py,sha256=oqNwDvaOhFTPuXL0fP9Ca3rbcKepDhRz9kIneKCk6n0,10376
106
+ xp/models/telegram/system_function.py,sha256=Iv9u4sYCPnMcvlpbBrNNxu0NpUOFsi5kPgT2vrelbVw,3266
107
+ xp/models/telegram/system_telegram.py,sha256=oYW9xfY4ldlid0XQ5D5ymk0-a9Jvr5EHD9O4Cb6JOPk,3192
108
+ xp/models/telegram/telegram.py,sha256=IJUxHX6ftLcET9C1pjvLhUO5Db5JO6W7rUItzdEW30I,842
109
+ xp/models/telegram/telegram_type.py,sha256=GhqKP63oNMyh2tIvCPcsC5RFp4s4JjhmEqCLCC-8XMk,423
110
+ xp/models/telegram/timeparam_type.py,sha256=Ar8xvSfPmOAgR2g2Je0FgvP01SL7bPvZn5_HrVDpmJM,1137
111
+ xp/models/write_config_type.py,sha256=T2RaO52RpzoJ4782uMHE-fX7Ymx3CaIQAEwByydXq1M,881
112
+ xp/services/__init__.py,sha256=W9YZyrkh7vm--ZHhAXNQiOYQs5yhhmUHXP5I0Lf1XBg,782
113
+ xp/services/conbus/__init__.py,sha256=Hi35sMKu9o6LpYoi2tQDaQoMb8M5sOt_-LUTxxaCU_0,28
114
+ xp/services/conbus/actiontable/__init__.py,sha256=oD6vRk_Ye-eZ9s_hldAgtRJFu4mfAnODqpkJUGHHszk,40
115
+ xp/services/conbus/actiontable/actiontable_serializer.py,sha256=x45-8d5Ba9l3hX2TFC5nqKv-g_244g-VTWhXvVXL8Jg,5159
116
+ xp/services/conbus/actiontable/actiontable_service.py,sha256=QJwROShPU7uoexB9GxT6if8u8Cfa8yJO3WJqAHNjqMY,5633
117
+ xp/services/conbus/actiontable/msactiontable_service.py,sha256=u64nejKvHzMdmlK9VoM7P3uMGIfjyfo2xp9dXXlgvjc,7451
118
+ xp/services/conbus/actiontable/msactiontable_xp20_serializer.py,sha256=EYspooOdi0Z8oaXGxpazwnUoTmh-d7U9auhu11iBgmU,6527
119
+ xp/services/conbus/actiontable/msactiontable_xp24_serializer.py,sha256=30qsk9UKje1n32PPc4YoGV1lw_ZvgxNqqd8ZDgzMJpg,4504
120
+ xp/services/conbus/actiontable/msactiontable_xp33_serializer.py,sha256=nuWfka4U9W4lpTcS8uD6azXFcryPb0CUO5O7Z28G1k8,8901
121
+ xp/services/conbus/conbus_autoreport_get_service.py,sha256=uuMe4JAGgkJXiYozo2GRq8_jEuVkxWvg-YNhznZbIIc,3485
122
+ xp/services/conbus/conbus_autoreport_set_service.py,sha256=OHvMnzfSooW5wQa-KiVu9jdOpjR_O006nChJyMAuzS8,5310
123
+ xp/services/conbus/conbus_blink_all_service.py,sha256=OaEg4b8AEiEruHSkZ5jDtaoI81vwwxLq4KWXO7zBdD0,6582
124
+ xp/services/conbus/conbus_blink_service.py,sha256=x9uM-sLnIEV8wSNsvJgo08E042g-Hh2ZF3rXkz-k_9s,5824
125
+ xp/services/conbus/conbus_custom_service.py,sha256=4aneYdPObiZOGxPFYg5Wr70cl_xFxlQIdJBPQSa0enI,5826
126
+ xp/services/conbus/conbus_datapoint_queryall_service.py,sha256=p9R02cVimhdJILHQ6BoeZj8Hog4oRpqBnMo3t4R8ecY,6816
127
+ xp/services/conbus/conbus_datapoint_service.py,sha256=0o26m5yVT-NE6p0oxOiE337oHuQCnx3T8AmU-A9IRjs,6225
128
+ xp/services/conbus/conbus_discover_service.py,sha256=0rdGLZfi-gsjBeuFiUwGz0tUC85hbZUDxJ93ImBmq4U,5239
129
+ xp/services/conbus/conbus_lightlevel_get_service.py,sha256=A6wcA9UYIR3jq5dKf0a_WMKDkou4ydIeMJOCsxerEls,4018
130
+ xp/services/conbus/conbus_lightlevel_set_service.py,sha256=ufYwSc-r6Ethy1gew6QxzWa6IZmzd5iMksLsrgCGvJc,8086
131
+ xp/services/conbus/conbus_linknumber_get_service.py,sha256=O7Gbl8bOfldbZDoOEmeKFpXhHSkzfK0cB31Eer10E0I,3529
132
+ xp/services/conbus/conbus_linknumber_set_service.py,sha256=8_eQcBDSDwJB-TyggahWYtaFBufliioF-VI63JeD3ss,6786
133
+ xp/services/conbus/conbus_output_service.py,sha256=mHFOAPx2zo0TStZ3pokp6v94AQjIamcwZDeg5YH_-eo,7240
134
+ xp/services/conbus/conbus_raw_service.py,sha256=4yZLLTIAOxpgByUTWZXw1ihGa6Xtl98ckj9T7VfprDI,4335
135
+ xp/services/conbus/conbus_receive_service.py,sha256=frXrS0OyKKvYYQTWdma21Kd0BKw5aSuHn3ZXTTqOaj0,3953
136
+ xp/services/conbus/conbus_scan_service.py,sha256=43Bhj7pVDOjIS2MdlD7iDvNK7Gy5KxX1qB8hiTwY5LQ,5186
137
+ xp/services/homekit/__init__.py,sha256=xAMKmln_AmEFdOOJGKWYi96seRlKDQpKx3-hm7XbdIo,36
138
+ xp/services/homekit/homekit_cache_service.py,sha256=NdijyH5_iyhsTHBb-OyT8Y2xnNDj8F5MP8neoVQ26hY,11010
139
+ xp/services/homekit/homekit_conbus_service.py,sha256=EYhYqGISPxUB6QrMDLWRPOA4S8f9AgJf0D_BKqXlGLA,3482
140
+ xp/services/homekit/homekit_config_validator.py,sha256=1jCUrfMUqthEoNc7wAk4io1PpbptqgsdnCOCzz62Io8,10732
141
+ xp/services/homekit/homekit_conson_validator.py,sha256=V_Otxu0q3LK-3GP3-Zw0nZyV_rb9RjHp4tWcvzYJeGs,3787
142
+ xp/services/homekit/homekit_dimminglight.py,sha256=O5SwnhkrJQHm7BopI9nL9QcfRSokcxn-H4csZMg0B5c,5770
143
+ xp/services/homekit/homekit_dimminglight_service.py,sha256=lxFE2k8a8V9YQwpWPAAmbUvYD3zDlVa337xzDQl6tjM,5231
144
+ xp/services/homekit/homekit_hap_service.py,sha256=YrFe10XPBf6EC2SRnWmcCbjdVkrHjxSNPwYDPVvQiDQ,12527
145
+ xp/services/homekit/homekit_lightbulb.py,sha256=7HGMIPwEcmvSs89ENcDhdb8g0R9WMq7115gYuwcskAs,3661
146
+ xp/services/homekit/homekit_lightbulb_service.py,sha256=pyRyxrNQqTW79rmGagItNpz7AMXTbBQL_l1o5VXTRn8,2652
147
+ xp/services/homekit/homekit_module_service.py,sha256=7lanEinxAfTdn28ZHV-O5YyTqq_3v8FIyP2FI0jsEQM,1526
148
+ xp/services/homekit/homekit_outlet.py,sha256=_Glfytfmvydz9TEn69N6bw3Ux0Y-EMw2eJPgeborkoA,5268
149
+ xp/services/homekit/homekit_outlet_service.py,sha256=mDvSv9_69Z6jGUBHixmBm7giDCVYtLOWtMZqYjBgUdE,3698
150
+ xp/services/homekit/homekit_service.py,sha256=0lW-hg40ETco3gDBEYkR_sX-UIYsLSKCD4NWruLXUM8,14031
151
+ xp/services/log_file_service.py,sha256=fvPcZQj8XOKUA-4ep5R8n0PelvwvRlTLlVxvIWM5KR4,10506
152
+ xp/services/module_type_service.py,sha256=xWhr1EAZMykL5uNWHWdpa5T8yNruGKH43XRTOS8GwZg,7477
153
+ xp/services/protocol/__init__.py,sha256=WuYn2iEcvsOIXnn5HCrU9kD3PjuMX1sIh0ljKISDoJw,720
154
+ xp/services/protocol/conbus_protocol.py,sha256=G39YPMpwhvvhFPYrzNxx6y2Is6DSP2UyCLm4T7RLPVc,10404
155
+ xp/services/protocol/protocol_factory.py,sha256=PmjN9AtW9sxNo3voqUiNgQA-pTvX1RW4XXFlHKfFr5Q,2470
156
+ xp/services/protocol/telegram_protocol.py,sha256=JKYxGbO2h3muIroYPYxS7An_BNfriXKLf3u0gdN_KnQ,9462
157
+ xp/services/reverse_proxy_service.py,sha256=BUOlcLlTU-R5iuC_96rasug21xo19wK9_4fMQXxc0QM,15061
158
+ xp/services/server/__init__.py,sha256=QEcCj-jK0goAukJCe15TKYFQfSAzWsduPT_wW0HxZU8,48
159
+ xp/services/server/base_server_service.py,sha256=HQKx4DW6lJ25dGofjaB_3HHPvEZGbL1XeQ20wU5k_z0,8755
160
+ xp/services/server/cp20_server_service.py,sha256=AQhfHBqXQsVL5emkXfSLdjlKaAIWtXXKqyxYNKNKWpQ,1624
161
+ xp/services/server/server_service.py,sha256=4lhd8feL7eRR5GZIiuag51z5W20KlGRrIGICgvOXwAQ,12459
162
+ xp/services/server/xp130_server_service.py,sha256=QbkOykAdYqSSOeI7uq3g-qy1zlXSB9mjWBfRz1esPis,1764
163
+ xp/services/server/xp20_server_service.py,sha256=w8LF6vl6jNeKKlrUVdv-2Tk1qq9DMfe40PiPps6kq84,1374
164
+ xp/services/server/xp230_server_service.py,sha256=n8eqmyWWVYVuLl-N3gu1zA0-Viifyo5VyMrGXLcvpgc,1388
165
+ xp/services/server/xp24_server_service.py,sha256=ygYym0oCzmHaVwDbl-XAZYyFlLLwyycMAO8g8D1q2iU,3806
166
+ xp/services/server/xp33_server_service.py,sha256=qswOUv3YS5pT6rDoony49EC-MFKJZKPo7DI3fKG74ts,6307
167
+ xp/services/telegram/__init__.py,sha256=kv0JgMg13Fp18WgGQpalNRAWwiWbrz18X4kZAP9xpSQ,48
168
+ xp/services/telegram/telegram_blink_service.py,sha256=Xctc9mCSZiiW1YTh8cA-4jlc8fTioS5OxT6ymhSqiYI,4487
169
+ xp/services/telegram/telegram_checksum_service.py,sha256=rp_C5PlraOOIyqZDp9XjBBNZLUeBLdQNNHVpN6D-1v8,4729
170
+ xp/services/telegram/telegram_discover_service.py,sha256=oTpiq-yzP_UmC0xVOMMFeHO-rIlK1pF3aG-Kq4SeiBI,9025
171
+ xp/services/telegram/telegram_link_number_service.py,sha256=1_c-_QCRPTHYn3BmMElrBJqGG6vnoIst8CB-N42hazk,6862
172
+ xp/services/telegram/telegram_output_service.py,sha256=UaUv_14fR8o5K2PxQBXrCzx-Hohnk-gzbev_oLw_Clc,10799
173
+ xp/services/telegram/telegram_service.py,sha256=CQKmwV0Jmlr1WwrshaANyp_e77DjBzXzuFL1U5DRgFI,13092
174
+ xp/services/telegram/telegram_version_service.py,sha256=M5HdOTsLdcwo122FP-jW6R740ktLrtKf2TiMDVz23h8,10528
175
+ xp/utils/__init__.py,sha256=_avMF_UOkfR3tNeDIPqQ5odmbq5raKkaq1rZ9Cn1CJs,332
176
+ xp/utils/checksum.py,sha256=HDpiQxmdIedbCbZ4o_Box0i_Zig417BtCV_46ZyhiTk,1711
177
+ xp/utils/dependencies.py,sha256=jD0mj0ruJvSdypNQzp3ShLiRFVMfflI__Ip3inVYHSE,19601
178
+ xp/utils/event_helper.py,sha256=W-A_xmoXlpWZBbJH6qdaN50o3-XrwFsDgvAGMJDiAgo,1001
179
+ xp/utils/serialization.py,sha256=RWHHk86feaB4ZP7rjE4qOWK0900yg2joUBDkP76gfOY,4618
180
+ xp/utils/time_utils.py,sha256=dEyViDlAG9GWU-J3D_YVa-sGma6yiyyMTgN4h2x3PY4,3781
181
+ conson_xp-1.2.0.dist-info/RECORD,,
xp/__init__.py CHANGED
@@ -1,8 +1,9 @@
1
- """XP CLI tool for remote console bus operations"""
1
+ """XP CLI tool for remote console bus operations.
2
2
 
3
- """conson-xp"""
3
+ conson-xp package.
4
+ """
4
5
 
5
- __version__ = "1.0.1"
6
+ __version__ = "1.2.0"
6
7
  __manufacturer__ = "salchichon"
7
8
  __model__ = "xp.cli"
8
9
  __serial__ = "2025.09.23.000"
xp/api/main.py CHANGED
@@ -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"],
xp/api/models/api.py CHANGED
@@ -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")
xp/api/models/discover.py CHANGED
@@ -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
 
xp/api/routers/errors.py CHANGED
@@ -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
 
xp/cli/__init__.py CHANGED
@@ -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,
xp/cli/commands/api.py CHANGED
@@ -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(