conson-xp 1.51.1__tar.gz → 2.0.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 (329) hide show
  1. {conson_xp-1.51.1 → conson_xp-2.0.0}/PKG-INFO +1 -11
  2. {conson_xp-1.51.1 → conson_xp-2.0.0}/README.md +0 -9
  3. {conson_xp-1.51.1 → conson_xp-2.0.0}/pyproject.toml +1 -2
  4. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/__init__.py +1 -1
  5. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/__init__.py +0 -4
  6. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/term/term_commands.py +1 -1
  7. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/main.py +0 -3
  8. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/homekit/homekit_config.py +4 -0
  9. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/protocol/conbus_protocol.py +30 -25
  10. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/term/accessory_state.py +1 -1
  11. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/protocol/__init__.py +2 -3
  12. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/protocol/conbus_event_protocol.py +5 -5
  13. conson_xp-2.0.0/src/xp/services/term/homekit_accessory_driver.py +171 -0
  14. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/term/homekit_service.py +187 -10
  15. conson_xp-2.0.0/src/xp/term/homekit.py +248 -0
  16. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/term/homekit.tcss +4 -4
  17. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/term/widgets/room_list.py +61 -3
  18. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/utils/dependencies.py +34 -154
  19. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_models/test_conbus.py +1 -1
  20. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_homekit_service.py +70 -15
  21. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_tui/test_homekit_app.py +70 -23
  22. conson_xp-1.51.1/src/xp/cli/commands/homekit/__init__.py +0 -3
  23. conson_xp-1.51.1/src/xp/cli/commands/homekit/homekit.py +0 -120
  24. conson_xp-1.51.1/src/xp/cli/commands/homekit/homekit_start_commands.py +0 -44
  25. conson_xp-1.51.1/src/xp/services/homekit/__init__.py +0 -1
  26. conson_xp-1.51.1/src/xp/services/homekit/homekit_cache_service.py +0 -313
  27. conson_xp-1.51.1/src/xp/services/homekit/homekit_conbus_service.py +0 -99
  28. conson_xp-1.51.1/src/xp/services/homekit/homekit_config_validator.py +0 -327
  29. conson_xp-1.51.1/src/xp/services/homekit/homekit_conson_validator.py +0 -130
  30. conson_xp-1.51.1/src/xp/services/homekit/homekit_dimminglight.py +0 -189
  31. conson_xp-1.51.1/src/xp/services/homekit/homekit_dimminglight_service.py +0 -155
  32. conson_xp-1.51.1/src/xp/services/homekit/homekit_hap_service.py +0 -351
  33. conson_xp-1.51.1/src/xp/services/homekit/homekit_lightbulb.py +0 -125
  34. conson_xp-1.51.1/src/xp/services/homekit/homekit_lightbulb_service.py +0 -91
  35. conson_xp-1.51.1/src/xp/services/homekit/homekit_module_service.py +0 -60
  36. conson_xp-1.51.1/src/xp/services/homekit/homekit_outlet.py +0 -175
  37. conson_xp-1.51.1/src/xp/services/homekit/homekit_outlet_service.py +0 -127
  38. conson_xp-1.51.1/src/xp/services/homekit/homekit_service.py +0 -371
  39. conson_xp-1.51.1/src/xp/services/protocol/protocol_factory.py +0 -84
  40. conson_xp-1.51.1/src/xp/services/protocol/telegram_protocol.py +0 -270
  41. conson_xp-1.51.1/src/xp/term/homekit.py +0 -116
  42. conson_xp-1.51.1/tests/integration/test_homekit_config_integration.py +0 -318
  43. conson_xp-1.51.1/tests/unit/test_services/test_homekit_cache_service.py +0 -412
  44. conson_xp-1.51.1/tests/unit/test_services/test_homekit_config_validator.py +0 -489
  45. conson_xp-1.51.1/tests/unit/test_services/test_homekit_conson_service.py +0 -299
  46. conson_xp-1.51.1/tests/unit/test_services/test_homekit_services.py +0 -745
  47. conson_xp-1.51.1/tests/unit/test_services/test_protocol.py +0 -405
  48. conson_xp-1.51.1/tests/unit/test_services/test_telegram_protocol.py +0 -313
  49. {conson_xp-1.51.1 → conson_xp-2.0.0}/LICENSE +0 -0
  50. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/__init__.py +0 -0
  51. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/__main__.py +0 -0
  52. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/conbus/__init__.py +0 -0
  53. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/conbus/conbus.py +0 -0
  54. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/conbus/conbus_actiontable_commands.py +0 -0
  55. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/conbus/conbus_autoreport_commands.py +0 -0
  56. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/conbus/conbus_blink_commands.py +0 -0
  57. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/conbus/conbus_config_commands.py +0 -0
  58. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/conbus/conbus_custom_commands.py +0 -0
  59. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/conbus/conbus_datapoint_commands.py +0 -0
  60. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/conbus/conbus_discover_commands.py +0 -0
  61. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/conbus/conbus_event_commands.py +0 -0
  62. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/conbus/conbus_export_commands.py +0 -0
  63. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/conbus/conbus_lightlevel_commands.py +0 -0
  64. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/conbus/conbus_linknumber_commands.py +0 -0
  65. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/conbus/conbus_modulenumber_commands.py +0 -0
  66. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/conbus/conbus_msactiontable_commands.py +0 -0
  67. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/conbus/conbus_output_commands.py +0 -0
  68. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/conbus/conbus_raw_commands.py +0 -0
  69. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/conbus/conbus_receive_commands.py +0 -0
  70. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/conbus/conbus_scan_commands.py +0 -0
  71. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/file_commands.py +0 -0
  72. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/module_commands.py +0 -0
  73. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/reverse_proxy_commands.py +0 -0
  74. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/server/__init__.py +0 -0
  75. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/server/server_commands.py +0 -0
  76. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/telegram/__init__.py +0 -0
  77. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/telegram/telegram.py +0 -0
  78. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/telegram/telegram_blink_commands.py +0 -0
  79. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/telegram/telegram_checksum_commands.py +0 -0
  80. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/telegram/telegram_discover_commands.py +0 -0
  81. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/telegram/telegram_linknumber_commands.py +0 -0
  82. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/telegram/telegram_parse_commands.py +0 -0
  83. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/telegram/telegram_version_commands.py +0 -0
  84. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/term/__init__.py +0 -0
  85. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/commands/term/term.py +0 -0
  86. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/utils/__init__.py +0 -0
  87. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/utils/click_tree.py +0 -0
  88. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/utils/datapoint_type_choice.py +0 -0
  89. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/utils/decorators.py +0 -0
  90. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/utils/error_handlers.py +0 -0
  91. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/utils/formatters.py +0 -0
  92. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/utils/module_type_choice.py +0 -0
  93. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/utils/serial_number_type.py +0 -0
  94. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/cli/utils/system_function_choice.py +0 -0
  95. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/__init__.py +0 -0
  96. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/actiontable/__init__.py +0 -0
  97. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/actiontable/actiontable.py +0 -0
  98. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/actiontable/actiontable_type.py +0 -0
  99. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/actiontable/msactiontable_xp20.py +0 -0
  100. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/actiontable/msactiontable_xp24.py +0 -0
  101. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/actiontable/msactiontable_xp33.py +0 -0
  102. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/conbus/__init__.py +0 -0
  103. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/conbus/conbus.py +0 -0
  104. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/conbus/conbus_autoreport.py +0 -0
  105. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/conbus/conbus_blink.py +0 -0
  106. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/conbus/conbus_client_config.py +0 -0
  107. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/conbus/conbus_connection_status.py +0 -0
  108. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/conbus/conbus_custom.py +0 -0
  109. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/conbus/conbus_datapoint.py +0 -0
  110. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/conbus/conbus_discover.py +0 -0
  111. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/conbus/conbus_event_list.py +0 -0
  112. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/conbus/conbus_event_raw.py +0 -0
  113. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/conbus/conbus_export.py +0 -0
  114. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/conbus/conbus_lightlevel.py +0 -0
  115. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/conbus/conbus_linknumber.py +0 -0
  116. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/conbus/conbus_logger_config.py +0 -0
  117. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/conbus/conbus_output.py +0 -0
  118. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/conbus/conbus_raw.py +0 -0
  119. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/conbus/conbus_receive.py +0 -0
  120. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/conbus/conbus_writeconfig.py +0 -0
  121. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/config/__init__.py +0 -0
  122. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/config/conson_module_config.py +0 -0
  123. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/homekit/__init__.py +0 -0
  124. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/homekit/homekit_accessory.py +0 -0
  125. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/log_entry.py +0 -0
  126. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/protocol/__init__.py +0 -0
  127. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/response.py +0 -0
  128. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/telegram/__init__.py +0 -0
  129. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/telegram/action_type.py +0 -0
  130. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/telegram/datapoint_type.py +0 -0
  131. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/telegram/event_telegram.py +0 -0
  132. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/telegram/event_type.py +0 -0
  133. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/telegram/input_action_type.py +0 -0
  134. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/telegram/input_type.py +0 -0
  135. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/telegram/module_type.py +0 -0
  136. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/telegram/module_type_code.py +0 -0
  137. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/telegram/output_telegram.py +0 -0
  138. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/telegram/reply_telegram.py +0 -0
  139. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/telegram/system_function.py +0 -0
  140. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/telegram/system_telegram.py +0 -0
  141. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/telegram/telegram.py +0 -0
  142. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/telegram/telegram_type.py +0 -0
  143. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/telegram/timeparam_type.py +0 -0
  144. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/term/__init__.py +0 -0
  145. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/term/connection_state.py +0 -0
  146. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/term/module_state.py +0 -0
  147. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/term/protocol_keys_config.py +0 -0
  148. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/term/status_message.py +0 -0
  149. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/term/telegram_display.py +0 -0
  150. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/models/write_config_type.py +0 -0
  151. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/__init__.py +0 -0
  152. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/actiontable/__init__.py +0 -0
  153. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/actiontable/actiontable_serializer.py +0 -0
  154. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/actiontable/download_state_machine.py +0 -0
  155. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/actiontable/msactiontable_serializer.py +0 -0
  156. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/actiontable/msactiontable_xp20_serializer.py +0 -0
  157. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/actiontable/msactiontable_xp24_serializer.py +0 -0
  158. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/actiontable/msactiontable_xp33_serializer.py +0 -0
  159. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/actiontable/serializer_protocol.py +0 -0
  160. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/conbus/__init__.py +0 -0
  161. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/conbus/actiontable/__init__.py +0 -0
  162. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/conbus/actiontable/actiontable_download_service.py +0 -0
  163. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/conbus/actiontable/actiontable_list_service.py +0 -0
  164. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/conbus/actiontable/actiontable_show_service.py +0 -0
  165. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/conbus/actiontable/actiontable_upload_service.py +0 -0
  166. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/conbus/conbus_blink_all_service.py +0 -0
  167. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/conbus/conbus_blink_service.py +0 -0
  168. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/conbus/conbus_custom_service.py +0 -0
  169. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/conbus/conbus_datapoint_queryall_service.py +0 -0
  170. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/conbus/conbus_datapoint_service.py +0 -0
  171. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/conbus/conbus_discover_service.py +0 -0
  172. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/conbus/conbus_event_list_service.py +0 -0
  173. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/conbus/conbus_event_raw_service.py +0 -0
  174. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/conbus/conbus_export_actiontable_service.py +0 -0
  175. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/conbus/conbus_export_service.py +0 -0
  176. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/conbus/conbus_output_service.py +0 -0
  177. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/conbus/conbus_raw_service.py +0 -0
  178. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/conbus/conbus_receive_service.py +0 -0
  179. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/conbus/conbus_scan_service.py +0 -0
  180. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/conbus/write_config_service.py +0 -0
  181. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/log_file_service.py +0 -0
  182. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/module_type_service.py +0 -0
  183. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/reverse_proxy_service.py +0 -0
  184. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/server/__init__.py +0 -0
  185. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/server/base_server_service.py +0 -0
  186. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/server/client_buffer_manager.py +0 -0
  187. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/server/cp20_server_service.py +0 -0
  188. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/server/device_service_factory.py +0 -0
  189. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/server/server_service.py +0 -0
  190. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/server/xp130_server_service.py +0 -0
  191. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/server/xp20_server_service.py +0 -0
  192. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/server/xp230_server_service.py +0 -0
  193. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/server/xp24_server_service.py +0 -0
  194. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/server/xp33_server_service.py +0 -0
  195. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/telegram/__init__.py +0 -0
  196. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/telegram/telegram_blink_service.py +0 -0
  197. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/telegram/telegram_checksum_service.py +0 -0
  198. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/telegram/telegram_datapoint_service.py +0 -0
  199. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/telegram/telegram_discover_service.py +0 -0
  200. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/telegram/telegram_link_number_service.py +0 -0
  201. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/telegram/telegram_output_service.py +0 -0
  202. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/telegram/telegram_service.py +0 -0
  203. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/telegram/telegram_version_service.py +0 -0
  204. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/term/__init__.py +0 -0
  205. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/term/protocol_monitor_service.py +0 -0
  206. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/services/term/state_monitor_service.py +0 -0
  207. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/term/__init__.py +0 -0
  208. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/term/protocol.py +0 -0
  209. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/term/protocol.tcss +0 -0
  210. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/term/state.py +0 -0
  211. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/term/state.tcss +0 -0
  212. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/term/widgets/__init__.py +0 -0
  213. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/term/widgets/help_menu.py +0 -0
  214. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/term/widgets/modules_list.py +0 -0
  215. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/term/widgets/protocol_log.py +0 -0
  216. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/term/widgets/status_footer.py +0 -0
  217. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/utils/__init__.py +0 -0
  218. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/utils/checksum.py +0 -0
  219. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/utils/event_helper.py +0 -0
  220. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/utils/logging.py +0 -0
  221. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/utils/serialization.py +0 -0
  222. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/utils/state_machine.py +0 -0
  223. {conson_xp-1.51.1 → conson_xp-2.0.0}/src/xp/utils/time_utils.py +0 -0
  224. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/.coverage +0 -0
  225. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/__init__.py +0 -0
  226. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/conftest.py +0 -0
  227. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/integration/.coverage +0 -0
  228. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/integration/__init__.py +0 -0
  229. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/integration/telegram_test_data.py +0 -0
  230. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/integration/test_actiontable_integration.py +0 -0
  231. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/integration/test_api/.coverage +0 -0
  232. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/integration/test_api/__init__.py +0 -0
  233. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/integration/test_blink_integration.py +0 -0
  234. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/integration/test_checksum_integration.py +0 -0
  235. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/integration/test_conbus_blink_integration.py +0 -0
  236. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/integration/test_conbus_datapoint_integration.py +0 -0
  237. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/integration/test_conbus_raw_integration.py +0 -0
  238. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/integration/test_conbus_receive_integration.py +0 -0
  239. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/integration/test_discovery_integration.py +0 -0
  240. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/integration/test_event_telegram_integration.py +0 -0
  241. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/integration/test_link_number_integration.py +0 -0
  242. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/integration/test_module_integration.py +0 -0
  243. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/integration/test_output_integration.py +0 -0
  244. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/integration/test_reverse_proxy_integration.py +0 -0
  245. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/integration/test_system_reply_telegram_integration.py +0 -0
  246. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/integration/test_term_logging_integration.py +0 -0
  247. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/integration/test_version_integration.py +0 -0
  248. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/integration/test_xp20_action_table_integration.py +0 -0
  249. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/integration/test_xp24_action_table_integration.py +0 -0
  250. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/__init__.py +0 -0
  251. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_api/__init__.py +0 -0
  252. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_cli/__init__.py +0 -0
  253. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_cli/test_click_tree.py +0 -0
  254. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_cli/test_conbus_actiontable_commands.py +0 -0
  255. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_cli/test_conbus_blink_commands.py +0 -0
  256. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_cli/test_conbus_msactiontable_upload_commands.py +0 -0
  257. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_cli/test_datapoint_type_choice.py +0 -0
  258. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_cli/test_decorators.py +0 -0
  259. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_cli/test_error_handlers.py +0 -0
  260. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_cli/test_formatters.py +0 -0
  261. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_cli/test_serial_number_type.py +0 -0
  262. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_cli/test_system_function_choice.py +0 -0
  263. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_cli/test_term_commands.py +0 -0
  264. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_encoding/__init__.py +0 -0
  265. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_encoding/test_latin1_edge_cases.py +0 -0
  266. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_models/__init__.py +0 -0
  267. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_models/test_conbus_client_send.py +0 -0
  268. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_models/test_conbus_discover.py +0 -0
  269. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_models/test_conbus_linknumber.py +0 -0
  270. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_models/test_event_telegram.py +0 -0
  271. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_models/test_log_entry.py +0 -0
  272. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_models/test_logger_config.py +0 -0
  273. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_models/test_module_type.py +0 -0
  274. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_models/test_reply_telegram.py +0 -0
  275. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_models/test_system_telegram.py +0 -0
  276. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_models/test_system_telegram_enhancements.py +0 -0
  277. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_models/test_term/__init__.py +0 -0
  278. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_models/test_term/test_accessory_state.py +0 -0
  279. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_models/test_version_telegram.py +0 -0
  280. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_models/test_write_config_type.py +0 -0
  281. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_models/test_xp20_action_table.py +0 -0
  282. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_models/test_xp24_action_table.py +0 -0
  283. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_models/test_xp24_action_table_short_format.py +0 -0
  284. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_models/test_xp24_action_telegram.py +0 -0
  285. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/__init__.py +0 -0
  286. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_actiontable_download_service.py +0 -0
  287. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_actiontable_serializer.py +0 -0
  288. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_actiontable_service.py +0 -0
  289. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_actiontable_upload_service.py +0 -0
  290. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_base_server_service.py +0 -0
  291. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_blink_service.py +0 -0
  292. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_checksum_service.py +0 -0
  293. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_client_buffer_manager.py +0 -0
  294. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_conbus_blink_service.py +0 -0
  295. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_conbus_event_list_service.py +0 -0
  296. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_conbus_event_protocol.py +0 -0
  297. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_conbus_event_raw_service.py +0 -0
  298. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_conbus_output_service.py +0 -0
  299. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_conbus_raw_service.py +0 -0
  300. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_conbus_receive_service.py +0 -0
  301. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_conbus_reverse_proxy_service.py +0 -0
  302. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_conbus_scan_service.py +0 -0
  303. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_device_service_factory.py +0 -0
  304. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_discovery_service.py +0 -0
  305. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_log_file_service.py +0 -0
  306. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_module_type_service.py +0 -0
  307. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_protocol_monitor_service.py +0 -0
  308. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_server_service.py +0 -0
  309. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_state_monitor_service.py +0 -0
  310. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_telegram_input_service.py +0 -0
  311. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_telegram_output_service.py +0 -0
  312. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_telegram_service.py +0 -0
  313. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_version_service.py +0 -0
  314. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_xp20_action_table_serializer.py +0 -0
  315. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_xp24_action_service.py +0 -0
  316. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_xp24_action_table_serializer.py +0 -0
  317. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_xp24_action_table_service.py +0 -0
  318. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_xp33_action_table_serializer.py +0 -0
  319. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_xp33_short_format.py +0 -0
  320. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_services/test_xp_server_services.py +0 -0
  321. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_tui/__init__.py +0 -0
  322. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_tui/test_protocol_log.py +0 -0
  323. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_tui/test_room_list.py +0 -0
  324. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_utils/__init__.py +0 -0
  325. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_utils/test_checksum.py +0 -0
  326. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_utils/test_event_helper.py +0 -0
  327. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_utils/test_logging.py +0 -0
  328. {conson_xp-1.51.1 → conson_xp-2.0.0}/tests/unit/test_utils/test_serialization.py +0 -0
  329. {conson_xp-1.51.1 → conson_xp-2.0.0}/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: 1.51.1
3
+ Version: 2.0.0
4
4
  Summary: XP Protocol Communication Tools
5
5
  Author-Email: ldvchosal <ldvchosal@github.com>
6
6
  License: MIT License
@@ -46,7 +46,6 @@ Requires-Dist: pydantic>=2.11
46
46
  Requires-Dist: HAP-python[QRCode]>=5.0.0
47
47
  Requires-Dist: punq>=0.7.0
48
48
  Requires-Dist: twisted>=25.5.0
49
- Requires-Dist: bubus>=1.5.6
50
49
  Requires-Dist: psygnal>=0.15.0
51
50
  Requires-Dist: textual>=1.0.0
52
51
  Requires-Dist: python-statemachine>=2.5.0
@@ -399,15 +398,6 @@ xp file validate
399
398
 
400
399
  xp help
401
400
 
402
- xp homekit
403
-
404
- xp homekit config
405
- xp homekit config show
406
- xp homekit config validate
407
-
408
- xp homekit start
409
-
410
-
411
401
  xp module
412
402
  xp module categories
413
403
  xp module info
@@ -345,15 +345,6 @@ xp file validate
345
345
 
346
346
  xp help
347
347
 
348
- xp homekit
349
-
350
- xp homekit config
351
- xp homekit config show
352
- xp homekit config validate
353
-
354
- xp homekit start
355
-
356
-
357
348
  xp module
358
349
  xp module categories
359
350
  xp module info
@@ -16,14 +16,13 @@ dependencies = [
16
16
  "HAP-python[QRCode]>=5.0.0",
17
17
  "punq>=0.7.0",
18
18
  "twisted>=25.5.0",
19
- "bubus>=1.5.6",
20
19
  "psygnal>=0.15.0",
21
20
  "textual>=1.0.0",
22
21
  "python-statemachine>=2.5.0",
23
22
  ]
24
23
  requires-python = ">=3.11"
25
24
  readme = "README.md"
26
- version = "1.51.1"
25
+ version = "2.0.0"
27
26
 
28
27
  [project.license]
29
28
  file = "LICENSE"
@@ -4,7 +4,7 @@ XP CLI tool for remote console bus operations.
4
4
  conson-xp package.
5
5
  """
6
6
 
7
- __version__ = "1.51.1"
7
+ __version__ = "2.0.0"
8
8
  __manufacturer__ = "salchichon"
9
9
  __model__ = "xp.cli"
10
10
  __serial__ = "2025.09.23.000"
@@ -66,8 +66,6 @@ from xp.cli.commands.conbus.conbus_raw_commands import send_raw_telegrams
66
66
  from xp.cli.commands.conbus.conbus_receive_commands import receive_telegrams
67
67
  from xp.cli.commands.conbus.conbus_scan_commands import scan_module
68
68
  from xp.cli.commands.file_commands import file
69
- from xp.cli.commands.homekit.homekit import homekit
70
- from xp.cli.commands.homekit.homekit_start_commands import homekit_start
71
69
  from xp.cli.commands.module_commands import module
72
70
  from xp.cli.commands.reverse_proxy_commands import reverse_proxy
73
71
  from xp.cli.commands.server.server_commands import server
@@ -111,8 +109,6 @@ __all__ = [
111
109
  "linknumber",
112
110
  "blink",
113
111
  "checksum",
114
- "homekit",
115
- "homekit_start",
116
112
  "term",
117
113
  # Individual command functions
118
114
  "protocol_monitor",
@@ -57,7 +57,7 @@ def homekit_monitor(ctx: Context) -> None:
57
57
  Start TUI for HomeKit accessory monitoring.
58
58
 
59
59
  Displays HomeKit rooms and accessories with real-time state updates
60
- in an interactive terminal interface. Press action keys (a-z) to
60
+ in an interactive terminal interface. Press action keys (a-z0-9) to
61
61
  toggle accessories.
62
62
 
63
63
  Args:
@@ -3,8 +3,6 @@
3
3
  import click
4
4
  from click_help_colors import HelpColorsGroup
5
5
 
6
- from xp.cli.commands import homekit
7
-
8
6
  # Import all conbus command modules to register their commands
9
7
  from xp.cli.commands.conbus import conbus_discover_commands # noqa: F401
10
8
  from xp.cli.commands.conbus import conbus_export_commands # noqa: F401
@@ -47,7 +45,6 @@ def cli(ctx: click.Context) -> None:
47
45
 
48
46
  # Register all command groups
49
47
  cli.add_command(conbus)
50
- cli.add_command(homekit)
51
48
  cli.add_command(telegram)
52
49
  cli.add_command(module)
53
50
  cli.add_command(file)
@@ -16,10 +16,14 @@ class NetworkConfig(BaseModel):
16
16
  Attributes:
17
17
  ip: IP address for the network connection.
18
18
  port: Port number for the network connection.
19
+ pincode: HomeKit pairing code (format: XXX-XX-XXX).
20
+ accessory_state_file: Path to file for persisting accessory state.
19
21
  """
20
22
 
21
23
  ip: Union[IPvAnyAddress, IPv4Address, IPv6Address, str] = "127.0.0.1"
22
24
  port: int = 51826
25
+ pincode: str = "031-45-154"
26
+ accessory_state_file: str = "./accessory.state"
23
27
 
24
28
 
25
29
  class RoomConfig(BaseModel):
@@ -2,10 +2,9 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import TYPE_CHECKING, Union
5
+ from typing import TYPE_CHECKING
6
6
 
7
- from bubus import BaseEvent
8
- from pydantic import Field
7
+ from pydantic import BaseModel, Field
9
8
 
10
9
  from xp.models.config.conson_module_config import ConsonModuleConfig
11
10
  from xp.models.homekit.homekit_config import HomekitAccessoryConfig
@@ -13,23 +12,25 @@ from xp.models.telegram.datapoint_type import DataPointType
13
12
 
14
13
  if TYPE_CHECKING:
15
14
  from xp.services.protocol.conbus_event_protocol import ConbusEventProtocol
16
- from xp.services.protocol.telegram_protocol import TelegramProtocol
17
15
 
18
16
 
19
- class ConnectionMadeEvent(BaseEvent):
17
+ class ConnectionMadeEvent(BaseModel):
20
18
  """
21
19
  Event dispatched when TCP connection is established.
22
20
 
23
21
  Attributes:
24
- protocol: Reference to the TelegramProtocol instance.
22
+ model_config: Pydantic model configuration.
23
+ protocol: Reference to the ConbusEventProtocol instance.
25
24
  """
26
25
 
27
- protocol: TelegramProtocol = Field(
28
- description="Reference to the TelegramProtocol instance"
26
+ model_config = {"arbitrary_types_allowed": True}
27
+
28
+ protocol: ConbusEventProtocol = Field(
29
+ description="Reference to the ConbusEventProtocol instance"
29
30
  )
30
31
 
31
32
 
32
- class ConnectionFailedEvent(BaseEvent):
33
+ class ConnectionFailedEvent(BaseModel):
33
34
  """
34
35
  Event dispatched when TCP connection fails.
35
36
 
@@ -40,7 +41,7 @@ class ConnectionFailedEvent(BaseEvent):
40
41
  reason: str = Field(description="Failure reason")
41
42
 
42
43
 
43
- class SendWriteConfigEvent(BaseEvent):
44
+ class SendWriteConfigEvent(BaseModel):
44
45
  """
45
46
  Event for sending write config commands.
46
47
 
@@ -57,7 +58,7 @@ class SendWriteConfigEvent(BaseEvent):
57
58
  value: int = Field(description="Set brightness value")
58
59
 
59
60
 
60
- class SendActionEvent(BaseEvent):
61
+ class SendActionEvent(BaseModel):
61
62
  """
62
63
  Event for sending action commands.
63
64
 
@@ -76,7 +77,7 @@ class SendActionEvent(BaseEvent):
76
77
  off_action: str = Field(description="off action")
77
78
 
78
79
 
79
- class DatapointEvent(BaseEvent):
80
+ class DatapointEvent(BaseModel):
80
81
  """
81
82
  Base event for datapoint operations.
82
83
 
@@ -131,7 +132,7 @@ class ReadDatapointFromProtocolEvent(DatapointEvent):
131
132
  pass
132
133
 
133
134
 
134
- class ModuleEvent(BaseEvent):
135
+ class ModuleEvent(BaseModel):
135
136
  """
136
137
  Event dispatched when light bulb set is on.
137
138
 
@@ -163,7 +164,7 @@ class LightBulbSetOnEvent(ModuleEvent):
163
164
  value: bool = Field(description="On or Off the light bulb set")
164
165
 
165
166
 
166
- class LightBulbGetOnEvent(ModuleEvent, BaseEvent[bool]):
167
+ class LightBulbGetOnEvent(ModuleEvent):
167
168
  """Event dispatched when getting light bulb on state."""
168
169
 
169
170
  pass
@@ -192,7 +193,7 @@ class OutletGetInUseEvent(ModuleEvent):
192
193
  pass
193
194
 
194
195
 
195
- class OutletSetInUseEvent(ModuleEvent, BaseEvent[bool]):
196
+ class OutletSetInUseEvent(ModuleEvent):
196
197
  """
197
198
  Event dispatched when outlet set is on.
198
199
 
@@ -239,7 +240,7 @@ class DimmingLightGetBrightnessEvent(ModuleEvent):
239
240
  pass
240
241
 
241
242
 
242
- class ConnectionLostEvent(BaseEvent):
243
+ class ConnectionLostEvent(BaseModel):
243
244
  """
244
245
  Event dispatched when TCP connection is lost.
245
246
 
@@ -250,12 +251,13 @@ class ConnectionLostEvent(BaseEvent):
250
251
  reason: str = Field(description="Disconnection reason")
251
252
 
252
253
 
253
- class TelegramEvent(BaseEvent):
254
+ class TelegramEvent(BaseModel):
254
255
  """
255
256
  Event for telegram operations.
256
257
 
257
258
  Attributes:
258
- protocol: TelegramProtocol instance.
259
+ model_config: Pydantic model configuration.
260
+ protocol: ConbusEventProtocol instance.
259
261
  frame: Frame <S0123450001F02D12FK>.
260
262
  telegram: Telegram S0123450001F02D12FK.
261
263
  payload: Payload S0123450001F02D12.
@@ -265,9 +267,9 @@ class TelegramEvent(BaseEvent):
265
267
  checksum_valid: Checksum valid true or false.
266
268
  """
267
269
 
268
- protocol: Union[TelegramProtocol, ConbusEventProtocol] = Field(
269
- description="TelegramProtocol instance"
270
- )
270
+ model_config = {"arbitrary_types_allowed": True}
271
+
272
+ protocol: ConbusEventProtocol = Field(description="ConbusEventProtocol instance")
271
273
  frame: str = Field(description="Frame <S0123450001F02D12FK>")
272
274
  telegram: str = Field(description="Telegram: S0123450001F02D12FK")
273
275
  payload: str = Field(description="Payload: S0123450001F02D12")
@@ -279,7 +281,7 @@ class TelegramEvent(BaseEvent):
279
281
  )
280
282
 
281
283
 
282
- class ModuleStateChangedEvent(BaseEvent):
284
+ class ModuleStateChangedEvent(BaseModel):
283
285
  """
284
286
  Event dispatched when a module's state changes (from event telegram).
285
287
 
@@ -314,16 +316,19 @@ class TelegramReceivedEvent(TelegramEvent):
314
316
  pass
315
317
 
316
318
 
317
- class InvalidTelegramReceivedEvent(BaseEvent):
319
+ class InvalidTelegramReceivedEvent(BaseModel):
318
320
  """
319
321
  Event dispatched when an invalid telegram frame is received.
320
322
 
321
323
  Attributes:
322
- protocol: TelegramProtocol instance.
324
+ model_config: Pydantic model configuration.
325
+ protocol: ConbusEventProtocol instance.
323
326
  frame: Frame <S0123450001F02D12FK>.
324
327
  error: Error with the received telegram.
325
328
  """
326
329
 
327
- protocol: TelegramProtocol = Field(description="TelegramProtocol instance")
330
+ model_config = {"arbitrary_types_allowed": True}
331
+
332
+ protocol: ConbusEventProtocol = Field(description="ConbusEventProtocol instance")
328
333
  frame: str = Field(description="Frame <S0123450001F02D12FK>")
329
334
  error: str = Field(description="Error with the received telegram")
@@ -13,7 +13,7 @@ class AccessoryState:
13
13
  Attributes:
14
14
  room_name: Room containing the accessory (e.g., "Salon").
15
15
  accessory_name: Accessory display name (e.g., "Variateur salon").
16
- action: Action key (a-z) for toggle control.
16
+ action: Action key (a-z0-9) for toggle control.
17
17
  output_state: Output state ("ON", "OFF", "?").
18
18
  dimming_state: Dimming percentage for dimmable modules, "-" if OFF, empty otherwise.
19
19
  module_name: Module identifier (e.g., "A12").
@@ -8,11 +8,10 @@ from xp.models.protocol.conbus_protocol import (
8
8
  TelegramReceivedEvent,
9
9
  )
10
10
  from xp.services.protocol.conbus_event_protocol import ConbusEventProtocol
11
- from xp.services.protocol.telegram_protocol import TelegramProtocol
12
11
 
13
- __all__ = ["TelegramProtocol", "ConbusEventProtocol"]
12
+ __all__ = ["ConbusEventProtocol"]
14
13
 
15
- # Rebuild models after TelegramProtocol and ConbusEventProtocol are imported to resolve forward references
14
+ # Rebuild models after ConbusEventProtocol is imported to resolve forward references
16
15
  ConnectionMadeEvent.model_rebuild()
17
16
  InvalidTelegramReceivedEvent.model_rebuild()
18
17
  ModuleDiscoveredEvent.model_rebuild()
@@ -169,7 +169,7 @@ class ConbusEventProtocol(protocol.Protocol, protocol.ClientFactory):
169
169
  payload = telegram[:-2] # S0123450001F02D12
170
170
  checksum = telegram[-2:].decode() # FK
171
171
  serial_number = (
172
- telegram[1:11] if telegram_type in ("S", "R") else b""
172
+ telegram[1:11].decode("latin-1") if telegram_type in ("S", "R") else ""
173
173
  ) # 0123450001
174
174
  calculated_checksum = calculate_checksum(payload.decode(encoding="latin-1"))
175
175
 
@@ -391,12 +391,12 @@ class ConbusEventProtocol(protocol.Protocol, protocol.ClientFactory):
391
391
  self.logger.debug(f"buildProtocol: {addr}")
392
392
  return self
393
393
 
394
- def clientConnectionFailed(self, connector: IConnector, reason: Failure) -> None:
394
+ def clientConnectionFailed(self, _connector: IConnector, reason: Failure) -> None:
395
395
  """
396
396
  Handle client connection failure.
397
397
 
398
398
  Args:
399
- connector: Connection connector instance.
399
+ _connector: Connection connector instance (unused, required by Twisted).
400
400
  reason: Failure reason details.
401
401
  """
402
402
  self.logger.debug(f"clientConnectionFailed: {reason}")
@@ -404,12 +404,12 @@ class ConbusEventProtocol(protocol.Protocol, protocol.ClientFactory):
404
404
  self.connection_failed(reason)
405
405
  self._cancel_timeout()
406
406
 
407
- def clientConnectionLost(self, connector: IConnector, reason: Failure) -> None:
407
+ def clientConnectionLost(self, _connector: IConnector, reason: Failure) -> None:
408
408
  """
409
409
  Handle client connection lost event.
410
410
 
411
411
  Args:
412
- connector: Connection connector instance.
412
+ _connector: Connection connector instance (unused, required by Twisted).
413
413
  reason: Reason for connection loss.
414
414
  """
415
415
  self.logger.debug(f"clientConnectionLost: {reason}")
@@ -0,0 +1,171 @@
1
+ """HomeKit Accessory Driver for pyhap integration."""
2
+
3
+ import asyncio
4
+ import logging
5
+ from typing import Callable, Dict, Optional
6
+
7
+ from pyhap.accessory import Accessory, Bridge
8
+ from pyhap.accessory_driver import AccessoryDriver
9
+ from pyhap.const import CATEGORY_LIGHTBULB, CATEGORY_OUTLET
10
+
11
+ from xp.models.homekit.homekit_config import HomekitConfig
12
+
13
+
14
+ class XPAccessory(Accessory):
15
+ """Single accessory wrapping a Conbus output."""
16
+
17
+ def __init__(
18
+ self,
19
+ driver: "HomekitAccessoryDriver",
20
+ name: str,
21
+ display_name: str,
22
+ service_type: str,
23
+ aid: int,
24
+ ) -> None:
25
+ """
26
+ Initialize the XP accessory.
27
+
28
+ Args:
29
+ driver: HomekitAccessoryDriver instance.
30
+ name: Accessory name (unique identifier for internal tracking).
31
+ display_name: Display name shown in HomeKit (from config description).
32
+ service_type: Service type ('light', 'outlet', 'dimminglight').
33
+ aid: Accessory ID for HomeKit.
34
+ """
35
+ super().__init__(driver._driver, display_name, aid=aid)
36
+ self._hk_driver = driver
37
+ self._accessory_id = name
38
+ self.logger = logging.getLogger(__name__)
39
+
40
+ if service_type == "dimminglight":
41
+ self.category = CATEGORY_LIGHTBULB
42
+ serv = self.add_preload_service("Lightbulb", chars=["On", "Brightness"])
43
+ # Note: Brightness setter_callback deferred to future update
44
+ elif service_type == "outlet":
45
+ self.category = CATEGORY_OUTLET
46
+ serv = self.add_preload_service("Outlet")
47
+ else:
48
+ self.category = CATEGORY_LIGHTBULB
49
+ serv = self.add_preload_service("Lightbulb")
50
+
51
+ self._char_on = serv.configure_char("On", setter_callback=self._set_on)
52
+
53
+ def _set_on(self, value: bool) -> None:
54
+ """
55
+ Handle HomeKit set on/off request.
56
+
57
+ Args:
58
+ value: True for on, False for off.
59
+ """
60
+ if self._hk_driver._on_set:
61
+ self._hk_driver._on_set(self._accessory_id, value)
62
+
63
+ def update_state(self, is_on: bool) -> None:
64
+ """
65
+ Update accessory state from Conbus event.
66
+
67
+ Args:
68
+ is_on: True if accessory is on, False otherwise.
69
+ """
70
+ self._char_on.set_value(is_on)
71
+
72
+
73
+ class HomekitAccessoryDriver:
74
+ """Wrapper around pyhap AccessoryDriver."""
75
+
76
+ def __init__(self, homekit_config: HomekitConfig) -> None:
77
+ """
78
+ Initialize the HomeKit accessory driver.
79
+
80
+ Args:
81
+ homekit_config: HomekitConfig with network and accessory settings.
82
+ """
83
+ self.logger = logging.getLogger(__name__)
84
+ self._homekit_config = homekit_config
85
+ self._driver: Optional[AccessoryDriver] = None
86
+ self._accessories: Dict[str, XPAccessory] = {}
87
+ self._on_set: Optional[Callable[[str, bool], None]] = None
88
+
89
+ def set_callback(self, on_set: Callable[[str, bool], None]) -> None:
90
+ """
91
+ Set callback for HomeKit set events.
92
+
93
+ Args:
94
+ on_set: Callback(accessory_name, is_on) called when HomeKit app toggles.
95
+ """
96
+ self._on_set = on_set
97
+
98
+ def _setup_bridge(self, config: HomekitConfig) -> None:
99
+ """
100
+ Set up HomeKit bridge with accessories.
101
+
102
+ Args:
103
+ config: HomekitConfig with accessory definitions.
104
+ """
105
+ assert self._driver is not None
106
+ bridge = Bridge(self._driver, config.bridge.name)
107
+ aid = 2 # Bridge is 1
108
+
109
+ for acc_config in config.accessories:
110
+ accessory = XPAccessory(
111
+ driver=self,
112
+ name=acc_config.name,
113
+ display_name=acc_config.description,
114
+ service_type=acc_config.service,
115
+ aid=aid,
116
+ )
117
+ bridge.add_accessory(accessory)
118
+ self._accessories[acc_config.name] = accessory
119
+ aid += 1
120
+
121
+ self._driver.add_accessory(bridge)
122
+
123
+ async def start(self) -> None:
124
+ """Start the AccessoryDriver (non-blocking)."""
125
+ try:
126
+ # Enable pyhap debug logging
127
+ pyhap_logger = logging.getLogger("pyhap")
128
+ pyhap_logger.setLevel(logging.DEBUG)
129
+
130
+ # Create driver with the running event loop
131
+ loop = asyncio.get_running_loop()
132
+ config = self._homekit_config
133
+ pincode = config.homekit.pincode.encode()
134
+ self.logger.info(
135
+ f"Starting HAP driver on {config.homekit.ip}:{config.homekit.port} with pincode {config.homekit.pincode}"
136
+ )
137
+ self._driver = AccessoryDriver(
138
+ loop=loop,
139
+ address=str(config.homekit.ip),
140
+ port=config.homekit.port,
141
+ pincode=pincode,
142
+ persist_file=config.homekit.accessory_state_file,
143
+ )
144
+ self._setup_bridge(config)
145
+ await self._driver.async_start()
146
+ self.logger.info("AccessoryDriver started successfully")
147
+ except Exception as e:
148
+ self.logger.error(f"Error starting AccessoryDriver: {e}", exc_info=True)
149
+
150
+ async def stop(self) -> None:
151
+ """Stop the AccessoryDriver."""
152
+ if not self._driver:
153
+ return
154
+ try:
155
+ await self._driver.async_stop()
156
+ self.logger.info("AccessoryDriver stopped successfully")
157
+ except Exception as e:
158
+ self.logger.error(f"Error stopping AccessoryDriver: {e}", exc_info=True)
159
+
160
+ def update_state(self, accessory_name: str, is_on: bool) -> None:
161
+ """
162
+ Update accessory state from Conbus event.
163
+
164
+ Args:
165
+ accessory_name: Accessory name to update.
166
+ is_on: True if accessory is on, False otherwise.
167
+ """
168
+ if acc := self._accessories.get(accessory_name):
169
+ acc.update_state(is_on)
170
+ else:
171
+ self.logger.warning(f"Unknown accessory name: {accessory_name}")