conson-xp 1.1.0__tar.gz → 1.3.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.1.0 → conson_xp-1.3.0}/PKG-INFO +1 -5
- {conson_xp-1.1.0 → conson_xp-1.3.0}/README.md +0 -4
- {conson_xp-1.1.0 → conson_xp-1.3.0}/pyproject.toml +25 -1
- conson_xp-1.3.0/src/xp/__init__.py +9 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/__init__.py +1 -1
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/__init__.py +1 -2
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus.py +9 -37
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus_actiontable_commands.py +26 -4
- conson_xp-1.3.0/src/xp/cli/commands/conbus/conbus_autoreport_commands.py +108 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus_blink_commands.py +61 -29
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus_config_commands.py +10 -5
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus_custom_commands.py +16 -5
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus_datapoint_commands.py +32 -10
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus_discover_commands.py +20 -7
- conson_xp-1.3.0/src/xp/cli/commands/conbus/conbus_lightlevel_commands.py +207 -0
- conson_xp-1.3.0/src/xp/cli/commands/conbus/conbus_linknumber_commands.py +102 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus_msactiontable_commands.py +36 -5
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus_output_commands.py +52 -14
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus_raw_commands.py +17 -6
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus_receive_commands.py +20 -10
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus_scan_commands.py +17 -4
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/file_commands.py +35 -18
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/homekit/homekit.py +14 -8
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/homekit/homekit_start_commands.py +8 -6
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/module_commands.py +38 -23
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/reverse_proxy_commands.py +27 -19
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/server/server_commands.py +18 -18
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/telegram/telegram.py +4 -12
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/telegram/telegram_blink_commands.py +10 -8
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/telegram/telegram_checksum_commands.py +19 -8
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/telegram/telegram_discover_commands.py +2 -4
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/telegram/telegram_linknumber_commands.py +11 -8
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/telegram/telegram_parse_commands.py +10 -9
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/telegram/telegram_version_commands.py +8 -4
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/main.py +5 -3
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/utils/click_tree.py +23 -3
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/utils/datapoint_type_choice.py +20 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/utils/decorators.py +165 -14
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/utils/error_handlers.py +49 -18
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/utils/formatters.py +95 -10
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/utils/serial_number_type.py +18 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/utils/system_function_choice.py +20 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/utils/xp_module_type.py +20 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/connection/__init__.py +1 -1
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/connection/exceptions.py +5 -5
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/__init__.py +1 -1
- conson_xp-1.3.0/src/xp/models/actiontable/__init__.py +1 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/actiontable/actiontable.py +17 -1
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/actiontable/msactiontable_xp20.py +10 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/actiontable/msactiontable_xp24.py +20 -3
- conson_xp-1.3.0/src/xp/models/actiontable/msactiontable_xp33.py +65 -0
- conson_xp-1.3.0/src/xp/models/conbus/__init__.py +1 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus.py +34 -4
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_autoreport.py +20 -2
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_blink.py +22 -2
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_client_config.py +22 -1
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_connection_status.py +16 -2
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_custom.py +21 -2
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_datapoint.py +25 -2
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_discover.py +18 -2
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_lightlevel.py +20 -2
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_linknumber.py +20 -2
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_output.py +22 -2
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_raw.py +17 -2
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/conbus/conbus_receive.py +16 -2
- conson_xp-1.3.0/src/xp/models/conbus/conbus_writeconfig.py +60 -0
- conson_xp-1.3.0/src/xp/models/homekit/__init__.py +1 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/homekit/homekit_accessory.py +15 -1
- conson_xp-1.3.0/src/xp/models/homekit/homekit_config.py +102 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/homekit/homekit_conson_config.py +32 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/log_entry.py +49 -9
- conson_xp-1.3.0/src/xp/models/protocol/__init__.py +1 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/protocol/conbus_protocol.py +130 -21
- conson_xp-1.3.0/src/xp/models/telegram/__init__.py +1 -0
- conson_xp-1.3.0/src/xp/models/telegram/action_type.py +31 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/telegram/datapoint_type.py +36 -2
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/telegram/event_telegram.py +46 -10
- conson_xp-1.3.0/src/xp/models/telegram/event_type.py +15 -0
- conson_xp-1.3.0/src/xp/models/telegram/input_action_type.py +69 -0
- conson_xp-1.3.0/src/xp/models/telegram/input_type.py +17 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/telegram/module_type.py +69 -19
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/telegram/module_type_code.py +43 -1
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/telegram/output_telegram.py +30 -6
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/telegram/reply_telegram.py +56 -11
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/telegram/system_function.py +35 -3
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/telegram/system_telegram.py +18 -4
- conson_xp-1.3.0/src/xp/models/telegram/telegram.py +28 -0
- conson_xp-1.3.0/src/xp/models/telegram/telegram_type.py +19 -0
- conson_xp-1.3.0/src/xp/models/telegram/timeparam_type.py +51 -0
- conson_xp-1.3.0/src/xp/models/write_config_type.py +33 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/__init__.py +1 -1
- conson_xp-1.3.0/src/xp/services/conbus/__init__.py +1 -0
- conson_xp-1.3.0/src/xp/services/conbus/actiontable/__init__.py +1 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/actiontable/actiontable_service.py +33 -2
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/actiontable/msactiontable_service.py +40 -3
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/actiontable/msactiontable_xp24_serializer.py +36 -4
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/actiontable/msactiontable_xp33_serializer.py +45 -5
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/conbus_blink_all_service.py +40 -21
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/conbus_blink_service.py +37 -13
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/conbus_custom_service.py +29 -13
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/conbus_datapoint_queryall_service.py +40 -16
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/conbus_datapoint_service.py +42 -18
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/conbus_discover_service.py +43 -7
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/conbus_output_service.py +33 -13
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/conbus_raw_service.py +36 -16
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/conbus_receive_service.py +38 -6
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/conbus_scan_service.py +44 -18
- conson_xp-1.3.0/src/xp/services/conbus/write_config_service.py +193 -0
- conson_xp-1.3.0/src/xp/services/homekit/__init__.py +1 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_cache_service.py +31 -6
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_conbus_service.py +33 -2
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_config_validator.py +97 -15
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_conson_validator.py +51 -7
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_dimminglight.py +47 -1
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_dimminglight_service.py +35 -1
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_hap_service.py +71 -18
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_lightbulb.py +35 -1
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_lightbulb_service.py +30 -2
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_module_service.py +23 -1
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_outlet.py +47 -1
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_outlet_service.py +44 -2
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/homekit/homekit_service.py +113 -19
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/log_file_service.py +37 -41
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/module_type_service.py +26 -5
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/protocol/__init__.py +1 -1
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/protocol/conbus_protocol.py +110 -16
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/protocol/protocol_factory.py +40 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/protocol/telegram_protocol.py +38 -7
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/reverse_proxy_service.py +79 -14
- conson_xp-1.3.0/src/xp/services/server/__init__.py +1 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/server/base_server_service.py +102 -14
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/server/cp20_server_service.py +12 -4
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/server/server_service.py +26 -11
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/server/xp130_server_service.py +11 -3
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/server/xp20_server_service.py +11 -3
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/server/xp230_server_service.py +11 -3
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/server/xp24_server_service.py +33 -6
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/server/xp33_server_service.py +41 -8
- conson_xp-1.3.0/src/xp/services/telegram/__init__.py +1 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/telegram/telegram_blink_service.py +19 -31
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/telegram/telegram_checksum_service.py +10 -10
- conson_xp-1.3.0/src/xp/services/telegram/telegram_datapoint_service.py +70 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/telegram/telegram_discover_service.py +58 -29
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/telegram/telegram_link_number_service.py +27 -40
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/telegram/telegram_output_service.py +46 -49
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/telegram/telegram_service.py +41 -41
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/telegram/telegram_version_service.py +4 -2
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/utils/__init__.py +1 -1
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/utils/dependencies.py +4 -47
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/utils/serialization.py +6 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/utils/time_utils.py +6 -11
- conson_xp-1.3.0/tests/__init__.py +1 -0
- conson_xp-1.3.0/tests/integration/__init__.py +1 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/telegram_test_data.py +13 -2
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_actiontable_integration.py +18 -10
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_blink_integration.py +11 -11
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_checksum_integration.py +1 -1
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_conbus_blink_integration.py +24 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_conbus_datapoint_integration.py +33 -16
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_conbus_raw_integration.py +32 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_discovery_integration.py +7 -7
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_event_telegram_integration.py +18 -16
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_homekit_config_integration.py +23 -3
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_link_number_integration.py +10 -10
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_module_integration.py +27 -25
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_reverse_proxy_integration.py +24 -15
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_xp20_action_table_integration.py +9 -9
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_xp24_action_table_integration.py +31 -7
- conson_xp-1.3.0/tests/unit/__init__.py +1 -0
- conson_xp-1.3.0/tests/unit/test_cli/__init__.py +1 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_cli/test_click_tree.py +22 -22
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_cli/test_conbus_actiontable_commands.py +27 -11
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_cli/test_conbus_blink_commands.py +6 -6
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_cli/test_formatters.py +8 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_cli/test_serial_number_type.py +19 -0
- conson_xp-1.3.0/tests/unit/test_connection/__init__.py +1 -0
- conson_xp-1.3.0/tests/unit/test_encoding/__init__.py +1 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_encoding/test_latin1_edge_cases.py +14 -9
- conson_xp-1.3.0/tests/unit/test_models/__init__.py +1 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_conbus_client_send.py +17 -15
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_conbus_linknumber.py +12 -10
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_event_telegram.py +11 -9
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_log_entry.py +15 -15
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_module_type.py +20 -18
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_system_telegram_enhancements.py +13 -13
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_version_telegram.py +0 -2
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_xp20_action_table.py +14 -14
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_xp24_action_table.py +11 -11
- conson_xp-1.3.0/tests/unit/test_services/__init__.py +1 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_actiontable_service.py +16 -16
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_base_server_service.py +5 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_blink_service.py +13 -13
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_conbus_blink_service.py +14 -14
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_conbus_raw_service.py +11 -11
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_conbus_reverse_proxy_service.py +20 -20
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_discovery_service.py +20 -20
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_homekit_cache_service.py +19 -19
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_homekit_config_validator.py +18 -2
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_homekit_conson_service.py +3 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_homekit_services.py +49 -45
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_log_file_service.py +34 -22
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_module_type_service.py +29 -27
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_protocol.py +29 -27
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_telegram_input_service.py +18 -16
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_telegram_protocol.py +21 -21
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_telegram_service.py +51 -49
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_xp20_action_table_serializer.py +14 -14
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_xp24_action_table_serializer.py +10 -11
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_xp24_action_table_service.py +23 -23
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_xp33_action_table_serializer.py +17 -17
- conson_xp-1.3.0/tests/unit/test_utils/__init__.py +1 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_utils/test_checksum.py +1 -1
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_utils/test_event_helper.py +17 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_utils/test_time_utils.py +16 -16
- conson_xp-1.1.0/src/xp/__init__.py +0 -8
- conson_xp-1.1.0/src/xp/api/__init__.py +0 -1
- conson_xp-1.1.0/src/xp/api/main.py +0 -110
- conson_xp-1.1.0/src/xp/api/models/__init__.py +0 -1
- conson_xp-1.1.0/src/xp/api/models/api.py +0 -20
- conson_xp-1.1.0/src/xp/api/models/discover.py +0 -21
- conson_xp-1.1.0/src/xp/api/routers/__init__.py +0 -17
- conson_xp-1.1.0/src/xp/api/routers/conbus.py +0 -5
- conson_xp-1.1.0/src/xp/api/routers/conbus_blink.py +0 -105
- conson_xp-1.1.0/src/xp/api/routers/conbus_custom.py +0 -63
- conson_xp-1.1.0/src/xp/api/routers/conbus_datapoint.py +0 -67
- conson_xp-1.1.0/src/xp/api/routers/conbus_output.py +0 -147
- conson_xp-1.1.0/src/xp/api/routers/errors.py +0 -37
- conson_xp-1.1.0/src/xp/cli/commands/api.py +0 -16
- conson_xp-1.1.0/src/xp/cli/commands/api_start_commands.py +0 -126
- conson_xp-1.1.0/src/xp/cli/commands/conbus/conbus_autoreport_commands.py +0 -80
- conson_xp-1.1.0/src/xp/cli/commands/conbus/conbus_lightlevel_commands.py +0 -132
- conson_xp-1.1.0/src/xp/cli/commands/conbus/conbus_linknumber_commands.py +0 -77
- conson_xp-1.1.0/src/xp/models/actiontable/__init__.py +0 -0
- conson_xp-1.1.0/src/xp/models/actiontable/msactiontable_xp33.py +0 -42
- conson_xp-1.1.0/src/xp/models/conbus/__init__.py +0 -0
- conson_xp-1.1.0/src/xp/models/homekit/__init__.py +0 -0
- conson_xp-1.1.0/src/xp/models/homekit/homekit_config.py +0 -50
- conson_xp-1.1.0/src/xp/models/protocol/__init__.py +0 -0
- conson_xp-1.1.0/src/xp/models/telegram/__init__.py +0 -0
- conson_xp-1.1.0/src/xp/models/telegram/action_type.py +0 -17
- conson_xp-1.1.0/src/xp/models/telegram/event_type.py +0 -8
- conson_xp-1.1.0/src/xp/models/telegram/input_action_type.py +0 -37
- conson_xp-1.1.0/src/xp/models/telegram/input_type.py +0 -9
- conson_xp-1.1.0/src/xp/models/telegram/telegram.py +0 -19
- conson_xp-1.1.0/src/xp/models/telegram/telegram_type.py +0 -12
- conson_xp-1.1.0/src/xp/models/telegram/timeparam_type.py +0 -24
- conson_xp-1.1.0/src/xp/models/write_config_type.py +0 -18
- conson_xp-1.1.0/src/xp/services/conbus/__init__.py +0 -0
- conson_xp-1.1.0/src/xp/services/conbus/actiontable/__init__.py +0 -0
- conson_xp-1.1.0/src/xp/services/conbus/conbus_autoreport_get_service.py +0 -85
- conson_xp-1.1.0/src/xp/services/conbus/conbus_autoreport_set_service.py +0 -128
- conson_xp-1.1.0/src/xp/services/conbus/conbus_lightlevel_get_service.py +0 -101
- conson_xp-1.1.0/src/xp/services/conbus/conbus_lightlevel_set_service.py +0 -205
- conson_xp-1.1.0/src/xp/services/conbus/conbus_linknumber_get_service.py +0 -86
- conson_xp-1.1.0/src/xp/services/conbus/conbus_linknumber_set_service.py +0 -155
- conson_xp-1.1.0/src/xp/services/homekit/__init__.py +0 -0
- conson_xp-1.1.0/src/xp/services/server/__init__.py +0 -0
- conson_xp-1.1.0/src/xp/services/telegram/__init__.py +0 -0
- conson_xp-1.1.0/tests/__init__.py +0 -0
- conson_xp-1.1.0/tests/integration/__init__.py +0 -0
- conson_xp-1.1.0/tests/integration/test_conbus_autoreport_integration.py +0 -309
- conson_xp-1.1.0/tests/integration/test_conbus_lightlevel_integration.py +0 -224
- conson_xp-1.1.0/tests/integration/test_conbus_linknumber_integration.py +0 -469
- conson_xp-1.1.0/tests/unit/__init__.py +0 -0
- conson_xp-1.1.0/tests/unit/test_cli/__init__.py +0 -0
- conson_xp-1.1.0/tests/unit/test_connection/__init__.py +0 -0
- conson_xp-1.1.0/tests/unit/test_encoding/__init__.py +0 -1
- conson_xp-1.1.0/tests/unit/test_models/__init__.py +0 -0
- conson_xp-1.1.0/tests/unit/test_services/__init__.py +0 -0
- conson_xp-1.1.0/tests/unit/test_services/test_conbus_lightlevel_service.py +0 -187
- conson_xp-1.1.0/tests/unit/test_services/test_conbus_linknumber_service.py +0 -427
- conson_xp-1.1.0/tests/unit/test_services/test_link_number_service.py +0 -229
- conson_xp-1.1.0/tests/unit/test_utils/__init__.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/LICENSE +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/__main__.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/__init__.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/homekit/__init__.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/server/__init__.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/telegram/__init__.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/utils/__init__.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/models/response.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/actiontable/actiontable_serializer.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/services/conbus/actiontable/msactiontable_xp20_serializer.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/utils/checksum.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/utils/event_helper.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/.coverage +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/conftest.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/.coverage +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_api/.coverage +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_api/__init__.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_conbus_receive_integration.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_output_integration.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_system_reply_telegram_integration.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/integration/test_version_integration.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_api/__init__.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_cli/test_datapoint_type_choice.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_cli/test_decorators.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_cli/test_error_handlers.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_cli/test_system_function_choice.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_connection/test_connection_init.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_connection/test_exceptions.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_conbus.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_conbus_discover.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_reply_telegram.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_system_telegram.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_write_config_type.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_models/test_xp24_action_telegram.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_checksum_service.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_server_service.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_version_service.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_xp24_action_service.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_services/test_xp_server_services.py +0 -0
- {conson_xp-1.1.0 → conson_xp-1.3.0}/tests/unit/test_utils/test_serialization.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: conson-xp
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.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
|
|
@@ -20,7 +20,7 @@ dependencies = [
|
|
|
20
20
|
]
|
|
21
21
|
requires-python = ">=3.11"
|
|
22
22
|
readme = "README.md"
|
|
23
|
-
version = "1.
|
|
23
|
+
version = "1.3.0"
|
|
24
24
|
|
|
25
25
|
[project.license]
|
|
26
26
|
file = "LICENSE"
|
|
@@ -41,6 +41,9 @@ dev = [
|
|
|
41
41
|
"pytest-cov>=7.0",
|
|
42
42
|
"black>=25.9",
|
|
43
43
|
"flake8>=7.3",
|
|
44
|
+
"flake8-docstrings>=1.7.0",
|
|
45
|
+
"flake8-docstrings-complete>=1.3.0",
|
|
46
|
+
"interrogate>=1.7.0",
|
|
44
47
|
"mypy>=1.18",
|
|
45
48
|
"ruff>=0.13.0",
|
|
46
49
|
"vulture>=2.14",
|
|
@@ -165,6 +168,8 @@ test-cov = "env PYTHONPATH=src python -m pytest tests/ --quiet --cov=src/xp --co
|
|
|
165
168
|
lint = "ruff check --fix src/ tests/"
|
|
166
169
|
format = "black src/ tests/"
|
|
167
170
|
typecheck = "mypy src/ tests/"
|
|
171
|
+
flake8 = "flake8 src/ tests/"
|
|
172
|
+
interrogate = "interrogate -vv src/"
|
|
168
173
|
vulture = "vulture src/ tests/"
|
|
169
174
|
refurb = "refurb src/ tests/"
|
|
170
175
|
isort = "isort src/ tests/"
|
|
@@ -189,6 +194,8 @@ composite = [
|
|
|
189
194
|
"lint",
|
|
190
195
|
"format",
|
|
191
196
|
"typecheck",
|
|
197
|
+
"flake8",
|
|
198
|
+
"interrogate",
|
|
192
199
|
"vulture",
|
|
193
200
|
"refurb",
|
|
194
201
|
"isort",
|
|
@@ -222,6 +229,23 @@ version-files = [
|
|
|
222
229
|
"src/xp/__init__.py:__version__",
|
|
223
230
|
]
|
|
224
231
|
|
|
232
|
+
[tool.interrogate]
|
|
233
|
+
ignore-init-method = true
|
|
234
|
+
ignore-init-module = false
|
|
235
|
+
fail-under = 95
|
|
236
|
+
exclude = [
|
|
237
|
+
"tests",
|
|
238
|
+
"docs",
|
|
239
|
+
"build",
|
|
240
|
+
"dist",
|
|
241
|
+
]
|
|
242
|
+
verbose = 1
|
|
243
|
+
quiet = false
|
|
244
|
+
whitelist-regex = []
|
|
245
|
+
color = true
|
|
246
|
+
generate-badge = "."
|
|
247
|
+
badge-format = "svg"
|
|
248
|
+
|
|
225
249
|
[build-system]
|
|
226
250
|
requires = [
|
|
227
251
|
"pdm-backend",
|
|
@@ -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 (
|
|
@@ -38,6 +37,7 @@ from xp.cli.commands.conbus.conbus_datapoint_commands import (
|
|
|
38
37
|
)
|
|
39
38
|
from xp.cli.commands.conbus.conbus_discover_commands import send_discover_telegram
|
|
40
39
|
from xp.cli.commands.conbus.conbus_lightlevel_commands import (
|
|
40
|
+
xp_lightlevel_get,
|
|
41
41
|
xp_lightlevel_off,
|
|
42
42
|
xp_lightlevel_on,
|
|
43
43
|
xp_lightlevel_set,
|
|
@@ -99,7 +99,6 @@ __all__ = [
|
|
|
99
99
|
"linknumber",
|
|
100
100
|
"blink",
|
|
101
101
|
"checksum",
|
|
102
|
-
"start_api_server",
|
|
103
102
|
"homekit",
|
|
104
103
|
"homekit_start",
|
|
105
104
|
# Individual command functions
|
|
@@ -8,9 +8,7 @@ from click_help_colors import HelpColorsGroup
|
|
|
8
8
|
cls=HelpColorsGroup, help_headers_color="yellow", help_options_color="green"
|
|
9
9
|
)
|
|
10
10
|
def conbus() -> None:
|
|
11
|
-
"""
|
|
12
|
-
Conbus client operations for sending telegrams to remote servers
|
|
13
|
-
"""
|
|
11
|
+
"""Perform Conbus client operations for sending telegrams to remote servers."""
|
|
14
12
|
pass
|
|
15
13
|
|
|
16
14
|
|
|
@@ -21,9 +19,7 @@ def conbus() -> None:
|
|
|
21
19
|
help_options_color="green",
|
|
22
20
|
)
|
|
23
21
|
def conbus_blink() -> None:
|
|
24
|
-
"""
|
|
25
|
-
Conbus client operations for sending blink telegrams to remote servers
|
|
26
|
-
"""
|
|
22
|
+
"""Perform Conbus client operations for sending blink telegrams to remote servers."""
|
|
27
23
|
pass
|
|
28
24
|
|
|
29
25
|
|
|
@@ -34,9 +30,7 @@ def conbus_blink() -> None:
|
|
|
34
30
|
help_options_color="green",
|
|
35
31
|
)
|
|
36
32
|
def conbus_output() -> None:
|
|
37
|
-
"""
|
|
38
|
-
Conbus input operations to remote servers
|
|
39
|
-
"""
|
|
33
|
+
"""Perform Conbus input operations to remote servers."""
|
|
40
34
|
pass
|
|
41
35
|
|
|
42
36
|
|
|
@@ -47,9 +41,7 @@ def conbus_output() -> None:
|
|
|
47
41
|
help_options_color="green",
|
|
48
42
|
)
|
|
49
43
|
def conbus_datapoint() -> None:
|
|
50
|
-
"""
|
|
51
|
-
Conbus datapoint operations for querying module datapoints
|
|
52
|
-
"""
|
|
44
|
+
"""Perform Conbus datapoint operations for querying module datapoints."""
|
|
53
45
|
pass
|
|
54
46
|
|
|
55
47
|
|
|
@@ -61,11 +53,7 @@ def conbus_datapoint() -> None:
|
|
|
61
53
|
short_help="Link number operations",
|
|
62
54
|
)
|
|
63
55
|
def conbus_linknumber() -> None:
|
|
64
|
-
"""
|
|
65
|
-
Link number operations for modules.
|
|
66
|
-
|
|
67
|
-
Set or get the link number for specific modules.
|
|
68
|
-
"""
|
|
56
|
+
"""Set or get the link number for specific modules."""
|
|
69
57
|
pass
|
|
70
58
|
|
|
71
59
|
|
|
@@ -77,11 +65,7 @@ def conbus_linknumber() -> None:
|
|
|
77
65
|
short_help="Auto report status operations",
|
|
78
66
|
)
|
|
79
67
|
def conbus_autoreport() -> None:
|
|
80
|
-
"""
|
|
81
|
-
Auto report status operations for modules.
|
|
82
|
-
|
|
83
|
-
Get or set the auto report status for specific modules.
|
|
84
|
-
"""
|
|
68
|
+
"""Get or set the auto report status for specific modules."""
|
|
85
69
|
pass
|
|
86
70
|
|
|
87
71
|
|
|
@@ -93,11 +77,7 @@ def conbus_autoreport() -> None:
|
|
|
93
77
|
short_help="Light level operations",
|
|
94
78
|
)
|
|
95
79
|
def conbus_lightlevel() -> None:
|
|
96
|
-
"""
|
|
97
|
-
Light level operations for modules.
|
|
98
|
-
|
|
99
|
-
Control light level (dimming) of outputs on Conbus modules.
|
|
100
|
-
"""
|
|
80
|
+
"""Control light level (dimming) of outputs on Conbus modules."""
|
|
101
81
|
pass
|
|
102
82
|
|
|
103
83
|
|
|
@@ -109,11 +89,7 @@ def conbus_lightlevel() -> None:
|
|
|
109
89
|
short_help="MSActionTable operations",
|
|
110
90
|
)
|
|
111
91
|
def conbus_msactiontable() -> None:
|
|
112
|
-
"""
|
|
113
|
-
msactiontable operations for modules.
|
|
114
|
-
|
|
115
|
-
Download msactiontable on Conbus modules.
|
|
116
|
-
"""
|
|
92
|
+
"""Download msactiontable on Conbus modules."""
|
|
117
93
|
pass
|
|
118
94
|
|
|
119
95
|
|
|
@@ -125,11 +101,7 @@ def conbus_msactiontable() -> None:
|
|
|
125
101
|
short_help="ActionTable operations",
|
|
126
102
|
)
|
|
127
103
|
def conbus_actiontable() -> None:
|
|
128
|
-
"""
|
|
129
|
-
ActionTable operations for modules.
|
|
130
|
-
|
|
131
|
-
Download ActionTable from Conbus modules.
|
|
132
|
-
"""
|
|
104
|
+
"""Download ActionTable from Conbus modules."""
|
|
133
105
|
pass
|
|
134
106
|
|
|
135
107
|
|
{conson_xp-1.1.0 → conson_xp-1.3.0}/src/xp/cli/commands/conbus/conbus_actiontable_commands.py
RENAMED
|
@@ -22,13 +22,30 @@ from xp.services.conbus.actiontable.actiontable_service import (
|
|
|
22
22
|
@click.pass_context
|
|
23
23
|
@connection_command()
|
|
24
24
|
def conbus_download_actiontable(ctx: Context, serial_number: str) -> None:
|
|
25
|
-
"""Download action table from XP module
|
|
26
|
-
|
|
25
|
+
"""Download action table from XP module.
|
|
26
|
+
|
|
27
|
+
Args:
|
|
28
|
+
ctx: Click context object.
|
|
29
|
+
serial_number: 10-digit module serial number.
|
|
30
|
+
"""
|
|
31
|
+
service: ActionTableService = (
|
|
32
|
+
ctx.obj.get("container").get_container().resolve(ActionTableService)
|
|
33
|
+
)
|
|
27
34
|
|
|
28
35
|
def progress_callback(progress: str) -> None:
|
|
36
|
+
"""Handle progress updates during action table download.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
progress: Progress message string.
|
|
40
|
+
"""
|
|
29
41
|
click.echo(progress)
|
|
30
42
|
|
|
31
|
-
def
|
|
43
|
+
def on_finish(actiontable: ActionTable) -> None:
|
|
44
|
+
"""Handle successful completion of action table download.
|
|
45
|
+
|
|
46
|
+
Args:
|
|
47
|
+
actiontable: Downloaded action table object.
|
|
48
|
+
"""
|
|
32
49
|
output = {
|
|
33
50
|
"serial_number": serial_number,
|
|
34
51
|
"actiontable": asdict(actiontable),
|
|
@@ -36,12 +53,17 @@ def conbus_download_actiontable(ctx: Context, serial_number: str) -> None:
|
|
|
36
53
|
click.echo(json.dumps(output, indent=2, default=str))
|
|
37
54
|
|
|
38
55
|
def error_callback(error: str) -> None:
|
|
56
|
+
"""Handle errors during action table download.
|
|
57
|
+
|
|
58
|
+
Args:
|
|
59
|
+
error: Error message string.
|
|
60
|
+
"""
|
|
39
61
|
click.echo(error)
|
|
40
62
|
|
|
41
63
|
with service:
|
|
42
64
|
service.start(
|
|
43
65
|
serial_number=serial_number,
|
|
44
66
|
progress_callback=progress_callback,
|
|
45
|
-
finish_callback=
|
|
67
|
+
finish_callback=on_finish,
|
|
46
68
|
error_callback=error_callback,
|
|
47
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
|
+
)
|
|
@@ -23,23 +23,30 @@ from xp.services.telegram.telegram_blink_service import BlinkError
|
|
|
23
23
|
@connection_command()
|
|
24
24
|
@handle_service_errors(BlinkError)
|
|
25
25
|
def send_blink_on_telegram(ctx: Context, serial_number: str) -> None:
|
|
26
|
-
"""
|
|
27
|
-
Send blink command to start blinking module LED.
|
|
26
|
+
r"""Send blink command to start blinking module LED.
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
Args:
|
|
29
|
+
ctx: Click context object.
|
|
30
|
+
serial_number: 10-digit module serial number.
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
Examples:
|
|
33
|
+
\b
|
|
32
34
|
xp conbus blink on 0012345008
|
|
33
35
|
"""
|
|
34
36
|
|
|
35
|
-
def
|
|
37
|
+
def on_finish(service_response: ConbusBlinkResponse) -> None:
|
|
38
|
+
"""Handle successful completion of blink on command.
|
|
39
|
+
|
|
40
|
+
Args:
|
|
41
|
+
service_response: Blink response object.
|
|
42
|
+
"""
|
|
36
43
|
click.echo(json.dumps(service_response.to_dict(), indent=2))
|
|
37
44
|
|
|
38
45
|
service: ConbusBlinkService = (
|
|
39
46
|
ctx.obj.get("container").get_container().resolve(ConbusBlinkService)
|
|
40
47
|
)
|
|
41
48
|
with service:
|
|
42
|
-
service.send_blink_telegram(serial_number, "on",
|
|
49
|
+
service.send_blink_telegram(serial_number, "on", on_finish, 0.5)
|
|
43
50
|
|
|
44
51
|
|
|
45
52
|
@conbus_blink.command("off")
|
|
@@ -48,30 +55,35 @@ def send_blink_on_telegram(ctx: Context, serial_number: str) -> None:
|
|
|
48
55
|
@connection_command()
|
|
49
56
|
@handle_service_errors(BlinkError)
|
|
50
57
|
def send_blink_off_telegram(ctx: Context, serial_number: str) -> None:
|
|
51
|
-
"""
|
|
52
|
-
Send blink command to start blinking module LED.
|
|
58
|
+
r"""Send blink command to stop blinking module LED.
|
|
53
59
|
|
|
54
|
-
|
|
60
|
+
Args:
|
|
61
|
+
ctx: Click context object.
|
|
62
|
+
serial_number: 10-digit module serial number.
|
|
55
63
|
|
|
56
|
-
|
|
64
|
+
Examples:
|
|
65
|
+
\b
|
|
57
66
|
xp conbus blink off 0012345008
|
|
58
67
|
"""
|
|
59
68
|
|
|
60
|
-
def
|
|
69
|
+
def on_finish(service_response: ConbusBlinkResponse) -> None:
|
|
70
|
+
"""Handle successful completion of blink off command.
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
service_response: Blink response object.
|
|
74
|
+
"""
|
|
61
75
|
click.echo(json.dumps(service_response.to_dict(), indent=2))
|
|
62
76
|
|
|
63
77
|
service: ConbusBlinkService = (
|
|
64
78
|
ctx.obj.get("container").get_container().resolve(ConbusBlinkService)
|
|
65
79
|
)
|
|
66
80
|
with service:
|
|
67
|
-
service.send_blink_telegram(serial_number, "off",
|
|
81
|
+
service.send_blink_telegram(serial_number, "off", on_finish, 0.5)
|
|
68
82
|
|
|
69
83
|
|
|
70
84
|
@conbus_blink.group("all", short_help="Control blink state for all devices")
|
|
71
85
|
def conbus_blink_all() -> None:
|
|
72
|
-
"""
|
|
73
|
-
Control blink state for all discovered devices.
|
|
74
|
-
"""
|
|
86
|
+
"""Control blink state for all discovered devices."""
|
|
75
87
|
pass
|
|
76
88
|
|
|
77
89
|
|
|
@@ -80,27 +92,37 @@ def conbus_blink_all() -> None:
|
|
|
80
92
|
@connection_command()
|
|
81
93
|
@handle_service_errors(BlinkError)
|
|
82
94
|
def blink_all_off(ctx: Context) -> None:
|
|
83
|
-
"""
|
|
84
|
-
Turn off blinking for all discovered devices.
|
|
95
|
+
r"""Turn off blinking for all discovered devices.
|
|
85
96
|
|
|
86
|
-
|
|
97
|
+
Args:
|
|
98
|
+
ctx: Click context object.
|
|
87
99
|
|
|
88
|
-
|
|
100
|
+
Examples:
|
|
101
|
+
\b
|
|
89
102
|
xp conbus blink all off
|
|
90
103
|
"""
|
|
91
104
|
|
|
92
|
-
def
|
|
105
|
+
def on_finish(discovered_devices: ConbusBlinkResponse) -> None:
|
|
106
|
+
"""Handle successful completion of blink all off command.
|
|
107
|
+
|
|
108
|
+
Args:
|
|
109
|
+
discovered_devices: Blink response with all devices.
|
|
110
|
+
"""
|
|
93
111
|
click.echo(json.dumps(discovered_devices.to_dict(), indent=2))
|
|
94
112
|
|
|
95
113
|
def progress(message: str) -> None:
|
|
114
|
+
"""Handle progress updates during blink all off operation.
|
|
115
|
+
|
|
116
|
+
Args:
|
|
117
|
+
message: Progress message string.
|
|
118
|
+
"""
|
|
96
119
|
click.echo(message)
|
|
97
|
-
pass
|
|
98
120
|
|
|
99
121
|
service: ConbusBlinkAllService = (
|
|
100
122
|
ctx.obj.get("container").get_container().resolve(ConbusBlinkAllService)
|
|
101
123
|
)
|
|
102
124
|
with service:
|
|
103
|
-
service.send_blink_all_telegram("off", progress,
|
|
125
|
+
service.send_blink_all_telegram("off", progress, on_finish, 0.5)
|
|
104
126
|
|
|
105
127
|
|
|
106
128
|
@conbus_blink_all.command("on", short_help="Turn on blinking for all devices")
|
|
@@ -108,24 +130,34 @@ def blink_all_off(ctx: Context) -> None:
|
|
|
108
130
|
@connection_command()
|
|
109
131
|
@handle_service_errors(BlinkError)
|
|
110
132
|
def blink_all_on(ctx: Context) -> None:
|
|
111
|
-
"""
|
|
112
|
-
Turn on blinking for all discovered devices.
|
|
133
|
+
r"""Turn on blinking for all discovered devices.
|
|
113
134
|
|
|
114
|
-
|
|
135
|
+
Args:
|
|
136
|
+
ctx: Click context object.
|
|
115
137
|
|
|
116
|
-
|
|
138
|
+
Examples:
|
|
139
|
+
\b
|
|
117
140
|
xp conbus blink all on
|
|
118
141
|
"""
|
|
119
142
|
|
|
120
|
-
def
|
|
143
|
+
def on_finish(discovered_devices: ConbusBlinkResponse) -> None:
|
|
144
|
+
"""Handle successful completion of blink all on command.
|
|
145
|
+
|
|
146
|
+
Args:
|
|
147
|
+
discovered_devices: Blink response with all devices.
|
|
148
|
+
"""
|
|
121
149
|
click.echo(json.dumps(discovered_devices.to_dict(), indent=2))
|
|
122
150
|
|
|
123
151
|
def progress(message: str) -> None:
|
|
152
|
+
"""Handle progress updates during blink all on operation.
|
|
153
|
+
|
|
154
|
+
Args:
|
|
155
|
+
message: Progress message string.
|
|
156
|
+
"""
|
|
124
157
|
click.echo(message)
|
|
125
|
-
pass
|
|
126
158
|
|
|
127
159
|
service: ConbusBlinkAllService = (
|
|
128
160
|
ctx.obj.get("container").get_container().resolve(ConbusBlinkAllService)
|
|
129
161
|
)
|
|
130
162
|
with service:
|
|
131
|
-
service.send_blink_all_telegram("on", progress,
|
|
163
|
+
service.send_blink_all_telegram("on", progress, on_finish, 0.5)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"""Conbus configuration CLI commands."""
|
|
2
|
+
|
|
1
3
|
import json
|
|
2
4
|
|
|
3
5
|
import click
|
|
@@ -12,13 +14,16 @@ from xp.models import ConbusClientConfig
|
|
|
12
14
|
@click.pass_context
|
|
13
15
|
@handle_service_errors(Exception)
|
|
14
16
|
def show_config(ctx: Context) -> None:
|
|
15
|
-
"""
|
|
16
|
-
Display current Conbus client configuration.
|
|
17
|
+
r"""Display current Conbus client configuration.
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
Args:
|
|
20
|
+
ctx: Click context object.
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
Examples:
|
|
23
|
+
\b
|
|
21
24
|
xp conbus config
|
|
22
25
|
"""
|
|
23
|
-
config =
|
|
26
|
+
config: ConbusClientConfig = (
|
|
27
|
+
ctx.obj.get("container").get_container().resolve(ConbusClientConfig)
|
|
28
|
+
)
|
|
24
29
|
click.echo(json.dumps(config.conbus.model_dump(mode="json"), indent=2))
|
|
@@ -23,18 +23,29 @@ from xp.services.conbus.conbus_custom_service import ConbusCustomService
|
|
|
23
23
|
def send_custom_telegram(
|
|
24
24
|
ctx: Context, serial_number: str, function_code: str, datapoint_code: str
|
|
25
25
|
) -> None:
|
|
26
|
-
"""
|
|
27
|
-
Send custom telegram with specified function and data point codes.
|
|
26
|
+
r"""Send custom telegram with specified function and data point codes.
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
Args:
|
|
29
|
+
ctx: Click context object.
|
|
30
|
+
serial_number: 10-digit module serial number.
|
|
31
|
+
function_code: Function code.
|
|
32
|
+
datapoint_code: Data point code.
|
|
30
33
|
|
|
31
|
-
|
|
34
|
+
Examples:
|
|
35
|
+
\b
|
|
32
36
|
xp conbus custom 0012345011 02 E2
|
|
33
37
|
xp conbus custom 0012345011 17 AA
|
|
34
38
|
"""
|
|
35
|
-
service =
|
|
39
|
+
service: ConbusCustomService = (
|
|
40
|
+
ctx.obj.get("container").get_container().resolve(ConbusCustomService)
|
|
41
|
+
)
|
|
36
42
|
|
|
37
43
|
def on_finish(service_response: "ConbusCustomResponse") -> None:
|
|
44
|
+
"""Handle successful completion of custom telegram.
|
|
45
|
+
|
|
46
|
+
Args:
|
|
47
|
+
service_response: Custom response object.
|
|
48
|
+
"""
|
|
38
49
|
click.echo(json.dumps(service_response.to_dict(), indent=2))
|
|
39
50
|
|
|
40
51
|
with service:
|