conson-xp 1.2.0__tar.gz → 1.4.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.
- {conson_xp-1.2.0 → conson_xp-1.4.0}/PKG-INFO +1 -5
- {conson_xp-1.2.0 → conson_xp-1.4.0}/README.md +0 -4
- {conson_xp-1.2.0 → conson_xp-1.4.0}/pyproject.toml +1 -1
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/__init__.py +1 -1
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/__init__.py +0 -2
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/conbus/conbus_actiontable_commands.py +5 -3
- conson_xp-1.4.0/src/xp/cli/commands/conbus/conbus_autoreport_commands.py +108 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/conbus/conbus_blink_commands.py +8 -8
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/conbus/conbus_config_commands.py +3 -1
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/conbus/conbus_custom_commands.py +3 -1
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/conbus/conbus_datapoint_commands.py +4 -2
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/conbus/conbus_discover_commands.py +5 -3
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/conbus/conbus_lightlevel_commands.py +68 -32
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/conbus/conbus_linknumber_commands.py +32 -17
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/conbus/conbus_msactiontable_commands.py +11 -4
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/conbus/conbus_output_commands.py +6 -2
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/conbus/conbus_receive_commands.py +5 -3
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/file_commands.py +9 -3
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/homekit/homekit_start_commands.py +3 -1
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/module_commands.py +12 -4
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/reverse_proxy_commands.py +3 -1
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/main.py +0 -2
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/conbus/conbus_datapoint.py +3 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/conbus/conbus_discover.py +19 -3
- conson_xp-1.4.0/src/xp/models/conbus/conbus_writeconfig.py +60 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/telegram/system_telegram.py +4 -4
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/conbus/conbus_datapoint_service.py +9 -6
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/conbus/conbus_discover_service.py +120 -2
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/conbus/conbus_scan_service.py +1 -1
- conson_xp-1.2.0/src/xp/services/conbus/conbus_linknumber_set_service.py → conson_xp-1.4.0/src/xp/services/conbus/write_config_service.py +78 -66
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/protocol/telegram_protocol.py +4 -4
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/server/base_server_service.py +9 -4
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/server/cp20_server_service.py +2 -1
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/server/server_service.py +75 -4
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/server/xp130_server_service.py +2 -1
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/server/xp20_server_service.py +2 -1
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/server/xp230_server_service.py +2 -1
- conson_xp-1.4.0/src/xp/services/server/xp24_server_service.py +192 -0
- conson_xp-1.4.0/src/xp/services/server/xp33_server_service.py +306 -0
- conson_xp-1.4.0/src/xp/services/telegram/telegram_datapoint_service.py +70 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/utils/dependencies.py +4 -46
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/integration/test_conbus_datapoint_integration.py +1 -1
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_models/test_conbus_discover.py +28 -2
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_base_server_service.py +4 -3
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_xp_server_services.py +7 -7
- conson_xp-1.2.0/src/xp/api/__init__.py +0 -1
- conson_xp-1.2.0/src/xp/api/main.py +0 -125
- conson_xp-1.2.0/src/xp/api/models/__init__.py +0 -1
- conson_xp-1.2.0/src/xp/api/models/api.py +0 -31
- conson_xp-1.2.0/src/xp/api/models/discover.py +0 -31
- conson_xp-1.2.0/src/xp/api/routers/__init__.py +0 -17
- conson_xp-1.2.0/src/xp/api/routers/conbus.py +0 -5
- conson_xp-1.2.0/src/xp/api/routers/conbus_blink.py +0 -117
- conson_xp-1.2.0/src/xp/api/routers/conbus_custom.py +0 -71
- conson_xp-1.2.0/src/xp/api/routers/conbus_datapoint.py +0 -74
- conson_xp-1.2.0/src/xp/api/routers/conbus_output.py +0 -167
- conson_xp-1.2.0/src/xp/api/routers/errors.py +0 -38
- conson_xp-1.2.0/src/xp/cli/commands/api.py +0 -12
- conson_xp-1.2.0/src/xp/cli/commands/api_start_commands.py +0 -132
- conson_xp-1.2.0/src/xp/cli/commands/conbus/conbus_autoreport_commands.py +0 -90
- conson_xp-1.2.0/src/xp/services/conbus/conbus_autoreport_get_service.py +0 -94
- conson_xp-1.2.0/src/xp/services/conbus/conbus_autoreport_set_service.py +0 -141
- conson_xp-1.2.0/src/xp/services/conbus/conbus_lightlevel_get_service.py +0 -109
- conson_xp-1.2.0/src/xp/services/conbus/conbus_lightlevel_set_service.py +0 -225
- conson_xp-1.2.0/src/xp/services/conbus/conbus_linknumber_get_service.py +0 -94
- conson_xp-1.2.0/src/xp/services/server/xp24_server_service.py +0 -119
- conson_xp-1.2.0/src/xp/services/server/xp33_server_service.py +0 -176
- conson_xp-1.2.0/tests/integration/test_conbus_autoreport_integration.py +0 -359
- conson_xp-1.2.0/tests/integration/test_conbus_lightlevel_integration.py +0 -258
- conson_xp-1.2.0/tests/integration/test_conbus_linknumber_integration.py +0 -394
- conson_xp-1.2.0/tests/unit/test_services/test_conbus_lightlevel_service.py +0 -187
- conson_xp-1.2.0/tests/unit/test_services/test_conbus_linknumber_service.py +0 -392
- conson_xp-1.2.0/tests/unit/test_services/test_link_number_service.py +0 -229
- {conson_xp-1.2.0 → conson_xp-1.4.0}/LICENSE +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/__main__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/conbus/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/conbus/conbus.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/conbus/conbus_raw_commands.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/conbus/conbus_scan_commands.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/homekit/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/homekit/homekit.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/server/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/server/server_commands.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/telegram/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/telegram/telegram.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/telegram/telegram_blink_commands.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/telegram/telegram_checksum_commands.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/telegram/telegram_discover_commands.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/telegram/telegram_linknumber_commands.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/telegram/telegram_parse_commands.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/telegram/telegram_version_commands.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/utils/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/utils/click_tree.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/utils/datapoint_type_choice.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/utils/decorators.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/utils/error_handlers.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/utils/formatters.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/utils/serial_number_type.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/utils/system_function_choice.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/utils/xp_module_type.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/connection/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/connection/exceptions.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/actiontable/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/actiontable/actiontable.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/actiontable/msactiontable_xp20.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/actiontable/msactiontable_xp24.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/actiontable/msactiontable_xp33.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/conbus/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/conbus/conbus.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/conbus/conbus_autoreport.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/conbus/conbus_blink.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/conbus/conbus_client_config.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/conbus/conbus_connection_status.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/conbus/conbus_custom.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/conbus/conbus_lightlevel.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/conbus/conbus_linknumber.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/conbus/conbus_output.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/conbus/conbus_raw.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/conbus/conbus_receive.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/homekit/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/homekit/homekit_accessory.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/homekit/homekit_config.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/homekit/homekit_conson_config.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/log_entry.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/protocol/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/protocol/conbus_protocol.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/response.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/telegram/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/telegram/action_type.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/telegram/datapoint_type.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/telegram/event_telegram.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/telegram/event_type.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/telegram/input_action_type.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/telegram/input_type.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/telegram/module_type.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/telegram/module_type_code.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/telegram/output_telegram.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/telegram/reply_telegram.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/telegram/system_function.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/telegram/telegram.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/telegram/telegram_type.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/telegram/timeparam_type.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/models/write_config_type.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/conbus/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/conbus/actiontable/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/conbus/actiontable/actiontable_serializer.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/conbus/actiontable/actiontable_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/conbus/actiontable/msactiontable_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/conbus/actiontable/msactiontable_xp20_serializer.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/conbus/actiontable/msactiontable_xp24_serializer.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/conbus/actiontable/msactiontable_xp33_serializer.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/conbus/conbus_blink_all_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/conbus/conbus_blink_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/conbus/conbus_custom_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/conbus/conbus_datapoint_queryall_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/conbus/conbus_output_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/conbus/conbus_raw_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/conbus/conbus_receive_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/homekit/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/homekit/homekit_cache_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/homekit/homekit_conbus_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/homekit/homekit_config_validator.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/homekit/homekit_conson_validator.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/homekit/homekit_dimminglight.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/homekit/homekit_dimminglight_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/homekit/homekit_hap_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/homekit/homekit_lightbulb.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/homekit/homekit_lightbulb_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/homekit/homekit_module_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/homekit/homekit_outlet.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/homekit/homekit_outlet_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/homekit/homekit_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/log_file_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/module_type_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/protocol/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/protocol/conbus_protocol.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/protocol/protocol_factory.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/reverse_proxy_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/server/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/telegram/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/telegram/telegram_blink_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/telegram/telegram_checksum_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/telegram/telegram_discover_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/telegram/telegram_link_number_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/telegram/telegram_output_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/telegram/telegram_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/services/telegram/telegram_version_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/utils/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/utils/checksum.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/utils/event_helper.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/utils/serialization.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/utils/time_utils.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/.coverage +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/conftest.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/integration/.coverage +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/integration/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/integration/telegram_test_data.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/integration/test_actiontable_integration.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/integration/test_api/.coverage +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/integration/test_api/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/integration/test_blink_integration.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/integration/test_checksum_integration.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/integration/test_conbus_blink_integration.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/integration/test_conbus_raw_integration.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/integration/test_conbus_receive_integration.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/integration/test_discovery_integration.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/integration/test_event_telegram_integration.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/integration/test_homekit_config_integration.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/integration/test_link_number_integration.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/integration/test_module_integration.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/integration/test_output_integration.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/integration/test_reverse_proxy_integration.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/integration/test_system_reply_telegram_integration.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/integration/test_version_integration.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/integration/test_xp20_action_table_integration.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/integration/test_xp24_action_table_integration.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_api/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_cli/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_cli/test_click_tree.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_cli/test_conbus_actiontable_commands.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_cli/test_conbus_blink_commands.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_cli/test_datapoint_type_choice.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_cli/test_decorators.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_cli/test_error_handlers.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_cli/test_formatters.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_cli/test_serial_number_type.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_cli/test_system_function_choice.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_connection/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_connection/test_connection_init.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_connection/test_exceptions.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_encoding/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_encoding/test_latin1_edge_cases.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_models/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_models/test_conbus.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_models/test_conbus_client_send.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_models/test_conbus_linknumber.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_models/test_event_telegram.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_models/test_log_entry.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_models/test_module_type.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_models/test_reply_telegram.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_models/test_system_telegram.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_models/test_system_telegram_enhancements.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_models/test_version_telegram.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_models/test_write_config_type.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_models/test_xp20_action_table.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_models/test_xp24_action_table.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_models/test_xp24_action_telegram.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_actiontable_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_blink_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_checksum_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_conbus_blink_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_conbus_raw_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_conbus_reverse_proxy_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_discovery_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_homekit_cache_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_homekit_config_validator.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_homekit_conson_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_homekit_services.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_log_file_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_module_type_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_protocol.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_server_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_telegram_input_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_telegram_protocol.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_telegram_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_version_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_xp20_action_table_serializer.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_xp24_action_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_xp24_action_table_serializer.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_xp24_action_table_service.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_services/test_xp33_action_table_serializer.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_utils/__init__.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_utils/test_checksum.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_utils/test_event_helper.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.0}/tests/unit/test_utils/test_serialization.py +0 -0
- {conson_xp-1.2.0 → conson_xp-1.4.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.
|
|
3
|
+
Version: 1.4.0
|
|
4
4
|
Summary: XP Protocol Communication Tools
|
|
5
5
|
Author-Email: ldvchosal <ldvchosal@github.com>
|
|
6
6
|
License: MIT License
|
|
@@ -272,10 +272,6 @@ src/xp/
|
|
|
272
272
|
|
|
273
273
|
xp
|
|
274
274
|
|
|
275
|
-
xp api
|
|
276
|
-
xp api start
|
|
277
|
-
|
|
278
|
-
|
|
279
275
|
xp conbus
|
|
280
276
|
|
|
281
277
|
xp conbus actiontable
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Command modules for XP CLI."""
|
|
2
2
|
|
|
3
3
|
# Main command groups
|
|
4
|
-
from xp.cli.commands.api_start_commands import start_api_server
|
|
5
4
|
|
|
6
5
|
# Import conbus command groups (but not 'conbus' itself to avoid module shadowing in Python 3.10)
|
|
7
6
|
from xp.cli.commands.conbus.conbus import (
|
|
@@ -100,7 +99,6 @@ __all__ = [
|
|
|
100
99
|
"linknumber",
|
|
101
100
|
"blink",
|
|
102
101
|
"checksum",
|
|
103
|
-
"start_api_server",
|
|
104
102
|
"homekit",
|
|
105
103
|
"homekit_start",
|
|
106
104
|
# Individual command functions
|
{conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/conbus/conbus_actiontable_commands.py
RENAMED
|
@@ -28,7 +28,9 @@ def conbus_download_actiontable(ctx: Context, serial_number: str) -> None:
|
|
|
28
28
|
ctx: Click context object.
|
|
29
29
|
serial_number: 10-digit module serial number.
|
|
30
30
|
"""
|
|
31
|
-
service =
|
|
31
|
+
service: ActionTableService = (
|
|
32
|
+
ctx.obj.get("container").get_container().resolve(ActionTableService)
|
|
33
|
+
)
|
|
32
34
|
|
|
33
35
|
def progress_callback(progress: str) -> None:
|
|
34
36
|
"""Handle progress updates during action table download.
|
|
@@ -38,7 +40,7 @@ def conbus_download_actiontable(ctx: Context, serial_number: str) -> None:
|
|
|
38
40
|
"""
|
|
39
41
|
click.echo(progress)
|
|
40
42
|
|
|
41
|
-
def
|
|
43
|
+
def on_finish(actiontable: ActionTable) -> None:
|
|
42
44
|
"""Handle successful completion of action table download.
|
|
43
45
|
|
|
44
46
|
Args:
|
|
@@ -62,6 +64,6 @@ def conbus_download_actiontable(ctx: Context, serial_number: str) -> None:
|
|
|
62
64
|
service.start(
|
|
63
65
|
serial_number=serial_number,
|
|
64
66
|
progress_callback=progress_callback,
|
|
65
|
-
finish_callback=
|
|
67
|
+
finish_callback=on_finish,
|
|
66
68
|
error_callback=error_callback,
|
|
67
69
|
)
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"""Conbus auto report CLI commands."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
|
|
5
|
+
import click
|
|
6
|
+
from click import Context
|
|
7
|
+
|
|
8
|
+
from xp.cli.commands.conbus.conbus import conbus_autoreport
|
|
9
|
+
from xp.cli.utils.decorators import (
|
|
10
|
+
connection_command,
|
|
11
|
+
)
|
|
12
|
+
from xp.cli.utils.serial_number_type import SERIAL
|
|
13
|
+
from xp.models import ConbusDatapointResponse
|
|
14
|
+
from xp.models.conbus.conbus_writeconfig import ConbusWriteConfigResponse
|
|
15
|
+
from xp.models.telegram.datapoint_type import DataPointType
|
|
16
|
+
from xp.services.conbus.conbus_datapoint_service import ConbusDatapointService
|
|
17
|
+
from xp.services.conbus.write_config_service import WriteConfigService
|
|
18
|
+
from xp.services.telegram.telegram_datapoint_service import TelegramDatapointService
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@conbus_autoreport.command("get", short_help="Get auto report status for a module")
|
|
22
|
+
@click.argument("serial_number", type=SERIAL)
|
|
23
|
+
@connection_command()
|
|
24
|
+
@click.pass_context
|
|
25
|
+
def get_autoreport_command(ctx: Context, serial_number: str) -> None:
|
|
26
|
+
r"""Get the current auto report status for a specific module.
|
|
27
|
+
|
|
28
|
+
Args:
|
|
29
|
+
ctx: Click context object.
|
|
30
|
+
serial_number: 10-digit module serial number.
|
|
31
|
+
|
|
32
|
+
Examples:
|
|
33
|
+
\b
|
|
34
|
+
xp conbus autoreport get 0123450001
|
|
35
|
+
"""
|
|
36
|
+
# Get service from container
|
|
37
|
+
service: ConbusDatapointService = (
|
|
38
|
+
ctx.obj.get("container").get_container().resolve(ConbusDatapointService)
|
|
39
|
+
)
|
|
40
|
+
telegram_service: TelegramDatapointService = (
|
|
41
|
+
ctx.obj.get("container").get_container().resolve(TelegramDatapointService)
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
def on_finish(service_response: ConbusDatapointResponse) -> None:
|
|
45
|
+
"""Handle successful completion of auto report status retrieval.
|
|
46
|
+
|
|
47
|
+
Args:
|
|
48
|
+
service_response: Auto report response object.
|
|
49
|
+
"""
|
|
50
|
+
auto_report_status = telegram_service.get_autoreport_status(
|
|
51
|
+
service_response.data_value
|
|
52
|
+
)
|
|
53
|
+
result = service_response.to_dict()
|
|
54
|
+
result["auto_report_status"] = auto_report_status
|
|
55
|
+
click.echo(json.dumps(result, indent=2))
|
|
56
|
+
|
|
57
|
+
with service:
|
|
58
|
+
service.query_datapoint(
|
|
59
|
+
serial_number=serial_number,
|
|
60
|
+
datapoint_type=DataPointType.AUTO_REPORT_STATUS,
|
|
61
|
+
finish_callback=on_finish,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
@conbus_autoreport.command("set", short_help="Set auto report status for a module")
|
|
66
|
+
@click.argument("serial_number", type=SERIAL)
|
|
67
|
+
@click.argument("status", type=click.Choice(["on", "off"], case_sensitive=False))
|
|
68
|
+
@connection_command()
|
|
69
|
+
@click.pass_context
|
|
70
|
+
def set_autoreport_command(ctx: Context, serial_number: str, status: str) -> None:
|
|
71
|
+
r"""Set the auto report status for a specific module.
|
|
72
|
+
|
|
73
|
+
Args:
|
|
74
|
+
ctx: Click context object.
|
|
75
|
+
serial_number: 10-digit module serial number.
|
|
76
|
+
status: Auto report status - either 'on' or 'off'.
|
|
77
|
+
|
|
78
|
+
Examples:
|
|
79
|
+
\b
|
|
80
|
+
xp conbus autoreport set 0123450001 on
|
|
81
|
+
xp conbus autoreport set 0123450001 off
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
def on_finish(response: "ConbusWriteConfigResponse") -> None:
|
|
85
|
+
"""Handle successful completion of light level on command.
|
|
86
|
+
|
|
87
|
+
Args:
|
|
88
|
+
response: Light level response object.
|
|
89
|
+
"""
|
|
90
|
+
click.echo(json.dumps(response.to_dict(), indent=2))
|
|
91
|
+
|
|
92
|
+
service: WriteConfigService = (
|
|
93
|
+
ctx.obj.get("container").get_container().resolve(WriteConfigService)
|
|
94
|
+
)
|
|
95
|
+
telegram_service: TelegramDatapointService = (
|
|
96
|
+
ctx.obj.get("container").get_container().resolve(TelegramDatapointService)
|
|
97
|
+
)
|
|
98
|
+
status_value = True if status == "on" else False
|
|
99
|
+
data_value = telegram_service.get_autoreport_status_data_value(status_value)
|
|
100
|
+
|
|
101
|
+
with service:
|
|
102
|
+
service.write_config(
|
|
103
|
+
serial_number=serial_number,
|
|
104
|
+
datapoint_type=DataPointType.AUTO_REPORT_STATUS,
|
|
105
|
+
data_value=data_value,
|
|
106
|
+
finish_callback=on_finish,
|
|
107
|
+
timeout_seconds=0.5,
|
|
108
|
+
)
|
|
@@ -34,7 +34,7 @@ def send_blink_on_telegram(ctx: Context, serial_number: str) -> None:
|
|
|
34
34
|
xp conbus blink on 0012345008
|
|
35
35
|
"""
|
|
36
36
|
|
|
37
|
-
def
|
|
37
|
+
def on_finish(service_response: ConbusBlinkResponse) -> None:
|
|
38
38
|
"""Handle successful completion of blink on command.
|
|
39
39
|
|
|
40
40
|
Args:
|
|
@@ -46,7 +46,7 @@ def send_blink_on_telegram(ctx: Context, serial_number: str) -> None:
|
|
|
46
46
|
ctx.obj.get("container").get_container().resolve(ConbusBlinkService)
|
|
47
47
|
)
|
|
48
48
|
with service:
|
|
49
|
-
service.send_blink_telegram(serial_number, "on",
|
|
49
|
+
service.send_blink_telegram(serial_number, "on", on_finish, 0.5)
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
@conbus_blink.command("off")
|
|
@@ -66,7 +66,7 @@ def send_blink_off_telegram(ctx: Context, serial_number: str) -> None:
|
|
|
66
66
|
xp conbus blink off 0012345008
|
|
67
67
|
"""
|
|
68
68
|
|
|
69
|
-
def
|
|
69
|
+
def on_finish(service_response: ConbusBlinkResponse) -> None:
|
|
70
70
|
"""Handle successful completion of blink off command.
|
|
71
71
|
|
|
72
72
|
Args:
|
|
@@ -78,7 +78,7 @@ def send_blink_off_telegram(ctx: Context, serial_number: str) -> None:
|
|
|
78
78
|
ctx.obj.get("container").get_container().resolve(ConbusBlinkService)
|
|
79
79
|
)
|
|
80
80
|
with service:
|
|
81
|
-
service.send_blink_telegram(serial_number, "off",
|
|
81
|
+
service.send_blink_telegram(serial_number, "off", on_finish, 0.5)
|
|
82
82
|
|
|
83
83
|
|
|
84
84
|
@conbus_blink.group("all", short_help="Control blink state for all devices")
|
|
@@ -102,7 +102,7 @@ def blink_all_off(ctx: Context) -> None:
|
|
|
102
102
|
xp conbus blink all off
|
|
103
103
|
"""
|
|
104
104
|
|
|
105
|
-
def
|
|
105
|
+
def on_finish(discovered_devices: ConbusBlinkResponse) -> None:
|
|
106
106
|
"""Handle successful completion of blink all off command.
|
|
107
107
|
|
|
108
108
|
Args:
|
|
@@ -122,7 +122,7 @@ def blink_all_off(ctx: Context) -> None:
|
|
|
122
122
|
ctx.obj.get("container").get_container().resolve(ConbusBlinkAllService)
|
|
123
123
|
)
|
|
124
124
|
with service:
|
|
125
|
-
service.send_blink_all_telegram("off", progress,
|
|
125
|
+
service.send_blink_all_telegram("off", progress, on_finish, 0.5)
|
|
126
126
|
|
|
127
127
|
|
|
128
128
|
@conbus_blink_all.command("on", short_help="Turn on blinking for all devices")
|
|
@@ -140,7 +140,7 @@ def blink_all_on(ctx: Context) -> None:
|
|
|
140
140
|
xp conbus blink all on
|
|
141
141
|
"""
|
|
142
142
|
|
|
143
|
-
def
|
|
143
|
+
def on_finish(discovered_devices: ConbusBlinkResponse) -> None:
|
|
144
144
|
"""Handle successful completion of blink all on command.
|
|
145
145
|
|
|
146
146
|
Args:
|
|
@@ -160,4 +160,4 @@ def blink_all_on(ctx: Context) -> None:
|
|
|
160
160
|
ctx.obj.get("container").get_container().resolve(ConbusBlinkAllService)
|
|
161
161
|
)
|
|
162
162
|
with service:
|
|
163
|
-
service.send_blink_all_telegram("on", progress,
|
|
163
|
+
service.send_blink_all_telegram("on", progress, on_finish, 0.5)
|
|
@@ -23,5 +23,7 @@ def show_config(ctx: Context) -> None:
|
|
|
23
23
|
\b
|
|
24
24
|
xp conbus config
|
|
25
25
|
"""
|
|
26
|
-
config =
|
|
26
|
+
config: ConbusClientConfig = (
|
|
27
|
+
ctx.obj.get("container").get_container().resolve(ConbusClientConfig)
|
|
28
|
+
)
|
|
27
29
|
click.echo(json.dumps(config.conbus.model_dump(mode="json"), indent=2))
|
|
@@ -36,7 +36,9 @@ def send_custom_telegram(
|
|
|
36
36
|
xp conbus custom 0012345011 02 E2
|
|
37
37
|
xp conbus custom 0012345011 17 AA
|
|
38
38
|
"""
|
|
39
|
-
service =
|
|
39
|
+
service: ConbusCustomService = (
|
|
40
|
+
ctx.obj.get("container").get_container().resolve(ConbusCustomService)
|
|
41
|
+
)
|
|
40
42
|
|
|
41
43
|
def on_finish(service_response: "ConbusCustomResponse") -> None:
|
|
42
44
|
"""Handle successful completion of custom telegram.
|
|
@@ -45,7 +45,9 @@ def query_datapoint(ctx: Context, serial_number: str, datapoint: DataPointType)
|
|
|
45
45
|
xp conbus datapoint query current 0012345011
|
|
46
46
|
xp conbus datapoint query humidity 0012345011
|
|
47
47
|
"""
|
|
48
|
-
service =
|
|
48
|
+
service: ConbusDatapointService = (
|
|
49
|
+
ctx.obj.get("container").get_container().resolve(ConbusDatapointService)
|
|
50
|
+
)
|
|
49
51
|
|
|
50
52
|
def on_finish(service_response: ConbusDatapointResponse) -> None:
|
|
51
53
|
"""Handle successful completion of datapoint query.
|
|
@@ -83,7 +85,7 @@ def query_all_datapoints(ctx: Context, serial_number: str) -> None:
|
|
|
83
85
|
\b
|
|
84
86
|
xp conbus datapoint all 0123450001
|
|
85
87
|
"""
|
|
86
|
-
service = (
|
|
88
|
+
service: ConbusDatapointQueryAllService = (
|
|
87
89
|
ctx.obj.get("container").get_container().resolve(ConbusDatapointQueryAllService)
|
|
88
90
|
)
|
|
89
91
|
|
|
@@ -28,7 +28,7 @@ def send_discover_telegram(ctx: click.Context) -> None:
|
|
|
28
28
|
xp conbus discover
|
|
29
29
|
"""
|
|
30
30
|
|
|
31
|
-
def
|
|
31
|
+
def on_finish(discovered_devices: ConbusDiscoverResponse) -> None:
|
|
32
32
|
"""Handle successful completion of device discovery.
|
|
33
33
|
|
|
34
34
|
Args:
|
|
@@ -45,6 +45,8 @@ def send_discover_telegram(ctx: click.Context) -> None:
|
|
|
45
45
|
# click.echo(f"Discovered : {serial_number}")
|
|
46
46
|
pass
|
|
47
47
|
|
|
48
|
-
service =
|
|
48
|
+
service: ConbusDiscoverService = (
|
|
49
|
+
ctx.obj.get("container").get_container().resolve(ConbusDiscoverService)
|
|
50
|
+
)
|
|
49
51
|
with service:
|
|
50
|
-
service.start(progress,
|
|
52
|
+
service.start(progress, on_finish, 0.5)
|
{conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/conbus/conbus_lightlevel_commands.py
RENAMED
|
@@ -7,14 +7,14 @@ import click
|
|
|
7
7
|
from xp.cli.commands.conbus.conbus import conbus_lightlevel
|
|
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.models
|
|
14
|
-
from xp.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
from xp.models import ConbusDatapointResponse
|
|
13
|
+
from xp.models.conbus.conbus_writeconfig import ConbusWriteConfigResponse
|
|
14
|
+
from xp.models.telegram.datapoint_type import DataPointType
|
|
15
|
+
from xp.services.conbus.conbus_datapoint_service import ConbusDatapointService
|
|
16
|
+
from xp.services.conbus.write_config_service import WriteConfigService
|
|
17
|
+
from xp.services.telegram.telegram_datapoint_service import TelegramDatapointService
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
@conbus_lightlevel.command("set")
|
|
@@ -23,7 +23,6 @@ from xp.services.conbus.conbus_lightlevel_set_service import (
|
|
|
23
23
|
@click.argument("level", type=click.IntRange(0, 100))
|
|
24
24
|
@click.pass_context
|
|
25
25
|
@connection_command()
|
|
26
|
-
@handle_service_errors(ConbusLightlevelError)
|
|
27
26
|
def xp_lightlevel_set(
|
|
28
27
|
ctx: click.Context, serial_number: str, output_number: int, level: int
|
|
29
28
|
) -> None:
|
|
@@ -41,20 +40,28 @@ def xp_lightlevel_set(
|
|
|
41
40
|
xp conbus lightlevel set 0011223344 0 100 # Set output 0 to 100%
|
|
42
41
|
"""
|
|
43
42
|
|
|
44
|
-
def
|
|
45
|
-
"""Handle successful completion of light level
|
|
43
|
+
def on_finish(response: "ConbusWriteConfigResponse") -> None:
|
|
44
|
+
"""Handle successful completion of light level on command.
|
|
46
45
|
|
|
47
46
|
Args:
|
|
48
47
|
response: Light level response object.
|
|
49
48
|
"""
|
|
50
49
|
click.echo(json.dumps(response.to_dict(), indent=2))
|
|
51
50
|
|
|
52
|
-
service = (
|
|
53
|
-
ctx.obj.get("container").get_container().resolve(
|
|
51
|
+
service: WriteConfigService = (
|
|
52
|
+
ctx.obj.get("container").get_container().resolve(WriteConfigService)
|
|
54
53
|
)
|
|
55
54
|
|
|
55
|
+
data_value = f"{output_number:02d}:{level:03d}"
|
|
56
|
+
|
|
56
57
|
with service:
|
|
57
|
-
service.
|
|
58
|
+
service.write_config(
|
|
59
|
+
serial_number=serial_number,
|
|
60
|
+
datapoint_type=DataPointType.MODULE_LIGHT_LEVEL,
|
|
61
|
+
data_value=data_value,
|
|
62
|
+
finish_callback=on_finish,
|
|
63
|
+
timeout_seconds=0.5,
|
|
64
|
+
)
|
|
58
65
|
|
|
59
66
|
|
|
60
67
|
@conbus_lightlevel.command("off")
|
|
@@ -62,7 +69,6 @@ def xp_lightlevel_set(
|
|
|
62
69
|
@click.argument("output_number", type=click.IntRange(0, 8))
|
|
63
70
|
@click.pass_context
|
|
64
71
|
@connection_command()
|
|
65
|
-
@handle_service_errors(ConbusLightlevelError)
|
|
66
72
|
def xp_lightlevel_off(
|
|
67
73
|
ctx: click.Context, serial_number: str, output_number: int
|
|
68
74
|
) -> None:
|
|
@@ -79,20 +85,29 @@ def xp_lightlevel_off(
|
|
|
79
85
|
xp conbus lightlevel off 0011223344 0 # Turn off output 0
|
|
80
86
|
"""
|
|
81
87
|
|
|
82
|
-
def
|
|
83
|
-
"""Handle successful completion of light level
|
|
88
|
+
def on_finish(response: "ConbusWriteConfigResponse") -> None:
|
|
89
|
+
"""Handle successful completion of light level on command.
|
|
84
90
|
|
|
85
91
|
Args:
|
|
86
92
|
response: Light level response object.
|
|
87
93
|
"""
|
|
88
94
|
click.echo(json.dumps(response.to_dict(), indent=2))
|
|
89
95
|
|
|
90
|
-
service = (
|
|
91
|
-
ctx.obj.get("container").get_container().resolve(
|
|
96
|
+
service: WriteConfigService = (
|
|
97
|
+
ctx.obj.get("container").get_container().resolve(WriteConfigService)
|
|
92
98
|
)
|
|
93
99
|
|
|
100
|
+
level = 0
|
|
101
|
+
data_value = f"{output_number:02d}:{level:03d}"
|
|
102
|
+
|
|
94
103
|
with service:
|
|
95
|
-
service.
|
|
104
|
+
service.write_config(
|
|
105
|
+
serial_number=serial_number,
|
|
106
|
+
datapoint_type=DataPointType.MODULE_LIGHT_LEVEL,
|
|
107
|
+
data_value=data_value,
|
|
108
|
+
finish_callback=on_finish,
|
|
109
|
+
timeout_seconds=0.5,
|
|
110
|
+
)
|
|
96
111
|
|
|
97
112
|
|
|
98
113
|
@conbus_lightlevel.command("on")
|
|
@@ -100,7 +115,6 @@ def xp_lightlevel_off(
|
|
|
100
115
|
@click.argument("output_number", type=click.IntRange(0, 8))
|
|
101
116
|
@click.pass_context
|
|
102
117
|
@connection_command()
|
|
103
|
-
@handle_service_errors(ConbusLightlevelError)
|
|
104
118
|
def xp_lightlevel_on(
|
|
105
119
|
ctx: click.Context, serial_number: str, output_number: int
|
|
106
120
|
) -> None:
|
|
@@ -117,7 +131,7 @@ def xp_lightlevel_on(
|
|
|
117
131
|
xp conbus lightlevel on 0011223344 0 # Turn on output 0 (80%)
|
|
118
132
|
"""
|
|
119
133
|
|
|
120
|
-
def
|
|
134
|
+
def on_finish(response: "ConbusWriteConfigResponse") -> None:
|
|
121
135
|
"""Handle successful completion of light level on command.
|
|
122
136
|
|
|
123
137
|
Args:
|
|
@@ -125,12 +139,21 @@ def xp_lightlevel_on(
|
|
|
125
139
|
"""
|
|
126
140
|
click.echo(json.dumps(response.to_dict(), indent=2))
|
|
127
141
|
|
|
128
|
-
service = (
|
|
129
|
-
ctx.obj.get("container").get_container().resolve(
|
|
142
|
+
service: WriteConfigService = (
|
|
143
|
+
ctx.obj.get("container").get_container().resolve(WriteConfigService)
|
|
130
144
|
)
|
|
131
145
|
|
|
146
|
+
level = 60
|
|
147
|
+
data_value = f"{output_number:02d}:{level:03d}"
|
|
148
|
+
|
|
132
149
|
with service:
|
|
133
|
-
service.
|
|
150
|
+
service.write_config(
|
|
151
|
+
serial_number=serial_number,
|
|
152
|
+
datapoint_type=DataPointType.MODULE_LIGHT_LEVEL,
|
|
153
|
+
data_value=data_value,
|
|
154
|
+
finish_callback=on_finish,
|
|
155
|
+
timeout_seconds=0.5,
|
|
156
|
+
)
|
|
134
157
|
|
|
135
158
|
|
|
136
159
|
@conbus_lightlevel.command("get")
|
|
@@ -138,7 +161,6 @@ def xp_lightlevel_on(
|
|
|
138
161
|
@click.argument("output_number", type=click.IntRange(0, 8))
|
|
139
162
|
@click.pass_context
|
|
140
163
|
@connection_command()
|
|
141
|
-
@handle_service_errors(ConbusLightlevelError)
|
|
142
164
|
def xp_lightlevel_get(
|
|
143
165
|
ctx: click.Context, serial_number: str, output_number: int
|
|
144
166
|
) -> None:
|
|
@@ -154,18 +176,32 @@ def xp_lightlevel_get(
|
|
|
154
176
|
xp conbus lightlevel get 0123450001 2 # Get light level for output 2
|
|
155
177
|
xp conbus lightlevel get 0011223344 0 # Get light level for output 0
|
|
156
178
|
"""
|
|
179
|
+
# Get service from container
|
|
180
|
+
service: ConbusDatapointService = (
|
|
181
|
+
ctx.obj.get("container").get_container().resolve(ConbusDatapointService)
|
|
182
|
+
)
|
|
183
|
+
telegram_service: TelegramDatapointService = (
|
|
184
|
+
ctx.obj.get("container").get_container().resolve(TelegramDatapointService)
|
|
185
|
+
)
|
|
157
186
|
|
|
158
|
-
def
|
|
187
|
+
def on_finish(service_response: "ConbusDatapointResponse") -> None:
|
|
159
188
|
"""Handle successful completion of light level get command.
|
|
160
189
|
|
|
161
190
|
Args:
|
|
162
|
-
|
|
191
|
+
service_response: Light level response object.
|
|
163
192
|
"""
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
193
|
+
lightlevel_level = telegram_service.get_lightlevel(
|
|
194
|
+
service_response.data_value, output_number
|
|
195
|
+
)
|
|
196
|
+
result = service_response.to_dict()
|
|
197
|
+
result["output_number"] = output_number
|
|
198
|
+
result["lightlevel_level"] = lightlevel_level
|
|
199
|
+
click.echo(json.dumps(result, indent=2))
|
|
169
200
|
|
|
170
201
|
with service:
|
|
171
|
-
service.
|
|
202
|
+
service.query_datapoint(
|
|
203
|
+
serial_number=serial_number,
|
|
204
|
+
datapoint_type=DataPointType.MODULE_LIGHT_LEVEL,
|
|
205
|
+
finish_callback=on_finish,
|
|
206
|
+
timeout_seconds=0.5,
|
|
207
|
+
)
|
{conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/conbus/conbus_linknumber_commands.py
RENAMED
|
@@ -9,9 +9,12 @@ 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
|
|
13
|
-
from xp.
|
|
14
|
-
from xp.
|
|
12
|
+
from xp.models import ConbusDatapointResponse
|
|
13
|
+
from xp.models.conbus.conbus_writeconfig import ConbusWriteConfigResponse
|
|
14
|
+
from xp.models.telegram.datapoint_type import DataPointType
|
|
15
|
+
from xp.services.conbus.conbus_datapoint_service import ConbusDatapointService
|
|
16
|
+
from xp.services.conbus.write_config_service import WriteConfigService
|
|
17
|
+
from xp.services.telegram.telegram_datapoint_service import TelegramDatapointService
|
|
15
18
|
|
|
16
19
|
|
|
17
20
|
@conbus_linknumber.command("set", short_help="Set link number for a module")
|
|
@@ -33,23 +36,27 @@ def set_linknumber_command(
|
|
|
33
36
|
\b
|
|
34
37
|
xp conbus linknumber set 0123450001 25
|
|
35
38
|
"""
|
|
36
|
-
service = (
|
|
37
|
-
ctx.obj.get("container").get_container().resolve(ConbusLinknumberSetService)
|
|
38
|
-
)
|
|
39
39
|
|
|
40
|
-
def on_finish(response:
|
|
41
|
-
"""Handle successful completion of
|
|
40
|
+
def on_finish(response: "ConbusWriteConfigResponse") -> None:
|
|
41
|
+
"""Handle successful completion of light level on command.
|
|
42
42
|
|
|
43
43
|
Args:
|
|
44
|
-
response:
|
|
44
|
+
response: Light level response object.
|
|
45
45
|
"""
|
|
46
46
|
click.echo(json.dumps(response.to_dict(), indent=2))
|
|
47
47
|
|
|
48
|
+
service: WriteConfigService = (
|
|
49
|
+
ctx.obj.get("container").get_container().resolve(WriteConfigService)
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
data_value = f"{link_number: 02d}"
|
|
48
53
|
with service:
|
|
49
|
-
service.
|
|
54
|
+
service.write_config(
|
|
50
55
|
serial_number=serial_number,
|
|
51
|
-
|
|
56
|
+
datapoint_type=DataPointType.LINK_NUMBER,
|
|
57
|
+
data_value=data_value,
|
|
52
58
|
finish_callback=on_finish,
|
|
59
|
+
timeout_seconds=0.5,
|
|
53
60
|
)
|
|
54
61
|
|
|
55
62
|
|
|
@@ -68,20 +75,28 @@ def get_linknumber_command(ctx: click.Context, serial_number: str) -> None:
|
|
|
68
75
|
\b
|
|
69
76
|
xp conbus linknumber get 0123450001
|
|
70
77
|
"""
|
|
71
|
-
service = (
|
|
72
|
-
ctx.obj.get("container").get_container().resolve(
|
|
78
|
+
service: ConbusDatapointService = (
|
|
79
|
+
ctx.obj.get("container").get_container().resolve(ConbusDatapointService)
|
|
80
|
+
)
|
|
81
|
+
telegram_service: TelegramDatapointService = (
|
|
82
|
+
ctx.obj.get("container").get_container().resolve(TelegramDatapointService)
|
|
73
83
|
)
|
|
74
84
|
|
|
75
|
-
def on_finish(
|
|
85
|
+
def on_finish(service_response: ConbusDatapointResponse) -> None:
|
|
76
86
|
"""Handle successful completion of link number get command.
|
|
77
87
|
|
|
78
88
|
Args:
|
|
79
|
-
|
|
89
|
+
service_response: Link number response object.
|
|
80
90
|
"""
|
|
81
|
-
|
|
91
|
+
linknumber_value = telegram_service.get_linknumber(service_response.data_value)
|
|
92
|
+
result = service_response.to_dict()
|
|
93
|
+
result["linknumber_value"] = linknumber_value
|
|
94
|
+
click.echo(json.dumps(result, indent=2))
|
|
82
95
|
|
|
83
96
|
with service:
|
|
84
|
-
service.
|
|
97
|
+
service.query_datapoint(
|
|
85
98
|
serial_number=serial_number,
|
|
99
|
+
datapoint_type=DataPointType.LINK_NUMBER,
|
|
86
100
|
finish_callback=on_finish,
|
|
101
|
+
timeout_seconds=0.5,
|
|
87
102
|
)
|
{conson_xp-1.2.0 → conson_xp-1.4.0}/src/xp/cli/commands/conbus/conbus_msactiontable_commands.py
RENAMED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import json
|
|
4
4
|
from dataclasses import asdict
|
|
5
|
+
from typing import Union
|
|
5
6
|
|
|
6
7
|
import click
|
|
7
8
|
from click import Context
|
|
@@ -12,7 +13,9 @@ from xp.cli.utils.decorators import (
|
|
|
12
13
|
)
|
|
13
14
|
from xp.cli.utils.serial_number_type import SERIAL
|
|
14
15
|
from xp.cli.utils.xp_module_type import XP_MODULE_TYPE
|
|
15
|
-
from xp.models.actiontable.
|
|
16
|
+
from xp.models.actiontable.msactiontable_xp20 import Xp20MsActionTable
|
|
17
|
+
from xp.models.actiontable.msactiontable_xp24 import Xp24MsActionTable
|
|
18
|
+
from xp.models.actiontable.msactiontable_xp33 import Xp33MsActionTable
|
|
16
19
|
from xp.services.conbus.actiontable.msactiontable_service import (
|
|
17
20
|
MsActionTableService,
|
|
18
21
|
)
|
|
@@ -33,7 +36,9 @@ def conbus_download_msactiontable(
|
|
|
33
36
|
serial_number: 10-digit module serial number.
|
|
34
37
|
xpmoduletype: XP module type.
|
|
35
38
|
"""
|
|
36
|
-
service =
|
|
39
|
+
service: MsActionTableService = (
|
|
40
|
+
ctx.obj.get("container").get_container().resolve(MsActionTableService)
|
|
41
|
+
)
|
|
37
42
|
|
|
38
43
|
def progress_callback(progress: str) -> None:
|
|
39
44
|
"""Handle progress updates during MS action table download.
|
|
@@ -43,7 +48,9 @@ def conbus_download_msactiontable(
|
|
|
43
48
|
"""
|
|
44
49
|
click.echo(progress, nl=False)
|
|
45
50
|
|
|
46
|
-
def
|
|
51
|
+
def on_finish(
|
|
52
|
+
action_table: Union[Xp20MsActionTable | Xp24MsActionTable | Xp33MsActionTable],
|
|
53
|
+
) -> None:
|
|
47
54
|
"""Handle successful completion of MS action table download.
|
|
48
55
|
|
|
49
56
|
Args:
|
|
@@ -73,6 +80,6 @@ def conbus_download_msactiontable(
|
|
|
73
80
|
serial_number=serial_number,
|
|
74
81
|
xpmoduletype=xpmoduletype,
|
|
75
82
|
progress_callback=progress_callback,
|
|
76
|
-
finish_callback=
|
|
83
|
+
finish_callback=on_finish,
|
|
77
84
|
error_callback=error_callback,
|
|
78
85
|
)
|