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.
- {conson_xp-0.11.21 → conson_xp-1.0.1}/PKG-INFO +1 -1
- {conson_xp-0.11.21 → conson_xp-1.0.1}/pyproject.toml +1 -1
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/__init__.py +1 -1
- conson_xp-1.0.1/src/xp/cli/commands/conbus/conbus_config_commands.py +24 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_linknumber_commands.py +24 -11
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_output_commands.py +44 -18
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus.py +12 -11
- conson_xp-1.0.1/src/xp/services/conbus/conbus_autoreport_get_service.py +85 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/conbus_datapoint_service.py +6 -1
- conson_xp-1.0.1/src/xp/services/conbus/conbus_lightlevel_get_service.py +101 -0
- conson_xp-1.0.1/src/xp/services/conbus/conbus_linknumber_get_service.py +86 -0
- 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
- conson_xp-1.0.1/src/xp/services/conbus/conbus_output_service.py +174 -0
- conson_xp-1.0.1/src/xp/services/conbus/conbus_scan_service.py +124 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/protocol/conbus_protocol.py +1 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/utils/dependencies.py +21 -44
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_conbus_linknumber_integration.py +30 -24
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_conbus.py +18 -11
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_conbus_linknumber_service.py +44 -47
- conson_xp-0.11.21/src/xp/cli/commands/conbus/conbus_config_commands.py +0 -33
- conson_xp-0.11.21/src/xp/services/conbus/conbus_connection_pool.py +0 -148
- conson_xp-0.11.21/src/xp/services/conbus/conbus_lightlevel_get_service.py +0 -149
- conson_xp-0.11.21/src/xp/services/conbus/conbus_linknumber_service.py +0 -197
- conson_xp-0.11.21/src/xp/services/conbus/conbus_output_service.py +0 -137
- conson_xp-0.11.21/src/xp/services/conbus/conbus_scan_service.py +0 -128
- conson_xp-0.11.21/src/xp/services/conbus/conbus_service.py +0 -306
- conson_xp-0.11.21/tests/unit/test_services/test_conbus_datapoint_service.py +0 -234
- conson_xp-0.11.21/tests/unit/test_services/test_conbus_service.py +0 -104
- conson_xp-0.11.21/tests/unit/test_utils/test_dependencies.py +0 -232
- {conson_xp-0.11.21 → conson_xp-1.0.1}/LICENSE +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/README.md +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/main.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/models/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/models/api.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/models/discover.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/routers/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/routers/conbus.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/routers/conbus_blink.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/routers/conbus_custom.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/routers/conbus_datapoint.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/routers/conbus_output.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/api/routers/errors.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/__main__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/api.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/api_start_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_actiontable_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_autoreport_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_blink_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_custom_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_datapoint_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_discover_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_lightlevel_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_msactiontable_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_raw_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_receive_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_scan_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/file_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/homekit/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/homekit/homekit.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/homekit/homekit_start_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/module_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/reverse_proxy_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/server/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/server/server_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/telegram/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/telegram/telegram.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/telegram/telegram_blink_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/telegram/telegram_checksum_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/telegram/telegram_discover_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/telegram/telegram_linknumber_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/telegram/telegram_parse_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/telegram/telegram_version_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/main.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/utils/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/utils/click_tree.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/utils/datapoint_type_choice.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/utils/decorators.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/utils/error_handlers.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/utils/formatters.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/utils/serial_number_type.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/utils/system_function_choice.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/utils/xp_module_type.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/connection/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/connection/exceptions.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/actiontable/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/actiontable/actiontable.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/actiontable/msactiontable_xp20.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/actiontable/msactiontable_xp24.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/actiontable/msactiontable_xp33.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_autoreport.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_blink.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_client_config.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_connection_status.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_custom.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_datapoint.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_discover.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_lightlevel.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_linknumber.py +1 -1
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_output.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_raw.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/conbus/conbus_receive.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/homekit/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/homekit/homekit_accessory.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/homekit/homekit_config.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/homekit/homekit_conson_config.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/log_entry.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/protocol/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/protocol/conbus_protocol.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/response.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/action_type.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/datapoint_type.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/event_telegram.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/event_type.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/input_action_type.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/input_type.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/module_type.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/module_type_code.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/output_telegram.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/reply_telegram.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/system_function.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/system_telegram.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/telegram.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/telegram_type.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/telegram/timeparam_type.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/models/write_config_type.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/actiontable/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/actiontable/actiontable_serializer.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/actiontable/actiontable_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/actiontable/msactiontable_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/actiontable/msactiontable_xp20_serializer.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/actiontable/msactiontable_xp24_serializer.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/actiontable/msactiontable_xp33_serializer.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/conbus_autoreport_set_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/conbus_blink_all_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/conbus_blink_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/conbus_custom_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/conbus_datapoint_queryall_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/conbus_discover_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/conbus_lightlevel_set_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/conbus_raw_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/conbus/conbus_receive_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_cache_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_conbus_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_config_validator.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_conson_validator.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_dimminglight.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_dimminglight_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_hap_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_lightbulb.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_lightbulb_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_module_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_outlet.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_outlet_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/homekit/homekit_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/log_file_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/module_type_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/protocol/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/protocol/protocol_factory.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/protocol/telegram_protocol.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/reverse_proxy_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/server/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/server/base_server_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/server/cp20_server_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/server/server_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/server/xp130_server_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/server/xp20_server_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/server/xp230_server_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/server/xp24_server_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/server/xp33_server_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/telegram/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/telegram/telegram_blink_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/telegram/telegram_checksum_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/telegram/telegram_discover_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/telegram/telegram_link_number_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/telegram/telegram_output_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/telegram/telegram_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/services/telegram/telegram_version_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/utils/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/utils/checksum.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/utils/event_helper.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/utils/serialization.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/utils/time_utils.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/.coverage +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/conftest.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/.coverage +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/telegram_test_data.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_actiontable_integration.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_api/.coverage +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_api/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_blink_integration.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_checksum_integration.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_conbus_autoreport_integration.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_conbus_blink_integration.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_conbus_datapoint_integration.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_conbus_lightlevel_integration.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_conbus_raw_integration.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_conbus_receive_integration.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_discovery_integration.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_event_telegram_integration.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_homekit_config_integration.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_link_number_integration.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_module_integration.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_output_integration.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_reverse_proxy_integration.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_system_reply_telegram_integration.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_version_integration.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_xp20_action_table_integration.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/integration/test_xp24_action_table_integration.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_api/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_cli/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_cli/test_click_tree.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_cli/test_conbus_actiontable_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_cli/test_conbus_blink_commands.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_cli/test_datapoint_type_choice.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_cli/test_decorators.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_cli/test_error_handlers.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_cli/test_formatters.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_cli/test_serial_number_type.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_cli/test_system_function_choice.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_connection/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_connection/test_connection_init.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_connection/test_exceptions.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_encoding/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_encoding/test_latin1_edge_cases.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_conbus_client_send.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_conbus_discover.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_conbus_linknumber.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_event_telegram.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_log_entry.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_module_type.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_reply_telegram.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_system_telegram.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_system_telegram_enhancements.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_version_telegram.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_write_config_type.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_xp20_action_table.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_xp24_action_table.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_models/test_xp24_action_telegram.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_actiontable_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_base_server_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_blink_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_checksum_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_conbus_blink_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_conbus_lightlevel_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_conbus_raw_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_conbus_reverse_proxy_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_discovery_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_homekit_cache_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_homekit_config_validator.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_homekit_conson_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_homekit_services.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_link_number_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_log_file_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_module_type_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_protocol.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_server_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_telegram_input_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_telegram_protocol.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_telegram_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_version_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_xp20_action_table_serializer.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_xp24_action_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_xp24_action_table_serializer.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_xp24_action_table_service.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_xp33_action_table_serializer.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_services/test_xp_server_services.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_utils/__init__.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_utils/test_checksum.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_utils/test_event_helper.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_utils/test_serialization.py +0 -0
- {conson_xp-0.11.21 → conson_xp-1.0.1}/tests/unit/test_utils/test_time_utils.py +0 -0
|
@@ -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))
|
{conson_xp-0.11.21 → conson_xp-1.0.1}/src/xp/cli/commands/conbus/conbus_linknumber_commands.py
RENAMED
|
@@ -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.
|
|
14
|
-
from xp.services.
|
|
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 =
|
|
36
|
+
service = (
|
|
37
|
+
ctx.obj.get("container").get_container().resolve(ConbusLinknumberSetService)
|
|
38
|
+
)
|
|
38
39
|
|
|
39
|
-
|
|
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 =
|
|
66
|
+
service = (
|
|
67
|
+
ctx.obj.get("container").get_container().resolve(ConbusLinknumberGetService)
|
|
68
|
+
)
|
|
61
69
|
|
|
62
|
-
|
|
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
|
|
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
|
-
|
|
35
|
+
def on_finish(response: ConbusOutputResponse) -> None:
|
|
36
|
+
click.echo(json.dumps(response.to_dict(), indent=2))
|
|
32
37
|
|
|
33
|
-
|
|
34
|
-
|
|
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
|
|
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
|
-
|
|
62
|
+
def on_finish(response: ConbusOutputResponse) -> None:
|
|
63
|
+
click.echo(json.dumps(response.to_dict(), indent=2))
|
|
55
64
|
|
|
56
|
-
|
|
57
|
-
|
|
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 =
|
|
75
|
-
|
|
76
|
-
|
|
86
|
+
service: ConbusDatapointService = (
|
|
87
|
+
ctx.obj.get("container").get_container().resolve(ConbusDatapointService)
|
|
88
|
+
)
|
|
77
89
|
|
|
78
|
-
|
|
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 =
|
|
113
|
+
service: ConbusDatapointService = (
|
|
114
|
+
ctx.obj.get("container").get_container().resolve(ConbusDatapointService)
|
|
115
|
+
)
|
|
95
116
|
|
|
96
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
error:
|
|
39
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
"
|
|
52
|
-
"
|
|
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()
|