conson-xp 0.11.21__tar.gz → 1.0.1__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 (287) hide show
  1. {conson_xp-0.11.21 → conson_xp-1.0.1}/PKG-INFO +1 -1
  2. {conson_xp-0.11.21 → conson_xp-1.0.1}/pyproject.toml +1 -1
  3. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/__init__.py +1 -1
  4. conson_xp-1.0.1/src/xp/cli/commands/conbus/conbus_config_commands.py +24 -0
  5. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_linknumber_commands.py +24 -11
  6. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_output_commands.py +44 -18
  7. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus.py +12 -11
  8. conson_xp-1.0.1/src/xp/services/conbus/conbus_autoreport_get_service.py +85 -0
  9. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/conbus_datapoint_service.py +6 -1
  10. conson_xp-1.0.1/src/xp/services/conbus/conbus_lightlevel_get_service.py +101 -0
  11. conson_xp-1.0.1/src/xp/services/conbus/conbus_linknumber_get_service.py +86 -0
  12. conson_xp-0.11.21/src/xp/services/conbus/conbus_autoreport_get_service.py → conson_xp-1.0.1/src/xp/services/conbus/conbus_linknumber_set_service.py +64 -45
  13. conson_xp-1.0.1/src/xp/services/conbus/conbus_output_service.py +174 -0
  14. conson_xp-1.0.1/src/xp/services/conbus/conbus_scan_service.py +124 -0
  15. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/protocol/conbus_protocol.py +1 -0
  16. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/utils/dependencies.py +21 -44
  17. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_conbus_linknumber_integration.py +30 -24
  18. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_conbus.py +18 -11
  19. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_conbus_linknumber_service.py +44 -47
  20. conson_xp-0.11.21/src/xp/cli/commands/conbus/conbus_config_commands.py +0 -33
  21. conson_xp-0.11.21/src/xp/services/conbus/conbus_connection_pool.py +0 -148
  22. conson_xp-0.11.21/src/xp/services/conbus/conbus_lightlevel_get_service.py +0 -149
  23. conson_xp-0.11.21/src/xp/services/conbus/conbus_linknumber_service.py +0 -197
  24. conson_xp-0.11.21/src/xp/services/conbus/conbus_output_service.py +0 -137
  25. conson_xp-0.11.21/src/xp/services/conbus/conbus_scan_service.py +0 -128
  26. conson_xp-0.11.21/src/xp/services/conbus/conbus_service.py +0 -306
  27. conson_xp-0.11.21/tests/unit/test_services/test_conbus_datapoint_service.py +0 -234
  28. conson_xp-0.11.21/tests/unit/test_services/test_conbus_service.py +0 -104
  29. conson_xp-0.11.21/tests/unit/test_utils/test_dependencies.py +0 -232
  30. {conson_xp-0.11.21 → conson_xp-1.0.1}/LICENSE +0 -0
  31. {conson_xp-0.11.21 → conson_xp-1.0.1}/README.md +0 -0
  32. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/__init__.py +0 -0
  33. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/main.py +0 -0
  34. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/models/__init__.py +0 -0
  35. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/models/api.py +0 -0
  36. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/models/discover.py +0 -0
  37. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/routers/__init__.py +0 -0
  38. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/routers/conbus.py +0 -0
  39. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/routers/conbus_blink.py +0 -0
  40. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/routers/conbus_custom.py +0 -0
  41. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/routers/conbus_datapoint.py +0 -0
  42. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/routers/conbus_output.py +0 -0
  43. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/routers/errors.py +0 -0
  44. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/__init__.py +0 -0
  45. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/__main__.py +0 -0
  46. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/__init__.py +0 -0
  47. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/api.py +0 -0
  48. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/api_start_commands.py +0 -0
  49. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/__init__.py +0 -0
  50. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus.py +0 -0
  51. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_actiontable_commands.py +0 -0
  52. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_autoreport_commands.py +0 -0
  53. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_blink_commands.py +0 -0
  54. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_custom_commands.py +0 -0
  55. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_datapoint_commands.py +0 -0
  56. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_discover_commands.py +0 -0
  57. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_lightlevel_commands.py +0 -0
  58. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_msactiontable_commands.py +0 -0
  59. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_raw_commands.py +0 -0
  60. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_receive_commands.py +0 -0
  61. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_scan_commands.py +0 -0
  62. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/file_commands.py +0 -0
  63. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/homekit/__init__.py +0 -0
  64. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/homekit/homekit.py +0 -0
  65. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/homekit/homekit_start_commands.py +0 -0
  66. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/module_commands.py +0 -0
  67. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/reverse_proxy_commands.py +0 -0
  68. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/server/__init__.py +0 -0
  69. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/server/server_commands.py +0 -0
  70. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/telegram/__init__.py +0 -0
  71. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/telegram/telegram.py +0 -0
  72. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/telegram/telegram_blink_commands.py +0 -0
  73. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/telegram/telegram_checksum_commands.py +0 -0
  74. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/telegram/telegram_discover_commands.py +0 -0
  75. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/telegram/telegram_linknumber_commands.py +0 -0
  76. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/telegram/telegram_parse_commands.py +0 -0
  77. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/telegram/telegram_version_commands.py +0 -0
  78. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/main.py +0 -0
  79. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/utils/__init__.py +0 -0
  80. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/utils/click_tree.py +0 -0
  81. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/utils/datapoint_type_choice.py +0 -0
  82. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/utils/decorators.py +0 -0
  83. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/utils/error_handlers.py +0 -0
  84. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/utils/formatters.py +0 -0
  85. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/utils/serial_number_type.py +0 -0
  86. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/utils/system_function_choice.py +0 -0
  87. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/utils/xp_module_type.py +0 -0
  88. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/connection/__init__.py +0 -0
  89. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/connection/exceptions.py +0 -0
  90. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/__init__.py +0 -0
  91. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/actiontable/__init__.py +0 -0
  92. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/actiontable/actiontable.py +0 -0
  93. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/actiontable/msactiontable_xp20.py +0 -0
  94. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/actiontable/msactiontable_xp24.py +0 -0
  95. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/actiontable/msactiontable_xp33.py +0 -0
  96. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/__init__.py +0 -0
  97. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_autoreport.py +0 -0
  98. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_blink.py +0 -0
  99. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_client_config.py +0 -0
  100. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_connection_status.py +0 -0
  101. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_custom.py +0 -0
  102. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_datapoint.py +0 -0
  103. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_discover.py +0 -0
  104. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_lightlevel.py +0 -0
  105. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_linknumber.py +1 -1
  106. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_output.py +0 -0
  107. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_raw.py +0 -0
  108. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_receive.py +0 -0
  109. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/homekit/__init__.py +0 -0
  110. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/homekit/homekit_accessory.py +0 -0
  111. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/homekit/homekit_config.py +0 -0
  112. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/homekit/homekit_conson_config.py +0 -0
  113. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/log_entry.py +0 -0
  114. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/protocol/__init__.py +0 -0
  115. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/protocol/conbus_protocol.py +0 -0
  116. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/response.py +0 -0
  117. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/__init__.py +0 -0
  118. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/action_type.py +0 -0
  119. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/datapoint_type.py +0 -0
  120. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/event_telegram.py +0 -0
  121. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/event_type.py +0 -0
  122. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/input_action_type.py +0 -0
  123. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/input_type.py +0 -0
  124. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/module_type.py +0 -0
  125. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/module_type_code.py +0 -0
  126. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/output_telegram.py +0 -0
  127. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/reply_telegram.py +0 -0
  128. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/system_function.py +0 -0
  129. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/system_telegram.py +0 -0
  130. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/telegram.py +0 -0
  131. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/telegram_type.py +0 -0
  132. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/timeparam_type.py +0 -0
  133. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/write_config_type.py +0 -0
  134. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/__init__.py +0 -0
  135. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/__init__.py +0 -0
  136. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/actiontable/__init__.py +0 -0
  137. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/actiontable/actiontable_serializer.py +0 -0
  138. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/actiontable/actiontable_service.py +0 -0
  139. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/actiontable/msactiontable_service.py +0 -0
  140. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/actiontable/msactiontable_xp20_serializer.py +0 -0
  141. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/actiontable/msactiontable_xp24_serializer.py +0 -0
  142. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/actiontable/msactiontable_xp33_serializer.py +0 -0
  143. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/conbus_autoreport_set_service.py +0 -0
  144. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/conbus_blink_all_service.py +0 -0
  145. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/conbus_blink_service.py +0 -0
  146. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/conbus_custom_service.py +0 -0
  147. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/conbus_datapoint_queryall_service.py +0 -0
  148. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/conbus_discover_service.py +0 -0
  149. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/conbus_lightlevel_set_service.py +0 -0
  150. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/conbus_raw_service.py +0 -0
  151. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/conbus_receive_service.py +0 -0
  152. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/__init__.py +0 -0
  153. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_cache_service.py +0 -0
  154. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_conbus_service.py +0 -0
  155. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_config_validator.py +0 -0
  156. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_conson_validator.py +0 -0
  157. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_dimminglight.py +0 -0
  158. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_dimminglight_service.py +0 -0
  159. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_hap_service.py +0 -0
  160. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_lightbulb.py +0 -0
  161. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_lightbulb_service.py +0 -0
  162. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_module_service.py +0 -0
  163. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_outlet.py +0 -0
  164. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_outlet_service.py +0 -0
  165. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_service.py +0 -0
  166. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/log_file_service.py +0 -0
  167. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/module_type_service.py +0 -0
  168. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/protocol/__init__.py +0 -0
  169. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/protocol/protocol_factory.py +0 -0
  170. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/protocol/telegram_protocol.py +0 -0
  171. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/reverse_proxy_service.py +0 -0
  172. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/server/__init__.py +0 -0
  173. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/server/base_server_service.py +0 -0
  174. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/server/cp20_server_service.py +0 -0
  175. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/server/server_service.py +0 -0
  176. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/server/xp130_server_service.py +0 -0
  177. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/server/xp20_server_service.py +0 -0
  178. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/server/xp230_server_service.py +0 -0
  179. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/server/xp24_server_service.py +0 -0
  180. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/server/xp33_server_service.py +0 -0
  181. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/telegram/__init__.py +0 -0
  182. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/telegram/telegram_blink_service.py +0 -0
  183. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/telegram/telegram_checksum_service.py +0 -0
  184. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/telegram/telegram_discover_service.py +0 -0
  185. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/telegram/telegram_link_number_service.py +0 -0
  186. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/telegram/telegram_output_service.py +0 -0
  187. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/telegram/telegram_service.py +0 -0
  188. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/telegram/telegram_version_service.py +0 -0
  189. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/utils/__init__.py +0 -0
  190. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/utils/checksum.py +0 -0
  191. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/utils/event_helper.py +0 -0
  192. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/utils/serialization.py +0 -0
  193. {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/utils/time_utils.py +0 -0
  194. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/.coverage +0 -0
  195. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/__init__.py +0 -0
  196. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/conftest.py +0 -0
  197. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/.coverage +0 -0
  198. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/__init__.py +0 -0
  199. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/telegram_test_data.py +0 -0
  200. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_actiontable_integration.py +0 -0
  201. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_api/.coverage +0 -0
  202. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_api/__init__.py +0 -0
  203. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_blink_integration.py +0 -0
  204. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_checksum_integration.py +0 -0
  205. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_conbus_autoreport_integration.py +0 -0
  206. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_conbus_blink_integration.py +0 -0
  207. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_conbus_datapoint_integration.py +0 -0
  208. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_conbus_lightlevel_integration.py +0 -0
  209. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_conbus_raw_integration.py +0 -0
  210. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_conbus_receive_integration.py +0 -0
  211. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_discovery_integration.py +0 -0
  212. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_event_telegram_integration.py +0 -0
  213. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_homekit_config_integration.py +0 -0
  214. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_link_number_integration.py +0 -0
  215. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_module_integration.py +0 -0
  216. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_output_integration.py +0 -0
  217. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_reverse_proxy_integration.py +0 -0
  218. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_system_reply_telegram_integration.py +0 -0
  219. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_version_integration.py +0 -0
  220. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_xp20_action_table_integration.py +0 -0
  221. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_xp24_action_table_integration.py +0 -0
  222. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/__init__.py +0 -0
  223. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_api/__init__.py +0 -0
  224. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_cli/__init__.py +0 -0
  225. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_cli/test_click_tree.py +0 -0
  226. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_cli/test_conbus_actiontable_commands.py +0 -0
  227. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_cli/test_conbus_blink_commands.py +0 -0
  228. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_cli/test_datapoint_type_choice.py +0 -0
  229. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_cli/test_decorators.py +0 -0
  230. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_cli/test_error_handlers.py +0 -0
  231. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_cli/test_formatters.py +0 -0
  232. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_cli/test_serial_number_type.py +0 -0
  233. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_cli/test_system_function_choice.py +0 -0
  234. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_connection/__init__.py +0 -0
  235. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_connection/test_connection_init.py +0 -0
  236. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_connection/test_exceptions.py +0 -0
  237. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_encoding/__init__.py +0 -0
  238. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_encoding/test_latin1_edge_cases.py +0 -0
  239. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/__init__.py +0 -0
  240. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_conbus_client_send.py +0 -0
  241. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_conbus_discover.py +0 -0
  242. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_conbus_linknumber.py +0 -0
  243. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_event_telegram.py +0 -0
  244. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_log_entry.py +0 -0
  245. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_module_type.py +0 -0
  246. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_reply_telegram.py +0 -0
  247. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_system_telegram.py +0 -0
  248. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_system_telegram_enhancements.py +0 -0
  249. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_version_telegram.py +0 -0
  250. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_write_config_type.py +0 -0
  251. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_xp20_action_table.py +0 -0
  252. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_xp24_action_table.py +0 -0
  253. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_xp24_action_telegram.py +0 -0
  254. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/__init__.py +0 -0
  255. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_actiontable_service.py +0 -0
  256. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_base_server_service.py +0 -0
  257. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_blink_service.py +0 -0
  258. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_checksum_service.py +0 -0
  259. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_conbus_blink_service.py +0 -0
  260. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_conbus_lightlevel_service.py +0 -0
  261. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_conbus_raw_service.py +0 -0
  262. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_conbus_reverse_proxy_service.py +0 -0
  263. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_discovery_service.py +0 -0
  264. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_homekit_cache_service.py +0 -0
  265. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_homekit_config_validator.py +0 -0
  266. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_homekit_conson_service.py +0 -0
  267. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_homekit_services.py +0 -0
  268. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_link_number_service.py +0 -0
  269. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_log_file_service.py +0 -0
  270. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_module_type_service.py +0 -0
  271. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_protocol.py +0 -0
  272. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_server_service.py +0 -0
  273. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_telegram_input_service.py +0 -0
  274. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_telegram_protocol.py +0 -0
  275. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_telegram_service.py +0 -0
  276. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_version_service.py +0 -0
  277. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_xp20_action_table_serializer.py +0 -0
  278. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_xp24_action_service.py +0 -0
  279. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_xp24_action_table_serializer.py +0 -0
  280. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_xp24_action_table_service.py +0 -0
  281. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_xp33_action_table_serializer.py +0 -0
  282. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_xp_server_services.py +0 -0
  283. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_utils/__init__.py +0 -0
  284. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_utils/test_checksum.py +0 -0
  285. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_utils/test_event_helper.py +0 -0
  286. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_utils/test_serialization.py +0 -0
  287. {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_utils/test_time_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: conson-xp
3
- Version: 0.11.21
3
+ Version: 1.0.1
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 = "0.11.21"
23
+ version = "1.0.1"
24
24
 
25
25
  [project.license]
26
26
  file = "LICENSE"
@@ -2,7 +2,7 @@
2
2
 
3
3
  """conson-xp"""
4
4
 
5
- __version__ = "0.11.21"
5
+ __version__ = "1.0.1"
6
6
  __manufacturer__ = "salchichon"
7
7
  __model__ = "xp.cli"
8
8
  __serial__ = "2025.09.23.000"
@@ -0,0 +1,24 @@
1
+ import json
2
+
3
+ import click
4
+ from click import Context
5
+
6
+ from xp.cli.commands.conbus.conbus import conbus
7
+ from xp.cli.utils.decorators import handle_service_errors
8
+ from xp.models import ConbusClientConfig
9
+
10
+
11
+ @conbus.command("config")
12
+ @click.pass_context
13
+ @handle_service_errors(Exception)
14
+ def show_config(ctx: Context) -> None:
15
+ """
16
+ Display current Conbus client configuration.
17
+
18
+ Examples:
19
+
20
+ \b
21
+ xp conbus config
22
+ """
23
+ config = ctx.obj.get("container").get_container().resolve(ConbusClientConfig)
24
+ click.echo(json.dumps(config.conbus.model_dump(mode="json"), indent=2))
@@ -7,11 +7,11 @@ import click
7
7
  from xp.cli.commands.conbus.conbus import conbus_linknumber
8
8
  from xp.cli.utils.decorators import (
9
9
  connection_command,
10
- handle_service_errors,
11
10
  )
12
11
  from xp.cli.utils.serial_number_type import SERIAL
13
- from xp.services.conbus.conbus_linknumber_service import ConbusLinknumberService
14
- from xp.services.telegram.telegram_link_number_service import LinkNumberError
12
+ from xp.models.conbus.conbus_linknumber import ConbusLinknumberResponse
13
+ from xp.services.conbus.conbus_linknumber_get_service import ConbusLinknumberGetService
14
+ from xp.services.conbus.conbus_linknumber_set_service import ConbusLinknumberSetService
15
15
 
16
16
 
17
17
  @conbus_linknumber.command("set", short_help="Set link number for a module")
@@ -19,7 +19,6 @@ from xp.services.telegram.telegram_link_number_service import LinkNumberError
19
19
  @click.argument("link_number", type=click.IntRange(0, 99))
20
20
  @click.pass_context
21
21
  @connection_command()
22
- @handle_service_errors(LinkNumberError)
23
22
  def set_linknumber_command(
24
23
  ctx: click.Context, serial_number: str, link_number: int
25
24
  ) -> None:
@@ -34,18 +33,25 @@ def set_linknumber_command(
34
33
  \b
35
34
  xp conbus linknumber set 0123450001 25
36
35
  """
37
- service = ctx.obj.get("container").get_container().resolve(ConbusLinknumberService)
36
+ service = (
37
+ ctx.obj.get("container").get_container().resolve(ConbusLinknumberSetService)
38
+ )
38
39
 
39
- with service:
40
- response = service.set_linknumber(serial_number, link_number)
40
+ def on_finish(response: ConbusLinknumberResponse) -> None:
41
41
  click.echo(json.dumps(response.to_dict(), indent=2))
42
42
 
43
+ with service:
44
+ service.set_linknumber(
45
+ serial_number=serial_number,
46
+ link_number=link_number,
47
+ finish_callback=on_finish,
48
+ )
49
+
43
50
 
44
51
  @conbus_linknumber.command("get", short_help="Get link number for a module")
45
52
  @click.argument("serial_number", type=SERIAL)
46
53
  @click.pass_context
47
54
  @connection_command()
48
- @handle_service_errors(LinkNumberError)
49
55
  def get_linknumber_command(ctx: click.Context, serial_number: str) -> None:
50
56
  """
51
57
  Get the current link number for a specific module.
@@ -57,8 +63,15 @@ def get_linknumber_command(ctx: click.Context, serial_number: str) -> None:
57
63
  \b
58
64
  xp conbus linknumber get 0123450001
59
65
  """
60
- service = ctx.obj.get("container").get_container().resolve(ConbusLinknumberService)
66
+ service = (
67
+ ctx.obj.get("container").get_container().resolve(ConbusLinknumberGetService)
68
+ )
61
69
 
62
- with service:
63
- response = service.get_linknumber(serial_number)
70
+ def on_finish(response: ConbusLinknumberResponse) -> None:
64
71
  click.echo(json.dumps(response.to_dict(), indent=2))
72
+
73
+ with service:
74
+ service.get_linknumber(
75
+ serial_number=serial_number,
76
+ finish_callback=on_finish,
77
+ )
@@ -9,7 +9,11 @@ from xp.cli.utils.decorators import (
9
9
  connection_command,
10
10
  )
11
11
  from xp.cli.utils.serial_number_type import SERIAL
12
+ from xp.models import ConbusDatapointResponse
13
+ from xp.models.conbus.conbus_output import ConbusOutputResponse
12
14
  from xp.models.telegram.action_type import ActionType
15
+ from xp.models.telegram.datapoint_type import DataPointType
16
+ from xp.services.conbus.conbus_datapoint_service import ConbusDatapointService
13
17
  from xp.services.conbus.conbus_output_service import ConbusOutputService
14
18
 
15
19
 
@@ -24,16 +28,20 @@ def xp_output_on(ctx: click.Context, serial_number: str, output_number: int) ->
24
28
  Examples:
25
29
 
26
30
  \b
27
- xp conbus input on 0011223344 0 # Toggle input 0
31
+ xp conbus output on 0011223344 0 # Turn on output 0
28
32
  """
29
33
  service = ctx.obj.get("container").get_container().resolve(ConbusOutputService)
30
34
 
31
- with service:
35
+ def on_finish(response: ConbusOutputResponse) -> None:
36
+ click.echo(json.dumps(response.to_dict(), indent=2))
32
37
 
33
- response = service.send_action(
34
- serial_number, output_number, ActionType.ON_RELEASE
38
+ with service:
39
+ service.send_action(
40
+ serial_number=serial_number,
41
+ output_number=output_number,
42
+ action_type=ActionType.ON_RELEASE,
43
+ finish_callback=on_finish,
35
44
  )
36
- click.echo(json.dumps(response.to_dict(), indent=2))
37
45
 
38
46
 
39
47
  @conbus_output.command("off")
@@ -47,16 +55,20 @@ def xp_output_off(ctx: click.Context, serial_number: str, output_number: int) ->
47
55
  Examples:
48
56
 
49
57
  \b
50
- xp conbus input off 0011223344 1 # Toggle input 1
58
+ xp conbus output off 0011223344 1 # Turn off output 1
51
59
  """
52
60
  service = ctx.obj.get("container").get_container().resolve(ConbusOutputService)
53
61
 
54
- with service:
62
+ def on_finish(response: ConbusOutputResponse) -> None:
63
+ click.echo(json.dumps(response.to_dict(), indent=2))
55
64
 
56
- response = service.send_action(
57
- serial_number, output_number, ActionType.OFF_PRESS
65
+ with service:
66
+ service.send_action(
67
+ serial_number=serial_number,
68
+ output_number=output_number,
69
+ action_type=ActionType.OFF_PRESS,
70
+ finish_callback=on_finish,
58
71
  )
59
- click.echo(json.dumps(response.to_dict(), indent=2))
60
72
 
61
73
 
62
74
  @conbus_output.command("status")
@@ -71,13 +83,20 @@ def xp_output_status(ctx: click.Context, serial_number: str) -> None:
71
83
  \b
72
84
  xp conbus output status 0011223344 # Query output status
73
85
  """
74
- service = ctx.obj.get("container").get_container().resolve(ConbusOutputService)
75
-
76
- with service:
86
+ service: ConbusDatapointService = (
87
+ ctx.obj.get("container").get_container().resolve(ConbusDatapointService)
88
+ )
77
89
 
78
- response = service.get_output_state(serial_number)
90
+ def on_finish(response: ConbusDatapointResponse) -> None:
79
91
  click.echo(json.dumps(response.to_dict(), indent=2))
80
92
 
93
+ with service:
94
+ service.query_datapoint(
95
+ serial_number=serial_number,
96
+ datapoint_type=DataPointType.MODULE_OUTPUT_STATE,
97
+ finish_callback=on_finish,
98
+ )
99
+
81
100
 
82
101
  @conbus_output.command("state")
83
102
  @click.argument("serial_number", type=SERIAL)
@@ -91,9 +110,16 @@ def xp_module_state(ctx: click.Context, serial_number: str) -> None:
91
110
  \b
92
111
  xp conbus output state 0011223344 # Query module state
93
112
  """
94
- service = ctx.obj.get("container").get_container().resolve(ConbusOutputService)
113
+ service: ConbusDatapointService = (
114
+ ctx.obj.get("container").get_container().resolve(ConbusDatapointService)
115
+ )
95
116
 
96
- with service:
97
-
98
- response = service.get_module_state(serial_number)
117
+ def on_finish(response: ConbusDatapointResponse) -> None:
99
118
  click.echo(json.dumps(response.to_dict(), indent=2))
119
+
120
+ with service:
121
+ service.query_datapoint(
122
+ serial_number=serial_number,
123
+ datapoint_type=DataPointType.MODULE_STATE,
124
+ finish_callback=on_finish,
125
+ )
@@ -32,24 +32,25 @@ class ConbusResponse:
32
32
  """Represents a response from Conbus send operation"""
33
33
 
34
34
  success: bool
35
- request: ConbusRequest
36
- sent_telegram: Optional[str] = None
37
- received_telegrams: Optional[list[str]] = None
38
- error: Optional[str] = None
39
- timestamp: Optional[datetime] = None
35
+ sent_telegrams: list[str]
36
+ received_telegrams: list[str]
37
+ timestamp: datetime
38
+ error: str = ""
39
+ serial_number: str = ""
40
+ function_code: str = ""
40
41
 
41
42
  def __post_init__(self) -> None:
42
- if self.timestamp is None:
43
- self.timestamp = datetime.now()
44
- if self.received_telegrams is None:
45
- self.received_telegrams = []
43
+ self.timestamp = datetime.now()
44
+ self.sent_telegrams = []
45
+ self.received_telegrams = []
46
46
 
47
47
  def to_dict(self) -> Dict[str, Any]:
48
48
  """Convert to dictionary for JSON serialization"""
49
49
  return {
50
50
  "success": self.success,
51
- "request": self.request.to_dict(),
52
- "sent_telegram": self.sent_telegram,
51
+ "serial_number": self.serial_number,
52
+ "function_code": self.function_code,
53
+ "sent_telegrams": self.sent_telegrams,
53
54
  "received_telegrams": self.received_telegrams,
54
55
  "error": self.error,
55
56
  "timestamp": self.timestamp.isoformat() if self.timestamp else None,
@@ -0,0 +1,85 @@
1
+ """Conbus Auto Report Service for getting and setting module auto report status.
2
+
3
+ This service handles auto report status operations for modules through Conbus telegrams.
4
+ """
5
+
6
+ import logging
7
+ from typing import Callable, Optional
8
+
9
+ from twisted.internet.posixbase import PosixReactorBase
10
+
11
+ from xp.models import ConbusClientConfig, ConbusDatapointResponse
12
+ from xp.models.conbus.conbus_autoreport import ConbusAutoreportResponse
13
+ from xp.models.telegram.datapoint_type import DataPointType
14
+ from xp.services.conbus.conbus_datapoint_service import ConbusDatapointService
15
+ from xp.services.telegram.telegram_service import TelegramService
16
+
17
+
18
+ class ConbusAutoreportGetService(ConbusDatapointService):
19
+ """
20
+ Service for receiving telegrams from Conbus servers.
21
+
22
+ Uses composition with ConbusService to provide receive-only functionality
23
+ for collecting waiting event telegrams from the server.
24
+ """
25
+
26
+ def __init__(
27
+ self,
28
+ telegram_service: TelegramService,
29
+ cli_config: ConbusClientConfig,
30
+ reactor: PosixReactorBase,
31
+ ) -> None:
32
+ """Initialize the Conbus client send service"""
33
+ super().__init__(telegram_service, cli_config, reactor)
34
+ self.service_callback: Optional[Callable[[ConbusAutoreportResponse], None]] = (
35
+ None
36
+ )
37
+
38
+ # Set up logging
39
+ self.logger = logging.getLogger(__name__)
40
+
41
+ def finish_service_callback(
42
+ self, datapoint_response: ConbusDatapointResponse
43
+ ) -> None:
44
+
45
+ self.logger.debug("Parsing datapoint response")
46
+ autoreport_status = ""
47
+ if datapoint_response.success and datapoint_response.datapoint_telegram:
48
+ autoreport_status = datapoint_response.datapoint_telegram.data_value
49
+
50
+ service_response = ConbusAutoreportResponse(
51
+ success=datapoint_response.success,
52
+ serial_number=self.serial_number,
53
+ auto_report_status=autoreport_status,
54
+ error=datapoint_response.error,
55
+ sent_telegram=datapoint_response.sent_telegram,
56
+ received_telegrams=datapoint_response.received_telegrams,
57
+ timestamp=datapoint_response.timestamp,
58
+ )
59
+
60
+ if self.service_callback:
61
+ self.service_callback(service_response)
62
+
63
+ def get_autoreport_status(
64
+ self,
65
+ serial_number: str,
66
+ finish_callback: Callable[[ConbusAutoreportResponse], None],
67
+ timeout_seconds: Optional[float] = None,
68
+ ) -> None:
69
+ """
70
+ Get the current auto report status for a specific module.
71
+
72
+ Args:
73
+ :param serial_number: 10-digit module serial number
74
+ :param finish_callback: callback function to call when the linknumber status is
75
+ :param timeout_seconds: timeout in seconds
76
+
77
+ """
78
+ self.logger.info("Starting get_autoreport_status")
79
+ if timeout_seconds:
80
+ self.timeout_seconds = timeout_seconds
81
+ self.serial_number = serial_number
82
+ self.datapoint_type = DataPointType.AUTO_REPORT_STATUS
83
+ self.finish_callback = self.finish_service_callback
84
+ self.service_callback = finish_callback
85
+ self.start_reactor()
@@ -12,6 +12,7 @@ from twisted.internet.posixbase import PosixReactorBase
12
12
  from xp.models import ConbusClientConfig, ConbusDatapointResponse
13
13
  from xp.models.protocol.conbus_protocol import TelegramReceivedEvent
14
14
  from xp.models.telegram.datapoint_type import DataPointType
15
+ from xp.models.telegram.reply_telegram import ReplyTelegram
15
16
  from xp.models.telegram.system_function import SystemFunction
16
17
  from xp.models.telegram.telegram_type import TelegramType
17
18
  from xp.services.protocol import ConbusProtocol
@@ -93,13 +94,16 @@ class ConbusDatapointService(ConbusProtocol):
93
94
  return
94
95
 
95
96
  self.logger.debug("Received datapoint telegram")
97
+ self.succeed(datapoint_telegram)
98
+
99
+ def succeed(self, datapoint_telegram: ReplyTelegram) -> None:
100
+ self.logger.debug("Succeed querying datapoint")
96
101
  self.service_response.success = True
97
102
  self.service_response.timestamp = datetime.now()
98
103
  self.service_response.serial_number = self.serial_number
99
104
  self.service_response.system_function = SystemFunction.READ_DATAPOINT
100
105
  self.service_response.datapoint_type = self.datapoint_type
101
106
  self.service_response.datapoint_telegram = datapoint_telegram
102
-
103
107
  if self.finish_callback:
104
108
  self.finish_callback(self.service_response)
105
109
 
@@ -107,6 +111,7 @@ class ConbusDatapointService(ConbusProtocol):
107
111
  self.logger.debug(f"Failed with message: {message}")
108
112
  self.service_response.success = False
109
113
  self.service_response.timestamp = datetime.now()
114
+ self.service_response.serial_number = self.serial_number
110
115
  self.service_response.error = message
111
116
  if self.finish_callback:
112
117
  self.finish_callback(self.service_response)
@@ -0,0 +1,101 @@
1
+ """Conbus Auto Report Service for getting and setting module auto report status.
2
+
3
+ This service handles auto report status operations for modules through Conbus telegrams.
4
+ """
5
+
6
+ import logging
7
+ from datetime import datetime
8
+ from typing import Callable, Optional
9
+
10
+ from twisted.internet.posixbase import PosixReactorBase
11
+
12
+ from xp.models import ConbusClientConfig, ConbusDatapointResponse
13
+ from xp.models.conbus.conbus_lightlevel import ConbusLightlevelResponse
14
+ from xp.models.telegram.datapoint_type import DataPointType
15
+ from xp.services.conbus.conbus_datapoint_service import ConbusDatapointService
16
+ from xp.services.telegram.telegram_service import TelegramService
17
+
18
+
19
+ class ConbusLightlevelGetService(ConbusDatapointService):
20
+ """
21
+ Service for receiving telegrams from Conbus servers.
22
+
23
+ Uses composition with ConbusService to provide receive-only functionality
24
+ for collecting waiting event telegrams from the server.
25
+ """
26
+
27
+ def __init__(
28
+ self,
29
+ telegram_service: TelegramService,
30
+ cli_config: ConbusClientConfig,
31
+ reactor: PosixReactorBase,
32
+ ) -> None:
33
+ """Initialize the Conbus client send service"""
34
+ super().__init__(telegram_service, cli_config, reactor)
35
+ self.output_number: int = 0
36
+ self.service_callback: Optional[Callable[[ConbusLightlevelResponse], None]] = (
37
+ None
38
+ )
39
+
40
+ # Set up logging
41
+ self.logger = logging.getLogger(__name__)
42
+
43
+ def finish_service_callback(
44
+ self, datapoint_response: ConbusDatapointResponse
45
+ ) -> None:
46
+
47
+ self.logger.debug("Parsing datapoint response")
48
+
49
+ level = 0
50
+ if datapoint_response.success and datapoint_response.datapoint_telegram:
51
+ for output_data in datapoint_response.datapoint_telegram.data_value.split(
52
+ ","
53
+ ):
54
+ if ":" in output_data:
55
+ output_str, level_str = output_data.split(":")
56
+ if int(output_str) == self.output_number:
57
+ level_str = level_str.replace("[%]", "")
58
+ level = int(level_str)
59
+ break
60
+
61
+ service_response = ConbusLightlevelResponse(
62
+ success=datapoint_response.success,
63
+ serial_number=self.serial_number,
64
+ output_number=self.output_number,
65
+ level=level,
66
+ error=datapoint_response.error,
67
+ sent_telegram=datapoint_response.sent_telegram,
68
+ received_telegrams=datapoint_response.received_telegrams,
69
+ timestamp=datetime.now(),
70
+ )
71
+
72
+ if self.service_callback:
73
+ self.service_callback(service_response)
74
+
75
+ def get_light_level(
76
+ self,
77
+ serial_number: str,
78
+ output_number: int,
79
+ finish_callback: Callable[[ConbusLightlevelResponse], None],
80
+ timeout_seconds: Optional[float] = None,
81
+ ) -> None:
82
+ """
83
+ Get the current auto report status for a specific module.
84
+
85
+ Args:
86
+ :param serial_number: 10-digit module serial number
87
+ :param output_number: output module number
88
+ :param finish_callback: callback function to call when the lightlevel status is
89
+ :param timeout_seconds: timeout in seconds
90
+
91
+ """
92
+ self.logger.info("Starting get_lightlevel_status")
93
+ if timeout_seconds:
94
+ self.timeout_seconds = timeout_seconds
95
+ self.serial_number = serial_number
96
+ self.output_number = output_number
97
+ self.datapoint_type = DataPointType.MODULE_LIGHT_LEVEL
98
+
99
+ self.finish_callback = self.finish_service_callback
100
+ self.service_callback = finish_callback
101
+ self.start_reactor()
@@ -0,0 +1,86 @@
1
+ """Conbus Link Number Service for setting module link numbers.
2
+
3
+ This service handles setting link numbers for modules through Conbus telegrams.
4
+ """
5
+
6
+ import logging
7
+ from typing import Callable, Optional
8
+
9
+ from twisted.internet.posixbase import PosixReactorBase
10
+
11
+ from xp.models import ConbusClientConfig, ConbusDatapointResponse
12
+ from xp.models.conbus.conbus_linknumber import ConbusLinknumberResponse
13
+ from xp.models.telegram.datapoint_type import DataPointType
14
+ from xp.services.conbus.conbus_datapoint_service import ConbusDatapointService
15
+ from xp.services.telegram.telegram_service import TelegramService
16
+
17
+
18
+ class ConbusLinknumberGetService(ConbusDatapointService):
19
+ """
20
+ Service for receiving telegrams from Conbus servers.
21
+
22
+ Uses composition with ConbusService to provide receive-only functionality
23
+ for collecting waiting event telegrams from the server.
24
+ """
25
+
26
+ def __init__(
27
+ self,
28
+ telegram_service: TelegramService,
29
+ cli_config: ConbusClientConfig,
30
+ reactor: PosixReactorBase,
31
+ ) -> None:
32
+ """Initialize the Conbus client send service"""
33
+ super().__init__(telegram_service, cli_config, reactor)
34
+ self.service_callback: Optional[Callable[[ConbusLinknumberResponse], None]] = (
35
+ None
36
+ )
37
+
38
+ # Set up logging
39
+ self.logger = logging.getLogger(__name__)
40
+
41
+ def finish_service_callback(
42
+ self, datapoint_response: ConbusDatapointResponse
43
+ ) -> None:
44
+
45
+ self.logger.debug("Parsing datapoint response")
46
+ link_number_value = 0
47
+ if datapoint_response.success and datapoint_response.datapoint_telegram:
48
+ link_number_value = int(datapoint_response.datapoint_telegram.data_value)
49
+
50
+ linknumber_response = ConbusLinknumberResponse(
51
+ success=datapoint_response.success,
52
+ result="SUCCESS" if datapoint_response.success else "FAILURE",
53
+ link_number=link_number_value,
54
+ serial_number=self.serial_number,
55
+ error=datapoint_response.error,
56
+ sent_telegram=datapoint_response.sent_telegram,
57
+ received_telegrams=datapoint_response.received_telegrams,
58
+ timestamp=datapoint_response.timestamp,
59
+ )
60
+
61
+ if self.service_callback:
62
+ self.service_callback(linknumber_response)
63
+
64
+ def get_linknumber(
65
+ self,
66
+ serial_number: str,
67
+ finish_callback: Callable[[ConbusLinknumberResponse], None],
68
+ timeout_seconds: Optional[float] = None,
69
+ ) -> None:
70
+ """
71
+ Get the current auto report status for a specific module.
72
+
73
+ Args:
74
+ :param serial_number: 10-digit module serial number
75
+ :param finish_callback: callback function to call when the linknumber status is
76
+ :param timeout_seconds: timeout in seconds
77
+
78
+ """
79
+ self.logger.info("Starting get_linknumber")
80
+ if timeout_seconds:
81
+ self.timeout_seconds = timeout_seconds
82
+ self.serial_number = serial_number
83
+ self.datapoint_type = DataPointType.LINK_NUMBER
84
+ self.finish_callback = self.finish_service_callback
85
+ self.service_callback = finish_callback
86
+ self.start_reactor()