velbus-aio 2024.7.6__tar.gz → 2024.11.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.
Potentially problematic release.
This version of velbus-aio might be problematic. Click here for more details.
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/MANIFEST.in +1 -1
- {velbus_aio-2024.7.6/velbus_aio.egg-info → velbus_aio-2024.11.0}/PKG-INFO +14 -2
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/README.md +11 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/pyproject.toml +4 -3
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0/velbus_aio.egg-info}/PKG-INFO +14 -2
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbus_aio.egg-info/SOURCES.txt +82 -2
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/channels.py +16 -4
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/command_registry.py +7 -5
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/const.py +1 -1
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/controller.py +8 -5
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/handler.py +87 -61
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/__init__.py +2 -2
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/blind_status.py +1 -1
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/channel_name_part1.py +1 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/channel_name_part2.py +1 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/channel_name_part3.py +1 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/cover_down.py +1 -1
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/cover_off.py +1 -1
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/cover_position.py +1 -1
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/cover_up.py +1 -1
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/edge_set_color.py +1 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/module.py +77 -29
- velbus_aio-2024.11.0/velbusaio/module_spec/01.json +50 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/02.json +11 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/03.json +18 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/05.json +42 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/06.json +105 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/07.json +11 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/08.json +30 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/09.json +24 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/0A.json +46 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/0B.json +46 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/0C.json +13 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/0E.json +25 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/0F.json +11 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/10.json +104 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/11.json +104 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/12.json +67 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/13.json +4 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/14.json +11 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/15.json +80 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/16.json +119 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/17.json +119 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/18.json +119 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/1A.json +73 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/1B.json +100 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/1D.json +83 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/1E.json +295 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/1F.json +167 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/20.json +167 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/21.json +291 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/22.json +330 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/23.json +129 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/25.json +3 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/28.json +419 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/29.json +228 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/2A.json +239 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/2B.json +239 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/2C.json +257 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/2D.json +295 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/2E.json +212 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/2F.json +208 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/30.json +46 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/31.json +465 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/32.json +365 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/33.json +239 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/34.json +157 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/35.json +157 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/36.json +157 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/37.json +297 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/38.json +102 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/39.json +4 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/3A.json +295 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/3B.json +295 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/3C.json +295 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/3D.json +419 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/3E.json +295 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/3F.json +4 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/40.json +4 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/41.json +233 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/42.json +4 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/43.json +11 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/44.json +26 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/45.json +4 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/48.json +104 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/49.json +104 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/4A.json +83 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/4B.json +126 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/4C.json +119 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/4D.json +108 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/4E.json +451 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/4F.json +89 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/50.json +89 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/51.json +89 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/52.json +189 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/54.json +4 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/55.json +4 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/56.json +4 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/57.json +222 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/5A.json +4 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/5C.json +87 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/5F.json +66 -0
- velbus_aio-2024.11.0/velbusaio/module_spec/broadcast.json +67 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/protocol.py +1 -1
- velbus_aio-2024.7.6/velbusaio/protocol.json +0 -10194
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/LICENSE +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/requirements.txt +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/setup.cfg +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/setup.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbus_aio.egg-info/dependency_links.txt +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbus_aio.egg-info/not-zip-safe +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbus_aio.egg-info/requires.txt +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbus_aio.egg-info/top_level.txt +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/__init__.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/discovery.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/exceptions.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/helpers.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/message.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/bus_active.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/bus_error_counter_status.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/bus_error_counter_status_request.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/bus_off.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/channel_name_request.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/clear_led.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/counter_status.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/counter_status_request.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/dali_device_settings.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/dali_device_settings_request.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/dali_dim_value_status.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/dimmer_channel_status.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/dimmer_status.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/edge_set_custom_color.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/fast_blinking_led.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/forced_off.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/forced_on.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/interface_status_request.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/ir_receiver_status.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/kwh_status.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/light_value_request.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/memo_text.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/memory_data.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/memory_data_block.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/memory_dump_request.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/module_status.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/module_status_request.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/module_subtype.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/module_type.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/module_type_request.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/push_button_status.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/raw.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/read_data_block_from_memory.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/read_data_from_memory.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/realtime_clock_status_request.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/receive_buffer_full.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/receive_ready.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/relay_status.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/restore_dimmer.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/select_program.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/sensor_settings_request.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/sensor_temp_request.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/sensor_temperature.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/set_date.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/set_daylight_saving.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/set_dimmer.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/set_led.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/set_realtime_clock.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/set_temperature.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/slider_status.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/slow_blinking_led.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/start_relay_blinking_timer.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/start_relay_timer.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/switch_relay_off.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/switch_relay_on.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/switch_to_comfort.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/switch_to_day.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/switch_to_night.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/switch_to_safe.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/temp_sensor_settings_part1.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/temp_sensor_settings_part2.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/temp_sensor_settings_part3.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/temp_sensor_settings_part4.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/temp_sensor_settings_request.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/temp_sensor_status.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/temp_set_cooling.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/temp_set_heating.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/update_led_status.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/very_fast_blinking_led.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/write_data_to_memory.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/write_memory_block.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/messages/write_module_address_and_serial_number.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/py.typed +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/raw_message.py +0 -0
- {velbus_aio-2024.7.6 → velbus_aio-2024.11.0}/velbusaio/util.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: velbus-aio
|
|
3
|
-
Version: 2024.
|
|
3
|
+
Version: 2024.11.0
|
|
4
4
|
Summary: Open-source home automation platform running on Python 3.
|
|
5
5
|
Author-email: Maikel Punie <maikel.punie@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -18,10 +18,11 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.10
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.11
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
22
|
Classifier: Topic :: Home Automation
|
|
22
23
|
Classifier: Topic :: Software Development :: Libraries
|
|
23
24
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
-
Requires-Python: >=3.
|
|
25
|
+
Requires-Python: >=3.9.0
|
|
25
26
|
Description-Content-Type: text/markdown
|
|
26
27
|
License-File: LICENSE
|
|
27
28
|
Requires-Dist: pyserial>=3.5.0
|
|
@@ -31,6 +32,17 @@ Requires-Dist: aiofile
|
|
|
31
32
|
|
|
32
33
|

|
|
33
34
|
[](https://results.pre-commit.ci/latest/github/Cereal2nd/velbus-aio/master)
|
|
35
|
+
[](https://badge.fury.io/py/velbus-aio)
|
|
36
|
+
[](https://github.com/Cereal2nd/velbus-aio)
|
|
37
|
+
[](https://github.com/cereal2nd/velbus-aio/blob/master/LICENSE)
|
|
38
|
+
[](https://pepy.tech/project/velbus-aio)
|
|
39
|
+
[](https://pepy.tech/project/velbus-aio)
|
|
40
|
+
[](https://pepy.tech/project/velbus-aio)
|
|
41
|
+
[](https://github.com/psf/black)
|
|
42
|
+
|
|
43
|
+
> This project requires financial support, but it is free for you to use. You can join those helping to keep the lights on at:
|
|
44
|
+
>
|
|
45
|
+
> [<img src="https://raw.githubusercontent.com/Cereal2nd/hassio-velbusd/refs/heads/main/images/bmc-button.svg" width=150 height=40 style="margin: 5px"/>](https://buymeacoffee.com/cereal2nd) [<img src="https://raw.githubusercontent.com/Cereal2nd/hassio-velbusd/refs/heads/main/images/github-sponsors-button.svg" width=150 height=40 style="margin: 5px"/>](https://github.com/sponsors/Cereal2nd/)
|
|
34
46
|
|
|
35
47
|
# velbus-aio
|
|
36
48
|
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|

|
|
2
2
|
[](https://results.pre-commit.ci/latest/github/Cereal2nd/velbus-aio/master)
|
|
3
|
+
[](https://badge.fury.io/py/velbus-aio)
|
|
4
|
+
[](https://github.com/Cereal2nd/velbus-aio)
|
|
5
|
+
[](https://github.com/cereal2nd/velbus-aio/blob/master/LICENSE)
|
|
6
|
+
[](https://pepy.tech/project/velbus-aio)
|
|
7
|
+
[](https://pepy.tech/project/velbus-aio)
|
|
8
|
+
[](https://pepy.tech/project/velbus-aio)
|
|
9
|
+
[](https://github.com/psf/black)
|
|
10
|
+
|
|
11
|
+
> This project requires financial support, but it is free for you to use. You can join those helping to keep the lights on at:
|
|
12
|
+
>
|
|
13
|
+
> [<img src="https://raw.githubusercontent.com/Cereal2nd/hassio-velbusd/refs/heads/main/images/bmc-button.svg" width=150 height=40 style="margin: 5px"/>](https://buymeacoffee.com/cereal2nd) [<img src="https://raw.githubusercontent.com/Cereal2nd/hassio-velbusd/refs/heads/main/images/github-sponsors-button.svg" width=150 height=40 style="margin: 5px"/>](https://github.com/sponsors/Cereal2nd/)
|
|
3
14
|
|
|
4
15
|
# velbus-aio
|
|
5
16
|
|
|
@@ -4,7 +4,7 @@ requires = ["setuptools", "wheel"]
|
|
|
4
4
|
[project]
|
|
5
5
|
name = "velbus-aio"
|
|
6
6
|
license = {text = "MIT"}
|
|
7
|
-
version = "2024.
|
|
7
|
+
version = "2024.11.0"
|
|
8
8
|
description = "Open-source home automation platform running on Python 3."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [
|
|
@@ -22,11 +22,12 @@ classifiers = [
|
|
|
22
22
|
"Programming Language :: Python :: 3.10",
|
|
23
23
|
"Programming Language :: Python :: 3.11",
|
|
24
24
|
"Programming Language :: Python :: 3.12",
|
|
25
|
+
"Programming Language :: Python :: 3.13",
|
|
25
26
|
"Topic :: Home Automation",
|
|
26
27
|
"Topic :: Software Development :: Libraries",
|
|
27
28
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
28
29
|
]
|
|
29
|
-
requires-python = ">=3.
|
|
30
|
+
requires-python = ">=3.9.0"
|
|
30
31
|
dependencies = [
|
|
31
32
|
"pyserial>=3.5.0",
|
|
32
33
|
"pyserial-asyncio_fast>=0.11",
|
|
@@ -51,7 +52,7 @@ exclude_dirs = ["tests"]
|
|
|
51
52
|
skips = ["B301", "B403", "B323", "B104", "B110"]
|
|
52
53
|
|
|
53
54
|
[tool.bumpver]
|
|
54
|
-
current_version = "2024.
|
|
55
|
+
current_version = "2024.11.0"
|
|
55
56
|
version_pattern = "YYYY.MM.INC0"
|
|
56
57
|
commit_message = "bump version {old_version} -> {new_version}"
|
|
57
58
|
commit = true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: velbus-aio
|
|
3
|
-
Version: 2024.
|
|
3
|
+
Version: 2024.11.0
|
|
4
4
|
Summary: Open-source home automation platform running on Python 3.
|
|
5
5
|
Author-email: Maikel Punie <maikel.punie@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -18,10 +18,11 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.10
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.11
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
22
|
Classifier: Topic :: Home Automation
|
|
22
23
|
Classifier: Topic :: Software Development :: Libraries
|
|
23
24
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
-
Requires-Python: >=3.
|
|
25
|
+
Requires-Python: >=3.9.0
|
|
25
26
|
Description-Content-Type: text/markdown
|
|
26
27
|
License-File: LICENSE
|
|
27
28
|
Requires-Dist: pyserial>=3.5.0
|
|
@@ -31,6 +32,17 @@ Requires-Dist: aiofile
|
|
|
31
32
|
|
|
32
33
|

|
|
33
34
|
[](https://results.pre-commit.ci/latest/github/Cereal2nd/velbus-aio/master)
|
|
35
|
+
[](https://badge.fury.io/py/velbus-aio)
|
|
36
|
+
[](https://github.com/Cereal2nd/velbus-aio)
|
|
37
|
+
[](https://github.com/cereal2nd/velbus-aio/blob/master/LICENSE)
|
|
38
|
+
[](https://pepy.tech/project/velbus-aio)
|
|
39
|
+
[](https://pepy.tech/project/velbus-aio)
|
|
40
|
+
[](https://pepy.tech/project/velbus-aio)
|
|
41
|
+
[](https://github.com/psf/black)
|
|
42
|
+
|
|
43
|
+
> This project requires financial support, but it is free for you to use. You can join those helping to keep the lights on at:
|
|
44
|
+
>
|
|
45
|
+
> [<img src="https://raw.githubusercontent.com/Cereal2nd/hassio-velbusd/refs/heads/main/images/bmc-button.svg" width=150 height=40 style="margin: 5px"/>](https://buymeacoffee.com/cereal2nd) [<img src="https://raw.githubusercontent.com/Cereal2nd/hassio-velbusd/refs/heads/main/images/github-sponsors-button.svg" width=150 height=40 style="margin: 5px"/>](https://github.com/sponsors/Cereal2nd/)
|
|
34
46
|
|
|
35
47
|
# velbus-aio
|
|
36
48
|
|
|
@@ -21,7 +21,6 @@ velbusaio/handler.py
|
|
|
21
21
|
velbusaio/helpers.py
|
|
22
22
|
velbusaio/message.py
|
|
23
23
|
velbusaio/module.py
|
|
24
|
-
velbusaio/protocol.json
|
|
25
24
|
velbusaio/protocol.py
|
|
26
25
|
velbusaio/py.typed
|
|
27
26
|
velbusaio/raw_message.py
|
|
@@ -107,4 +106,85 @@ velbusaio/messages/update_led_status.py
|
|
|
107
106
|
velbusaio/messages/very_fast_blinking_led.py
|
|
108
107
|
velbusaio/messages/write_data_to_memory.py
|
|
109
108
|
velbusaio/messages/write_memory_block.py
|
|
110
|
-
velbusaio/messages/write_module_address_and_serial_number.py
|
|
109
|
+
velbusaio/messages/write_module_address_and_serial_number.py
|
|
110
|
+
velbusaio/module_spec/01.json
|
|
111
|
+
velbusaio/module_spec/02.json
|
|
112
|
+
velbusaio/module_spec/03.json
|
|
113
|
+
velbusaio/module_spec/05.json
|
|
114
|
+
velbusaio/module_spec/06.json
|
|
115
|
+
velbusaio/module_spec/07.json
|
|
116
|
+
velbusaio/module_spec/08.json
|
|
117
|
+
velbusaio/module_spec/09.json
|
|
118
|
+
velbusaio/module_spec/0A.json
|
|
119
|
+
velbusaio/module_spec/0B.json
|
|
120
|
+
velbusaio/module_spec/0C.json
|
|
121
|
+
velbusaio/module_spec/0E.json
|
|
122
|
+
velbusaio/module_spec/0F.json
|
|
123
|
+
velbusaio/module_spec/10.json
|
|
124
|
+
velbusaio/module_spec/11.json
|
|
125
|
+
velbusaio/module_spec/12.json
|
|
126
|
+
velbusaio/module_spec/13.json
|
|
127
|
+
velbusaio/module_spec/14.json
|
|
128
|
+
velbusaio/module_spec/15.json
|
|
129
|
+
velbusaio/module_spec/16.json
|
|
130
|
+
velbusaio/module_spec/17.json
|
|
131
|
+
velbusaio/module_spec/18.json
|
|
132
|
+
velbusaio/module_spec/1A.json
|
|
133
|
+
velbusaio/module_spec/1B.json
|
|
134
|
+
velbusaio/module_spec/1D.json
|
|
135
|
+
velbusaio/module_spec/1E.json
|
|
136
|
+
velbusaio/module_spec/1F.json
|
|
137
|
+
velbusaio/module_spec/20.json
|
|
138
|
+
velbusaio/module_spec/21.json
|
|
139
|
+
velbusaio/module_spec/22.json
|
|
140
|
+
velbusaio/module_spec/23.json
|
|
141
|
+
velbusaio/module_spec/25.json
|
|
142
|
+
velbusaio/module_spec/28.json
|
|
143
|
+
velbusaio/module_spec/29.json
|
|
144
|
+
velbusaio/module_spec/2A.json
|
|
145
|
+
velbusaio/module_spec/2B.json
|
|
146
|
+
velbusaio/module_spec/2C.json
|
|
147
|
+
velbusaio/module_spec/2D.json
|
|
148
|
+
velbusaio/module_spec/2E.json
|
|
149
|
+
velbusaio/module_spec/2F.json
|
|
150
|
+
velbusaio/module_spec/30.json
|
|
151
|
+
velbusaio/module_spec/31.json
|
|
152
|
+
velbusaio/module_spec/32.json
|
|
153
|
+
velbusaio/module_spec/33.json
|
|
154
|
+
velbusaio/module_spec/34.json
|
|
155
|
+
velbusaio/module_spec/35.json
|
|
156
|
+
velbusaio/module_spec/36.json
|
|
157
|
+
velbusaio/module_spec/37.json
|
|
158
|
+
velbusaio/module_spec/38.json
|
|
159
|
+
velbusaio/module_spec/39.json
|
|
160
|
+
velbusaio/module_spec/3A.json
|
|
161
|
+
velbusaio/module_spec/3B.json
|
|
162
|
+
velbusaio/module_spec/3C.json
|
|
163
|
+
velbusaio/module_spec/3D.json
|
|
164
|
+
velbusaio/module_spec/3E.json
|
|
165
|
+
velbusaio/module_spec/3F.json
|
|
166
|
+
velbusaio/module_spec/40.json
|
|
167
|
+
velbusaio/module_spec/41.json
|
|
168
|
+
velbusaio/module_spec/42.json
|
|
169
|
+
velbusaio/module_spec/43.json
|
|
170
|
+
velbusaio/module_spec/44.json
|
|
171
|
+
velbusaio/module_spec/45.json
|
|
172
|
+
velbusaio/module_spec/48.json
|
|
173
|
+
velbusaio/module_spec/49.json
|
|
174
|
+
velbusaio/module_spec/4A.json
|
|
175
|
+
velbusaio/module_spec/4B.json
|
|
176
|
+
velbusaio/module_spec/4C.json
|
|
177
|
+
velbusaio/module_spec/4D.json
|
|
178
|
+
velbusaio/module_spec/4E.json
|
|
179
|
+
velbusaio/module_spec/4F.json
|
|
180
|
+
velbusaio/module_spec/50.json
|
|
181
|
+
velbusaio/module_spec/51.json
|
|
182
|
+
velbusaio/module_spec/52.json
|
|
183
|
+
velbusaio/module_spec/54.json
|
|
184
|
+
velbusaio/module_spec/55.json
|
|
185
|
+
velbusaio/module_spec/56.json
|
|
186
|
+
velbusaio/module_spec/57.json
|
|
187
|
+
velbusaio/module_spec/5A.json
|
|
188
|
+
velbusaio/module_spec/5C.json
|
|
189
|
+
velbusaio/module_spec/5F.json
|
|
190
|
+
velbusaio/module_spec/broadcast.json
|
|
@@ -19,7 +19,7 @@ from velbusaio.const import (
|
|
|
19
19
|
VOLUME_LITERS_HOUR,
|
|
20
20
|
)
|
|
21
21
|
from velbusaio.message import Message
|
|
22
|
-
from velbusaio.messages.edge_set_color import
|
|
22
|
+
from velbusaio.messages.edge_set_color import CustomColorPriority, SetEdgeColorMessage
|
|
23
23
|
from velbusaio.messages.module_status import PROGRAM_SELECTION
|
|
24
24
|
|
|
25
25
|
if TYPE_CHECKING:
|
|
@@ -38,12 +38,14 @@ class Channel:
|
|
|
38
38
|
num: int,
|
|
39
39
|
name: str,
|
|
40
40
|
nameEditable: bool,
|
|
41
|
+
subDevice: bool,
|
|
41
42
|
writer: Callable[[Message], Awaitable[None]],
|
|
42
43
|
address: int,
|
|
43
44
|
):
|
|
44
45
|
self._num = num
|
|
45
46
|
self._module = module
|
|
46
47
|
self._name = name
|
|
48
|
+
self._subDevice = subDevice
|
|
47
49
|
if not nameEditable:
|
|
48
50
|
self._is_loaded = True
|
|
49
51
|
else:
|
|
@@ -80,6 +82,8 @@ class Channel:
|
|
|
80
82
|
return self._num
|
|
81
83
|
|
|
82
84
|
def get_full_name(self) -> str:
|
|
85
|
+
if self._subDevice:
|
|
86
|
+
return f"{self._module.get_name()} ({self._module.get_type_name()}) - {self._name}"
|
|
83
87
|
return f"{self._module.get_name()} ({self._module.get_type_name()})"
|
|
84
88
|
|
|
85
89
|
def is_loaded(self) -> bool:
|
|
@@ -94,6 +98,9 @@ class Channel:
|
|
|
94
98
|
def is_temperature(self) -> bool:
|
|
95
99
|
return False
|
|
96
100
|
|
|
101
|
+
def is_sub_device(self) -> bool:
|
|
102
|
+
return self._subDevice
|
|
103
|
+
|
|
97
104
|
def get_name(self) -> str:
|
|
98
105
|
"""
|
|
99
106
|
:return: the channel name
|
|
@@ -137,7 +144,11 @@ class Channel:
|
|
|
137
144
|
}
|
|
138
145
|
|
|
139
146
|
def to_cache(self) -> dict:
|
|
140
|
-
dst = {
|
|
147
|
+
dst = {
|
|
148
|
+
"name": self._name,
|
|
149
|
+
"type": type(self).__name__,
|
|
150
|
+
"subdevice": self._subDevice,
|
|
151
|
+
}
|
|
141
152
|
if hasattr(self, "_Unit"):
|
|
142
153
|
dst["Unit"] = self._Unit
|
|
143
154
|
return dst
|
|
@@ -448,11 +459,12 @@ class Dimmer(Channel):
|
|
|
448
459
|
num: int,
|
|
449
460
|
name: str,
|
|
450
461
|
nameEditable: bool,
|
|
462
|
+
subDevice: bool,
|
|
451
463
|
writer: Callable[[Message], Awaitable[None]],
|
|
452
464
|
address: int,
|
|
453
465
|
slider_scale: int = 100,
|
|
454
466
|
):
|
|
455
|
-
super().__init__(module, num, name, nameEditable, writer, address)
|
|
467
|
+
super().__init__(module, num, name, nameEditable, subDevice, writer, address)
|
|
456
468
|
|
|
457
469
|
self.slider_scale = slider_scale
|
|
458
470
|
# VMB4DC has dim values 0(off), 1-99(dimmed), 100(full on)
|
|
@@ -508,7 +520,7 @@ class Temperature(Channel):
|
|
|
508
520
|
_min = None
|
|
509
521
|
_target = 0
|
|
510
522
|
_cmode = None
|
|
511
|
-
|
|
523
|
+
_cool_mode = None
|
|
512
524
|
_cstatus = None
|
|
513
525
|
_thermostat = False
|
|
514
526
|
_sleep_timer = 0
|
|
@@ -9,8 +9,8 @@ MODULE_DIRECTORY = {
|
|
|
9
9
|
0x01: "VMB8PB",
|
|
10
10
|
0x02: "VMB1RY",
|
|
11
11
|
0x03: "VMB1BL",
|
|
12
|
-
0x04: "VMB4LEDPWM-20",
|
|
13
12
|
0x05: "VMB6IN",
|
|
13
|
+
0x06: "VMB4LEDPWM-20",
|
|
14
14
|
0x07: "VMB1DM",
|
|
15
15
|
0x08: "VMB4RY",
|
|
16
16
|
0x09: "VMB2BL",
|
|
@@ -73,14 +73,16 @@ MODULE_DIRECTORY = {
|
|
|
73
73
|
0x4A: "VMB2BLE-10",
|
|
74
74
|
0x4B: "VMB8DC-20",
|
|
75
75
|
0x4C: "VMB6PB-20",
|
|
76
|
+
0x4D: "VMBPIR-20",
|
|
77
|
+
0x4E: "VMB8IN-20",
|
|
76
78
|
0x4F: "VMBEL1-20",
|
|
77
79
|
0x50: "VMBEL2-20",
|
|
78
80
|
0x51: "VMBEL4-20",
|
|
79
81
|
0x52: "VMBELO-20",
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
0x54: "VMBGP1-20",
|
|
83
|
+
0x55: "VMBGP2-20",
|
|
84
|
+
0x56: "VMBGP4-20",
|
|
85
|
+
0x57: "VMBGPO-20",
|
|
84
86
|
0x5A: "VMBDALI-20",
|
|
85
87
|
0x5C: "VMBEL4PIR-20",
|
|
86
88
|
0x5F: "VMBGP4PIR-20",
|
|
@@ -40,7 +40,7 @@ NO_RTR: Final = 0x00
|
|
|
40
40
|
CACHEDIR: Final = ".velbuscache"
|
|
41
41
|
|
|
42
42
|
# Module scan timeout values (in mSec)
|
|
43
|
-
SCAN_MODULETYPE_TIMEOUT: Final =
|
|
43
|
+
SCAN_MODULETYPE_TIMEOUT: Final = 3000 # time to wait for ModuleTypeRequest
|
|
44
44
|
SCAN_MODULEINFO_TIMEOUT_INITIAL: Final = 1000 # time to wait for first info (status)
|
|
45
45
|
SCAN_MODULEINFO_TIMEOUT_INTERVAL: Final = (
|
|
46
46
|
150 # time to wait for info interval (between next message)
|
|
@@ -34,6 +34,7 @@ class Velbus:
|
|
|
34
34
|
self,
|
|
35
35
|
dsn: str,
|
|
36
36
|
cache_dir: str = get_cache_dir(),
|
|
37
|
+
one_address: int | None = None,
|
|
37
38
|
) -> None:
|
|
38
39
|
"""Init the Velbus controller."""
|
|
39
40
|
self._log = logging.getLogger("velbus")
|
|
@@ -46,7 +47,7 @@ class Velbus:
|
|
|
46
47
|
self._auto_reconnect = True
|
|
47
48
|
|
|
48
49
|
self._dsn = dsn
|
|
49
|
-
self._handler = PacketHandler(self)
|
|
50
|
+
self._handler = PacketHandler(self, one_address)
|
|
50
51
|
self._modules: dict[int, Module] = {}
|
|
51
52
|
self._submodules: list[int] = []
|
|
52
53
|
self._send_queue: asyncio.Queue = asyncio.Queue()
|
|
@@ -67,11 +68,10 @@ class Velbus:
|
|
|
67
68
|
self._log.debug("Reconnecting to transport")
|
|
68
69
|
asyncio.ensure_future(self.connect())
|
|
69
70
|
|
|
70
|
-
def add_module(
|
|
71
|
+
async def add_module(
|
|
71
72
|
self,
|
|
72
73
|
addr: int,
|
|
73
74
|
typ: int,
|
|
74
|
-
data: dict,
|
|
75
75
|
serial: int | None = None,
|
|
76
76
|
memorymap: int | None = None,
|
|
77
77
|
build_year: int | None = None,
|
|
@@ -81,14 +81,13 @@ class Velbus:
|
|
|
81
81
|
module = Module.factory(
|
|
82
82
|
addr,
|
|
83
83
|
typ,
|
|
84
|
-
data,
|
|
85
84
|
serial=serial,
|
|
86
85
|
build_year=build_year,
|
|
87
86
|
build_week=build_week,
|
|
88
87
|
memorymap=memorymap,
|
|
89
88
|
cache_dir=self._cache_dir,
|
|
90
89
|
)
|
|
91
|
-
module.initialize(self.send)
|
|
90
|
+
await module.initialize(self.send)
|
|
92
91
|
self._modules[addr] = module
|
|
93
92
|
self._log.info(f"Found module {addr}: {module}")
|
|
94
93
|
|
|
@@ -102,6 +101,10 @@ class Velbus:
|
|
|
102
101
|
self._modules[sub_addr] = module
|
|
103
102
|
module.cleanupSubChannels()
|
|
104
103
|
|
|
104
|
+
def addr_is_submodule(self, addr: int) -> bool:
|
|
105
|
+
"""Check if an address is a submodule."""
|
|
106
|
+
return addr in self._submodules
|
|
107
|
+
|
|
105
108
|
def get_modules(self) -> dict:
|
|
106
109
|
"""Return the module cache."""
|
|
107
110
|
return self._modules
|
|
@@ -5,30 +5,30 @@ Velbus packet handler
|
|
|
5
5
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
|
-
from velbusaio.const import SCAN_MODULETYPE_TIMEOUT
|
|
9
|
-
from velbusaio.const import SCAN_MODULEINFO_TIMEOUT_INITIAL
|
|
10
|
-
from velbusaio.const import SCAN_MODULEINFO_TIMEOUT_INTERVAL
|
|
11
|
-
|
|
12
8
|
import asyncio
|
|
9
|
+
import importlib.resources
|
|
13
10
|
import json
|
|
14
11
|
import logging
|
|
15
|
-
import threading
|
|
16
12
|
import os
|
|
17
13
|
import pathlib
|
|
14
|
+
import pprint
|
|
15
|
+
import sys
|
|
16
|
+
from typing import TYPE_CHECKING, Awaitable, Callable
|
|
18
17
|
|
|
19
18
|
from aiofile import async_open
|
|
20
19
|
|
|
21
|
-
from typing import TYPE_CHECKING, Awaitable, Callable
|
|
22
|
-
import pkg_resources
|
|
23
|
-
|
|
24
20
|
from velbusaio.command_registry import commandRegistry
|
|
21
|
+
from velbusaio.const import (
|
|
22
|
+
SCAN_MODULEINFO_TIMEOUT_INITIAL,
|
|
23
|
+
SCAN_MODULEINFO_TIMEOUT_INTERVAL,
|
|
24
|
+
SCAN_MODULETYPE_TIMEOUT,
|
|
25
|
+
)
|
|
25
26
|
from velbusaio.helpers import h2, keys_exists
|
|
26
27
|
from velbusaio.message import Message
|
|
27
28
|
from velbusaio.messages.module_subtype import ModuleSubTypeMessage
|
|
28
|
-
from velbusaio.messages.module_type import
|
|
29
|
+
from velbusaio.messages.module_type import ModuleType2Message, ModuleTypeMessage
|
|
29
30
|
from velbusaio.raw_message import RawMessage
|
|
30
31
|
|
|
31
|
-
|
|
32
32
|
if TYPE_CHECKING:
|
|
33
33
|
from velbusaio.controller import Velbus
|
|
34
34
|
|
|
@@ -41,21 +41,34 @@ class PacketHandler:
|
|
|
41
41
|
def __init__(
|
|
42
42
|
self,
|
|
43
43
|
velbus: Velbus,
|
|
44
|
+
one_address: int | None = None,
|
|
44
45
|
) -> None:
|
|
45
46
|
self._log = logging.getLogger("velbus-handler")
|
|
46
47
|
self._log.setLevel(logging.DEBUG)
|
|
47
48
|
self._velbus = velbus
|
|
49
|
+
self._one_address = one_address
|
|
48
50
|
self._typeResponseReceived = asyncio.Event()
|
|
49
|
-
self._scanLock =
|
|
51
|
+
self._scanLock = asyncio.Lock()
|
|
50
52
|
self._modulescan_address = 0
|
|
51
53
|
self._scan_complete = False
|
|
52
54
|
self._scan_delay_msec = 0
|
|
53
55
|
|
|
54
56
|
async def read_protocol_data(self):
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
if sys.version_info >= (3, 13):
|
|
58
|
+
with importlib.resources.path(
|
|
59
|
+
__name__, "module_spec/broadcast.json"
|
|
60
|
+
) as fspath:
|
|
61
|
+
async with async_open(fspath) as protocol_file:
|
|
62
|
+
self.broadcast = json.loads(await protocol_file.read())
|
|
63
|
+
else:
|
|
64
|
+
async with async_open(
|
|
65
|
+
str(
|
|
66
|
+
importlib.resources.files(__name__.split(".")[0]).joinpath(
|
|
67
|
+
"module_spec/broadcast.json"
|
|
68
|
+
)
|
|
69
|
+
)
|
|
70
|
+
) as protocol_file:
|
|
71
|
+
self.broadcast = json.loads(await protocol_file.read())
|
|
59
72
|
|
|
60
73
|
def empty_cache(self) -> bool:
|
|
61
74
|
if (
|
|
@@ -84,12 +97,22 @@ class PacketHandler:
|
|
|
84
97
|
while self._modulescan_address < 254:
|
|
85
98
|
address = 0
|
|
86
99
|
module = None
|
|
87
|
-
with self._scanLock:
|
|
100
|
+
async with self._scanLock:
|
|
88
101
|
self._modulescan_address = self._modulescan_address + 1
|
|
89
102
|
address = self._modulescan_address
|
|
103
|
+
if self._velbus.addr_is_submodule(address):
|
|
104
|
+
self._log.info(
|
|
105
|
+
f"Skipping submodule address {address}, already handled"
|
|
106
|
+
)
|
|
107
|
+
continue
|
|
108
|
+
self._log.info(f"Starting handling scan {address}")
|
|
90
109
|
module = self._velbus.get_module(address)
|
|
91
110
|
|
|
92
|
-
self.
|
|
111
|
+
if self._one_address is not None and address != int(self._one_address):
|
|
112
|
+
self._log.info(
|
|
113
|
+
f"Skipping address {address} as we requested to only scan one address {self._one_address}"
|
|
114
|
+
)
|
|
115
|
+
continue
|
|
93
116
|
|
|
94
117
|
cfile = pathlib.Path(f"{self._velbus.get_cache_dir()}/{address}.json")
|
|
95
118
|
# cleanup the old module cache if needed
|
|
@@ -107,7 +130,7 @@ class PacketHandler:
|
|
|
107
130
|
self._typeResponseReceived.wait(),
|
|
108
131
|
SCAN_MODULETYPE_TIMEOUT / 1000.0,
|
|
109
132
|
)
|
|
110
|
-
with self._scanLock:
|
|
133
|
+
async with self._scanLock:
|
|
111
134
|
module = self._velbus.get_module(address)
|
|
112
135
|
except asyncio.TimeoutError:
|
|
113
136
|
self._log.info(
|
|
@@ -115,20 +138,24 @@ class PacketHandler:
|
|
|
115
138
|
)
|
|
116
139
|
if module is not None:
|
|
117
140
|
try:
|
|
118
|
-
self._log.debug(
|
|
141
|
+
self._log.debug(
|
|
142
|
+
f"Module {module._address} detected: start loading"
|
|
143
|
+
)
|
|
119
144
|
await asyncio.wait_for(
|
|
120
145
|
module.load(from_cache=True),
|
|
121
146
|
SCAN_MODULEINFO_TIMEOUT_INITIAL / 1000.0,
|
|
122
147
|
)
|
|
123
|
-
self._scan_delay_msec =
|
|
124
|
-
while
|
|
148
|
+
self._scan_delay_msec = module.get_initial_timeout()
|
|
149
|
+
while (
|
|
150
|
+
self._scan_delay_msec > 50 and not await module.is_loaded()
|
|
151
|
+
):
|
|
125
152
|
# self._log.debug(
|
|
126
|
-
# f"\t... waiting {self._scan_delay_msec} is_loaded={module.is_loaded()}"
|
|
153
|
+
# f"\t... waiting {self._scan_delay_msec} is_loaded={await module.is_loaded()}"
|
|
127
154
|
# )
|
|
128
155
|
self._scan_delay_msec = self._scan_delay_msec - 50
|
|
129
156
|
await asyncio.sleep(0.05)
|
|
130
157
|
self._log.info(
|
|
131
|
-
f"Scan module {address} completed, module loaded={module.is_loaded()}"
|
|
158
|
+
f"Scan module {address} completed, module loaded={await module.is_loaded()}"
|
|
132
159
|
)
|
|
133
160
|
except asyncio.TimeoutError:
|
|
134
161
|
self._log.error(
|
|
@@ -153,49 +180,47 @@ class PacketHandler:
|
|
|
153
180
|
data = rawmsg.data_only
|
|
154
181
|
|
|
155
182
|
# handle module type response message
|
|
156
|
-
if command_value == 0xFF:
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
self._modulescan_address = address - 1
|
|
183
|
+
if command_value == 0xFF and not self._scan_complete:
|
|
184
|
+
tmsg: ModuleTypeMessage = ModuleTypeMessage()
|
|
185
|
+
tmsg.populate(priority, address, rtr, data)
|
|
186
|
+
async with self._scanLock:
|
|
187
|
+
await self._handle_module_type(tmsg)
|
|
188
|
+
if address == self._modulescan_address:
|
|
189
|
+
self._typeResponseReceived.set()
|
|
190
|
+
else:
|
|
191
|
+
self._log.debug(
|
|
192
|
+
f"Unexpected module type message module address {address}, Velbuslink scan?"
|
|
193
|
+
)
|
|
194
|
+
self._modulescan_address = address - 1
|
|
169
195
|
|
|
170
|
-
|
|
196
|
+
self._typeResponseReceived.set()
|
|
171
197
|
|
|
172
198
|
# handle module subtype response message
|
|
173
|
-
elif command_value in (0xB0, 0xA7, 0xA6):
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
self._handle_module_subtype(msg)
|
|
199
|
+
elif command_value in (0xB0, 0xA7, 0xA6) and not self._scan_complete:
|
|
200
|
+
msg: ModuleSubTypeMessage = ModuleSubTypeMessage()
|
|
201
|
+
msg.populate(priority, address, rtr, data)
|
|
202
|
+
if command_value == 0xB0:
|
|
203
|
+
msg.sub_address_offset = 0
|
|
204
|
+
elif command_value == 0xA7:
|
|
205
|
+
msg.sub_address_offset = 4
|
|
206
|
+
elif command_value == 0xA6:
|
|
207
|
+
msg.sub_address_offset = 8
|
|
208
|
+
async with self._scanLock:
|
|
209
|
+
self._scan_delay_msec += SCAN_MODULEINFO_TIMEOUT_INTERVAL
|
|
210
|
+
self._handle_module_subtype(msg)
|
|
186
211
|
|
|
187
212
|
# ignore broadcast
|
|
188
|
-
elif command_value in self.
|
|
213
|
+
elif command_value in self.broadcast:
|
|
189
214
|
self._log.debug(
|
|
190
215
|
"Received broadcast message {} from {}, ignoring".format(
|
|
191
|
-
self.
|
|
216
|
+
self.broadcast[str(command_value).upper()], address
|
|
192
217
|
)
|
|
193
218
|
)
|
|
194
219
|
|
|
195
220
|
# handle other messages for modules that are already scanned
|
|
196
221
|
else:
|
|
197
222
|
module = None
|
|
198
|
-
with self._scanLock:
|
|
223
|
+
async with self._scanLock:
|
|
199
224
|
module = self._velbus.get_module(address)
|
|
200
225
|
if module is not None:
|
|
201
226
|
module_type = module.get_type()
|
|
@@ -214,28 +239,29 @@ class PacketHandler:
|
|
|
214
239
|
0xFE,
|
|
215
240
|
0xCC,
|
|
216
241
|
): # names, memory data, memory block
|
|
217
|
-
self._scan_delay_msec
|
|
242
|
+
self._scan_delay_msec += SCAN_MODULEINFO_TIMEOUT_INTERVAL
|
|
218
243
|
# self._log.debug(f"Restart timeout {msg}")
|
|
219
244
|
# send the message to the modules
|
|
220
245
|
await module.on_message(msg)
|
|
221
246
|
else:
|
|
222
247
|
self._log.warning(f"NOT FOUND IN command_registry: {rawmsg}")
|
|
223
248
|
|
|
224
|
-
def _handle_module_type(
|
|
249
|
+
async def _handle_module_type(
|
|
250
|
+
self, msg: ModuleTypeMessage | ModuleType2Message
|
|
251
|
+
) -> None:
|
|
225
252
|
"""
|
|
226
253
|
load the module data
|
|
227
254
|
"""
|
|
228
255
|
if msg is not None:
|
|
229
256
|
module = self._velbus.get_module(msg.address)
|
|
230
257
|
if module is None:
|
|
231
|
-
data = keys_exists(self.pdata, "ModuleTypes", h2(msg.module_type))
|
|
232
|
-
if not data:
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
self._velbus.add_module(
|
|
258
|
+
# data = keys_exists(self.pdata, "ModuleTypes", h2(msg.module_type))
|
|
259
|
+
# if not data:
|
|
260
|
+
# self._log.warning(f"Module not recognized: {msg.module_type}")
|
|
261
|
+
# return
|
|
262
|
+
await self._velbus.add_module(
|
|
236
263
|
msg.address,
|
|
237
264
|
msg.module_type,
|
|
238
|
-
data,
|
|
239
265
|
memorymap=msg.memory_map_version,
|
|
240
266
|
build_year=msg.build_year,
|
|
241
267
|
build_week=msg.build_week,
|