boneIO 0.11.0.dev4__tar.gz → 0.11.0.dev5__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.
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/PKG-INFO +1 -1
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/cover/cover.py +4 -4
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/cover/previous.py +6 -6
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/group/output.py +1 -1
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/ha_discovery.py +25 -5
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/loader.py +47 -23
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/mqtt.py +3 -6
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/yaml_util.py +75 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/manager.py +60 -73
- boneio-0.11.0.dev5/boneio/message_bus/__init__.py +6 -0
- boneio-0.11.0.dev5/boneio/message_bus/basic.py +51 -0
- boneio-0.11.0.dev4/boneio/helper/message_bus.py → boneio-0.11.0.dev5/boneio/message_bus/local.py +8 -34
- boneio-0.11.0.dev4/boneio/mqtt_client.py → boneio-0.11.0.dev5/boneio/message_bus/mqtt.py +22 -5
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/modbus/sensor.py +4 -4
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/modbus/single_sensor.py +5 -6
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/relay/basic.py +109 -4
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/runner.py +3 -4
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/schema/actions.yaml +6 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/schema/schema.yaml +8 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/sensor/adc.py +1 -1
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/sensor/ina219.py +1 -1
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/sensor/serial_number.py +1 -1
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/sensor/temp/__init__.py +1 -1
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/sensor/temp/dallas.py +1 -1
- boneio-0.11.0.dev5/boneio/version.py +2 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/schema/binary_sensor.schema.json +16 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/schema/config.schema.json +49 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/schema/event.schema.json +24 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/schema/output.schema.json +9 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/pyproject.toml +1 -1
- boneio-0.11.0.dev4/boneio/version.py +0 -2
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/LICENSE +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/README.md +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/__init__.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/boards/0.7/input.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/boards/0.7/output_24_16.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/boards/0.7/output_32_10.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/boards/0.7/output_cover.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/boards/0.7/output_cover_mix.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/boards/0.8/input.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/boards/0.8/output_24_16.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/boards/0.8/output_32_10.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/boards/0.8/output_cover.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/boards/0.8/output_cover_mix.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/bonecli.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/const.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/cover/__init__.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/cover/time_based.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/cover/venetian.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/24x16/adc.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/24x16/binary_sensor.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/24x16/config.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/24x16/event.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/24x16/mqtt.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/24x16/output24x16A.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/32x10/adc.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/32x10/binary_sensor.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/32x10/config.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/32x10/event.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/32x10/mqtt.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/32x10/output32x10A.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/__init__.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/cover/adc.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/cover/binary_sensor.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/cover/config.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/cover/cover.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/cover/event.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/cover/mqtt.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/cover/outputCover.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/cover_mix/adc.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/cover_mix/binary_sensor.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/cover_mix/config.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/cover_mix/cover.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/cover_mix/event.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/cover_mix/mqtt.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/cover_mix/outputCoverMix.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/different_configs/adc.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/different_configs/all_binary_sensor.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/different_configs/binary_sensor.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/different_configs/binary_sensor_v_0_7.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/different_configs/config_24_16.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/different_configs/event_all.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/different_configs/event_v_0_7.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/different_configs/led32x4A.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/different_configs/output24x16A.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/different_configs/output24x16A_v0.3.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/different_configs/output32x10A.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/example_config/different_configs/output32x5A.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/fonts/danube__.ttf +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/group/__init__.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/__init__.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/async_updater.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/click_timer.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/config.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/events.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/exceptions.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/filter.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/gpio.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/gpiod.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/interlock.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/logger.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/oled.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/onewire/W1ThermSensor.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/onewire/__init__.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/onewire/ds2482.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/onewire/onewire.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/pcf8575.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/queue.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/schema_converter.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/sensor/ina_219_smbus.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/state_manager.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/stats.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/timeperiod.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/helper/util.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/input/__init__.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/input/gpio.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/input/gpio_new.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/modbus/__init__.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/modbus/client.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/modbus/cwt.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/modbus/dts1964_3f.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/modbus/liquid-sensor.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/modbus/modbuscli.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/modbus/orno-or-we-517.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/modbus/pt100.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/modbus/r4dcb08.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/modbus/sdm120.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/modbus/sdm630.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/modbus/sht20.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/modbus/sht30.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/modbus/socomec_e03.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/modbus/socomec_e23.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/modbus/sofar.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/modbus/utils.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/models/__init__.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/models/files.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/models/logs.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/oled.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/relay/__init__.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/relay/gpio.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/relay/mcp.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/relay/pca.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/relay/pcf.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/schema/actions_sensor.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/schema/actions_switch.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/schema/filters.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/schema/filters_adc.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/schema/id.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/schema/temp_unit.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/schema/update_interval.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/sensor/__init__.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/sensor/gpio.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/sensor/gpio_new.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/sensor/temp/lm75.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/sensor/temp/mcp9808.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/app.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/abap-BrgZPUOV.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/apex-DyP6w7ZV.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/azcli-BaLxmfj-.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/bat-CFOPXBzS.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/bicep-BfEKNvv3.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/cameligo-BFG1Mk7z.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/clojure-DTECt2xU.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/codicon-DCmgc-ay.ttf +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/coffee-CDGzqUPQ.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/cpp-CLLBncYj.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/csharp-dUCx_-0o.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/csp-5Rap-vPy.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/css-D3h14YRZ.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/cssMode-C5afUc0K.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/cypher-DrQuvNYM.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/dart-CFKIUWau.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/dockerfile-Zznr-cwX.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/ecl-Ce3n6wWz.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/editor.worker-oRlJJsnX.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/elixir-deUWdS0T.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/flow9-i9-g7ZhI.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/freemarker2-emRcpycN.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/fsharp-CzKuDChf.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/go-Cphgjts3.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/graphql-Cg7bfA9N.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/handlebars-mMSD-c9g.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/hcl-0cvrggvQ.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/html-Clq5L_-r.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/htmlMode-CYqwdxDX.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/index-BcJKL9Rz.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/index-DzcnWIxb.css +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/ini-Drc7WvVn.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/java-B_fMsGYe.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/javascript-BR7Nbw1G.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/json.worker-BnUULff4.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/jsonMode-aJvzz7xf.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/julia-Bqgm2twL.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/kotlin-BSkB5QuD.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/less-BsTHnhdd.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/lexon-YWi4-JPR.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/liquid-BNyvmcbu.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/lua-nf6ki56Z.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/m3-Cpb6xl2v.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/markdown-DSZPf7rp.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/mdx-pWhQfMuK.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/mips-B_c3zf-v.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/msdax-rUNN04Wq.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/mysql-DDwshQtU.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/objective-c-B5zXfXm9.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/pascal-CXOwvkN_.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/pascaligo-Bc-ZgV77.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/perl-CwNk8-XU.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/pgsql-tGk8EFnU.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/php-CpIb_Oan.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/pla-B03wrqEc.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/postiats-BKlk5iyT.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/powerquery-Bhzvs7bI.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/powershell-Dd3NCNK9.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/protobuf-COyEY5Pt.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/pug-BaJupSGV.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/python-CVtAQrrC.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/qsharp-DXyYeYxl.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/r-CdQndTaG.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/razor-BBiV-C6e.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/redis-CVwtpugi.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/redshift-25W9uPmb.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/restructuredtext-DfzH4Xui.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/ruby-Cp1zYvxS.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/rust-D5C2fndG.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/sb-CDntyWJ8.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/scala-BoFRg7Ot.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/scheme-Bio4gycK.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/scss-4Ik7cdeQ.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/shell-CX-rkNHf.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/solidity-Tw7wswEv.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/sophia-C5WLch3f.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/sparql-DHaeiCBh.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/sql-CCSDG5nI.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/st-pnP8ivHi.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/swift-DwJ7jVG9.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/systemverilog-B9Xyijhd.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/tcl-DnHyzjbg.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/tsMode-COZIvtMx.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/twig-CPajHgWi.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/typescript-DKdGc2VX.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/typespec-D-MeaMDU.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/vb-DgyLZaXg.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/wgsl-BIv9DU6q.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/xml-CTK9ybeu.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/yaml-ggTgJ1wa.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/assets/yaml.worker-DSHdx_mx.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/boneio.svg +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/boneio_fav.svg +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/frontend-dist/index.html +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/schema/adc.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/schema/boneio.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/schema/cover.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/schema/dallas.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/schema/ds2482.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/schema/ina219.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/schema/lm75.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/schema/logger.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/schema/mcp23017.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/schema/mcp9808.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/schema/modbus.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/schema/modbus_sensors.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/schema/mqtt.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/schema/oled.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/schema/output_group.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/schema/pca9685.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/schema/pcf8575.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/schema/sensor.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/schema/web.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/web_server.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/boneio/webui/websocket_manager.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/tests/32_5_config.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/tests/bandit.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev5}/tests/relay_32_5.py +0 -0
|
@@ -202,14 +202,14 @@ class BaseCover(BaseCoverABC, BasicMqtt):
|
|
|
202
202
|
return
|
|
203
203
|
_LOGGER.info("Opening cover %s.", self._id)
|
|
204
204
|
await self.run_cover(current_operation=OPENING)
|
|
205
|
-
self.
|
|
205
|
+
self._message_bus.send_message(topic=f"{self._send_topic}/state", payload=OPENING)
|
|
206
206
|
|
|
207
207
|
async def close(self) -> None:
|
|
208
208
|
if self._position <= 0:
|
|
209
209
|
return
|
|
210
210
|
_LOGGER.info("Closing cover %s.", self._id)
|
|
211
211
|
await self.run_cover(current_operation=CLOSING)
|
|
212
|
-
self.
|
|
212
|
+
self._message_bus.send_message(topic=f"{self._send_topic}/state", payload=CLOSING)
|
|
213
213
|
|
|
214
214
|
async def set_cover_position(self, position: int) -> None:
|
|
215
215
|
if not 0 <= position <= 100:
|
|
@@ -281,8 +281,8 @@ class BaseCover(BaseCoverABC, BasicMqtt):
|
|
|
281
281
|
**json_position
|
|
282
282
|
)
|
|
283
283
|
await self._event_bus.async_trigger_event(event_type="cover", entity_id=self.id, event=event)
|
|
284
|
-
self.
|
|
285
|
-
self.
|
|
284
|
+
self._message_bus.send_message(topic=f"{self._send_topic}/state", payload=state)
|
|
285
|
+
self._message_bus.send_message(topic=f"{self._send_topic}/pos", payload=json_position)
|
|
286
286
|
|
|
287
287
|
async def send_state_and_save(self, json_position: PositionDict):
|
|
288
288
|
await self.send_state(self.state, json_position)
|
|
@@ -150,11 +150,11 @@ class PreviousCover(BasicMqtt):
|
|
|
150
150
|
|
|
151
151
|
def send_state(self) -> None:
|
|
152
152
|
"""Send state of cover to mqtt."""
|
|
153
|
-
self.
|
|
153
|
+
self._message_bus.send_message(
|
|
154
154
|
topic=f"{self._send_topic}/state", payload=self.state
|
|
155
155
|
)
|
|
156
156
|
pos = round(self._position, 0)
|
|
157
|
-
self.
|
|
157
|
+
self._message_bus.send_message(topic=f"{self._send_topic}/pos", payload={ "position": str(pos) })
|
|
158
158
|
self._state_save(value={"position": pos})
|
|
159
159
|
|
|
160
160
|
def _stop_cover(self, on_exit=False) -> None:
|
|
@@ -201,7 +201,7 @@ class PreviousCover(BasicMqtt):
|
|
|
201
201
|
rounded_pos = 100
|
|
202
202
|
elif rounded_pos < 0:
|
|
203
203
|
rounded_pos = 0
|
|
204
|
-
self.
|
|
204
|
+
self._message_bus.send_message(topic=f"{self._send_topic}/pos", payload={"position": str(rounded_pos)})
|
|
205
205
|
asyncio.create_task(self.async_send_state())
|
|
206
206
|
if rounded_pos == self._set_position or (
|
|
207
207
|
self._set_position is None
|
|
@@ -224,7 +224,7 @@ class PreviousCover(BasicMqtt):
|
|
|
224
224
|
_LOGGER.info("Closing cover %s.", self._id)
|
|
225
225
|
|
|
226
226
|
self._requested_closing = True
|
|
227
|
-
self.
|
|
227
|
+
self._message_bus.send_message(topic=f"{self._send_topic}/state", payload=CLOSING)
|
|
228
228
|
await self.run_cover(
|
|
229
229
|
current_operation=CLOSING,
|
|
230
230
|
)
|
|
@@ -239,7 +239,7 @@ class PreviousCover(BasicMqtt):
|
|
|
239
239
|
_LOGGER.info("Opening cover %s.", self._id)
|
|
240
240
|
|
|
241
241
|
self._requested_closing = False
|
|
242
|
-
self.
|
|
242
|
+
self._message_bus.send_message(topic=f"{self._send_topic}/state", payload=OPENING)
|
|
243
243
|
await self.run_cover(
|
|
244
244
|
current_operation=OPENING,
|
|
245
245
|
)
|
|
@@ -261,7 +261,7 @@ class PreviousCover(BasicMqtt):
|
|
|
261
261
|
set_position,
|
|
262
262
|
current_operation,
|
|
263
263
|
)
|
|
264
|
-
self.
|
|
264
|
+
self._message_bus.send_message(
|
|
265
265
|
topic=f"{self._send_topic}/state", payload=current_operation
|
|
266
266
|
)
|
|
267
267
|
await self.run_cover(
|
|
@@ -26,6 +26,7 @@ def ha_availabilty_message(
|
|
|
26
26
|
id: str,
|
|
27
27
|
name: str,
|
|
28
28
|
topic: str = "boneIO",
|
|
29
|
+
device_name: str = "boneIO",
|
|
29
30
|
device_type: str = INPUT,
|
|
30
31
|
model: str = "boneIO Relay Board",
|
|
31
32
|
web_url: str | None = None,
|
|
@@ -42,16 +43,36 @@ def ha_availabilty_message(
|
|
|
42
43
|
"identifiers": [topic],
|
|
43
44
|
"manufacturer": "boneIO",
|
|
44
45
|
"model": model,
|
|
45
|
-
"name":
|
|
46
|
+
"name": device_name,
|
|
46
47
|
"sw_version": __version__,
|
|
47
48
|
**web_url
|
|
48
49
|
},
|
|
49
50
|
"name": name,
|
|
50
51
|
"state_topic": f"{topic}/{device_type}/{id}",
|
|
51
52
|
"unique_id": f"{topic}{device_type}{id}",
|
|
53
|
+
# "object_id": f"{topic}{device_type}{id}",
|
|
52
54
|
**kwargs,
|
|
53
55
|
}
|
|
54
56
|
|
|
57
|
+
def ha_virtual_energy_sensor_discovery_message(
|
|
58
|
+
topic: str,
|
|
59
|
+
relay_id: str,
|
|
60
|
+
**kwargs
|
|
61
|
+
) -> dict[str, str]:
|
|
62
|
+
"""
|
|
63
|
+
Generate MQTT autodiscovery messages for Home Assistant for virtual power and energy sensors.
|
|
64
|
+
Returns two dicts:
|
|
65
|
+
- sensor.<id>_power: current power in W
|
|
66
|
+
- sensor.<id>_energy: total energy in Wh
|
|
67
|
+
"""
|
|
68
|
+
# Power sensor discovery
|
|
69
|
+
msg = ha_availabilty_message(
|
|
70
|
+
state_topic=f"{topic}/energy/{relay_id}",
|
|
71
|
+
topic=topic,
|
|
72
|
+
**kwargs,
|
|
73
|
+
)
|
|
74
|
+
return msg
|
|
75
|
+
|
|
55
76
|
|
|
56
77
|
def ha_light_availabilty_message(id: str, topic: str = "boneIO", device_type: str = RELAY, **kwargs):
|
|
57
78
|
"""Create LIGHT availability topic for HA."""
|
|
@@ -124,10 +145,9 @@ def ha_adc_sensor_availabilty_message(**kwargs):
|
|
|
124
145
|
return msg
|
|
125
146
|
|
|
126
147
|
|
|
127
|
-
def ha_sensor_availabilty_message(
|
|
128
|
-
msg = ha_availabilty_message(device_type=
|
|
129
|
-
|
|
130
|
-
return msg
|
|
148
|
+
def ha_sensor_availabilty_message(device_type: str = SENSOR, **kwargs):
|
|
149
|
+
msg = ha_availabilty_message(device_type=device_type, **kwargs)
|
|
150
|
+
return msg
|
|
131
151
|
|
|
132
152
|
|
|
133
153
|
def ha_binary_sensor_availabilty_message(id: str, name: str, device_class: str, topic: str = "boneIO", model: str = "boneIO Relay Board", **kwargs):
|
|
@@ -61,6 +61,7 @@ from boneio.helper.ha_discovery import (
|
|
|
61
61
|
ha_cover_availabilty_message,
|
|
62
62
|
ha_cover_with_tilt_availabilty_message,
|
|
63
63
|
ha_sensor_availabilty_message,
|
|
64
|
+
ha_virtual_energy_sensor_discovery_message,
|
|
64
65
|
)
|
|
65
66
|
from boneio.helper.onewire import (
|
|
66
67
|
DS2482,
|
|
@@ -72,6 +73,7 @@ from boneio.helper.onewire import (
|
|
|
72
73
|
from boneio.helper.pcf8575 import PCF8575
|
|
73
74
|
from boneio.helper.timeperiod import TimePeriod
|
|
74
75
|
from boneio.input import GpioEventButtonNew, GpioEventButtonOld
|
|
76
|
+
from boneio.message_bus.basic import MessageBus
|
|
75
77
|
from boneio.sensor import (
|
|
76
78
|
DallasSensorDS2482,
|
|
77
79
|
GpioInputBinarySensorNew,
|
|
@@ -92,7 +94,7 @@ from boneio.sensor import GpioADCSensor, initialize_adc
|
|
|
92
94
|
_LOGGER = logging.getLogger(__name__)
|
|
93
95
|
|
|
94
96
|
|
|
95
|
-
def create_adc(manager: Manager, topic_prefix: str, adc_list: list = []):
|
|
97
|
+
def create_adc(manager: Manager, message_bus: MessageBus, topic_prefix: str, adc_list: list = []):
|
|
96
98
|
"""Create ADC sensor."""
|
|
97
99
|
|
|
98
100
|
initialize_adc()
|
|
@@ -108,7 +110,7 @@ def create_adc(manager: Manager, topic_prefix: str, adc_list: list = []):
|
|
|
108
110
|
pin=pin,
|
|
109
111
|
name=name,
|
|
110
112
|
manager=manager,
|
|
111
|
-
|
|
113
|
+
message_bus=message_bus,
|
|
112
114
|
topic_prefix=topic_prefix,
|
|
113
115
|
update_interval=gpio.get(
|
|
114
116
|
UPDATE_INTERVAL, TimePeriod(seconds=60)
|
|
@@ -129,6 +131,7 @@ def create_adc(manager: Manager, topic_prefix: str, adc_list: list = []):
|
|
|
129
131
|
|
|
130
132
|
def create_temp_sensor(
|
|
131
133
|
manager: Manager,
|
|
134
|
+
message_bus: MessageBus,
|
|
132
135
|
topic_prefix: str,
|
|
133
136
|
sensor_type: str,
|
|
134
137
|
i2cbusio: I2C,
|
|
@@ -152,7 +155,7 @@ def create_temp_sensor(
|
|
|
152
155
|
i2c=i2cbusio,
|
|
153
156
|
address=config[ADDRESS],
|
|
154
157
|
manager=manager,
|
|
155
|
-
|
|
158
|
+
message_bus=message_bus,
|
|
156
159
|
topic_prefix=topic_prefix,
|
|
157
160
|
update_interval=config.get(UPDATE_INTERVAL, TimePeriod(seconds=60)),
|
|
158
161
|
filters=config.get(FILTERS, []),
|
|
@@ -173,6 +176,7 @@ def create_temp_sensor(
|
|
|
173
176
|
|
|
174
177
|
def create_serial_number_sensor(
|
|
175
178
|
manager: Manager,
|
|
179
|
+
message_bus: MessageBus,
|
|
176
180
|
topic_prefix: str,
|
|
177
181
|
):
|
|
178
182
|
"""Create Serial number sensor in manager."""
|
|
@@ -180,7 +184,7 @@ def create_serial_number_sensor(
|
|
|
180
184
|
id="serial_number",
|
|
181
185
|
name="Serial number",
|
|
182
186
|
manager=manager,
|
|
183
|
-
|
|
187
|
+
message_bus=message_bus,
|
|
184
188
|
topic_prefix=topic_prefix,
|
|
185
189
|
)
|
|
186
190
|
manager.send_ha_autodiscovery(
|
|
@@ -223,7 +227,7 @@ def create_expander(
|
|
|
223
227
|
return grouped_outputs
|
|
224
228
|
|
|
225
229
|
|
|
226
|
-
def create_modbus_sensors(manager: Manager, sensors, **kwargs) -> dict:
|
|
230
|
+
def create_modbus_sensors(manager: Manager, message_bus: MessageBus, sensors, **kwargs) -> dict:
|
|
227
231
|
"""Create Modbus sensor for each device."""
|
|
228
232
|
from boneio.modbus.sensor import ModbusSensor
|
|
229
233
|
|
|
@@ -238,7 +242,7 @@ def create_modbus_sensors(manager: Manager, sensors, **kwargs) -> dict:
|
|
|
238
242
|
name=name,
|
|
239
243
|
manager=manager,
|
|
240
244
|
model=sensor[MODEL],
|
|
241
|
-
|
|
245
|
+
message_bus=message_bus,
|
|
242
246
|
update_interval=sensor.get(
|
|
243
247
|
UPDATE_INTERVAL, TimePeriod(seconds=60)
|
|
244
248
|
),
|
|
@@ -276,7 +280,7 @@ def output_chooser(output_kind: str, config):
|
|
|
276
280
|
|
|
277
281
|
|
|
278
282
|
def configure_output_group(
|
|
279
|
-
|
|
283
|
+
message_bus: MessageBus,
|
|
280
284
|
topic_prefix: str,
|
|
281
285
|
config: dict,
|
|
282
286
|
**kwargs,
|
|
@@ -285,7 +289,7 @@ def configure_output_group(
|
|
|
285
289
|
_id = config.pop(ID)
|
|
286
290
|
|
|
287
291
|
output = OutputGroup(
|
|
288
|
-
|
|
292
|
+
message_bus=message_bus,
|
|
289
293
|
topic_prefix=topic_prefix,
|
|
290
294
|
id=_id,
|
|
291
295
|
callback=lambda: None,
|
|
@@ -297,6 +301,7 @@ def configure_output_group(
|
|
|
297
301
|
|
|
298
302
|
def configure_relay(
|
|
299
303
|
manager: Manager,
|
|
304
|
+
message_bus: MessageBus,
|
|
300
305
|
state_manager: StateManager,
|
|
301
306
|
topic_prefix: str,
|
|
302
307
|
relay_id: str,
|
|
@@ -367,19 +372,12 @@ def configure_relay(
|
|
|
367
372
|
)
|
|
368
373
|
return
|
|
369
374
|
|
|
370
|
-
# # Create async callback wrapper
|
|
371
|
-
# async def relay_callback_wrapper(event: OutputState):
|
|
372
|
-
# await relay_callback(
|
|
373
|
-
# expander_id=expander_id,
|
|
374
|
-
# event=event,
|
|
375
|
-
# restore_state=False if output_type == NONE else restore_state,
|
|
376
|
-
# )
|
|
377
375
|
interlock_groups = config.get("interlock_group", [])
|
|
378
376
|
if isinstance(interlock_groups, str):
|
|
379
377
|
interlock_groups = [interlock_groups]
|
|
380
378
|
|
|
381
379
|
relay = getattr(output, "OutputClass")(
|
|
382
|
-
|
|
380
|
+
message_bus=message_bus,
|
|
383
381
|
topic_prefix=topic_prefix,
|
|
384
382
|
id=relay_id,
|
|
385
383
|
restored_state=restored_state,
|
|
@@ -389,10 +387,34 @@ def configure_relay(
|
|
|
389
387
|
**config,
|
|
390
388
|
**kwargs,
|
|
391
389
|
**extra_args,
|
|
392
|
-
# callback=relay_callback_wrapper,
|
|
393
390
|
)
|
|
394
391
|
manager._interlock_manager.register(relay, interlock_groups)
|
|
395
392
|
manager.grouped_outputs[expander_id][relay_id] = relay
|
|
393
|
+
if relay.virtual_power_usage is not None:
|
|
394
|
+
manager.send_ha_autodiscovery(
|
|
395
|
+
id=f"{relay_id}_virtual_power",
|
|
396
|
+
relay_id=relay_id,
|
|
397
|
+
name=f"{name} Virtual Power",
|
|
398
|
+
ha_type="sensor",
|
|
399
|
+
device_type="energy",
|
|
400
|
+
availability_msg_func=ha_virtual_energy_sensor_discovery_message,
|
|
401
|
+
unit_of_measurement="W",
|
|
402
|
+
device_class="power",
|
|
403
|
+
state_class="measurement",
|
|
404
|
+
value_template="{{ value_json.power }}"
|
|
405
|
+
)
|
|
406
|
+
manager.send_ha_autodiscovery(
|
|
407
|
+
id=f"{relay_id}_virtual_energy",
|
|
408
|
+
relay_id=relay_id,
|
|
409
|
+
name=f"{name} Virtual Energy",
|
|
410
|
+
ha_type="sensor",
|
|
411
|
+
device_type="energy",
|
|
412
|
+
availability_msg_func=ha_virtual_energy_sensor_discovery_message,
|
|
413
|
+
unit_of_measurement="Wh",
|
|
414
|
+
device_class="energy",
|
|
415
|
+
state_class="total_increasing",
|
|
416
|
+
value_template="{{ value_json.energy }}"
|
|
417
|
+
)
|
|
396
418
|
return relay
|
|
397
419
|
|
|
398
420
|
|
|
@@ -493,7 +515,7 @@ def configure_binary_sensor(
|
|
|
493
515
|
|
|
494
516
|
|
|
495
517
|
def configure_cover(
|
|
496
|
-
|
|
518
|
+
message_bus: MessageBus,
|
|
497
519
|
cover_id: str,
|
|
498
520
|
state_manager: StateManager,
|
|
499
521
|
send_ha_autodiscovery: Callable,
|
|
@@ -522,7 +544,7 @@ def configure_cover(
|
|
|
522
544
|
cover = VenetianCover(
|
|
523
545
|
id=cover_id,
|
|
524
546
|
state_save=state_save,
|
|
525
|
-
|
|
547
|
+
message_bus=message_bus,
|
|
526
548
|
restored_state=restored_state,
|
|
527
549
|
tilt_duration=tilt_duration,
|
|
528
550
|
actuator_activation_duration=config.get("actuator_activation_duration", TimePeriod(milliseconds=0)),
|
|
@@ -539,7 +561,7 @@ def configure_cover(
|
|
|
539
561
|
cover = TimeBasedCover(
|
|
540
562
|
id=cover_id,
|
|
541
563
|
state_save=state_save,
|
|
542
|
-
|
|
564
|
+
message_bus=message_bus,
|
|
543
565
|
restored_state=restored_state,
|
|
544
566
|
**kwargs,
|
|
545
567
|
)
|
|
@@ -554,7 +576,7 @@ def configure_cover(
|
|
|
554
576
|
cover = PreviousCover(
|
|
555
577
|
id=cover_id,
|
|
556
578
|
state_save=state_save,
|
|
557
|
-
|
|
579
|
+
message_bus=message_bus,
|
|
558
580
|
restored_state=restored_state,
|
|
559
581
|
**kwargs,
|
|
560
582
|
)
|
|
@@ -604,6 +626,7 @@ def find_onewire_devices(
|
|
|
604
626
|
|
|
605
627
|
def create_dallas_sensor(
|
|
606
628
|
manager: Manager,
|
|
629
|
+
message_bus: MessageBus,
|
|
607
630
|
address: OneWireAddress,
|
|
608
631
|
config: dict,
|
|
609
632
|
**kwargs,
|
|
@@ -614,11 +637,11 @@ def create_dallas_sensor(
|
|
|
614
637
|
cls = DallasSensorDS2482 if bus else DallasSensorW1
|
|
615
638
|
sensor = cls(
|
|
616
639
|
manager=manager,
|
|
640
|
+
message_bus=message_bus,
|
|
617
641
|
address=address,
|
|
618
642
|
id=id,
|
|
619
643
|
name=name,
|
|
620
644
|
update_interval=config.get(UPDATE_INTERVAL, TimePeriod(seconds=60)),
|
|
621
|
-
send_message=manager.send_message,
|
|
622
645
|
filters=config.get(FILTERS, []),
|
|
623
646
|
**kwargs,
|
|
624
647
|
)
|
|
@@ -635,6 +658,7 @@ def create_dallas_sensor(
|
|
|
635
658
|
|
|
636
659
|
def create_ina219_sensor(
|
|
637
660
|
manager: Manager,
|
|
661
|
+
message_bus: MessageBus,
|
|
638
662
|
topic_prefix: str,
|
|
639
663
|
config: dict = {},
|
|
640
664
|
):
|
|
@@ -649,7 +673,7 @@ def create_ina219_sensor(
|
|
|
649
673
|
address=address,
|
|
650
674
|
sensors=config.get("sensors", []),
|
|
651
675
|
manager=manager,
|
|
652
|
-
|
|
676
|
+
message_bus=message_bus,
|
|
653
677
|
topic_prefix=topic_prefix,
|
|
654
678
|
update_interval=config.get(UPDATE_INTERVAL, TimePeriod(seconds=60)),
|
|
655
679
|
)
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
from typing import Callable, Union, Optional
|
|
7
5
|
from boneio.helper.util import strip_accents
|
|
6
|
+
from boneio.message_bus.basic import MessageBus
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
class BasicMqtt:
|
|
@@ -15,16 +14,14 @@ class BasicMqtt:
|
|
|
15
14
|
id: str,
|
|
16
15
|
topic_prefix: str,
|
|
17
16
|
name: str,
|
|
18
|
-
|
|
19
|
-
[str, Union[str, int, dict, None], Optional[bool]], None
|
|
20
|
-
],
|
|
17
|
+
message_bus: MessageBus,
|
|
21
18
|
topic_type: str,
|
|
22
19
|
**kwargs,
|
|
23
20
|
):
|
|
24
21
|
"""Initialize module."""
|
|
25
22
|
self._id = id.replace(" ", "")
|
|
26
23
|
self._name = name
|
|
27
|
-
self.
|
|
24
|
+
self._message_bus = message_bus
|
|
28
25
|
topic_id = strip_accents(self.id)
|
|
29
26
|
self._send_topic = f"{topic_prefix}/{topic_type}/{topic_id}"
|
|
30
27
|
|
|
@@ -513,6 +513,79 @@ class CustomValidator(Validator):
|
|
|
513
513
|
def _normalize_coerce_actions_output(self, value):
|
|
514
514
|
return str(value).upper()
|
|
515
515
|
|
|
516
|
+
def _normalize_coerce_power_value_to_watts(self, value):
|
|
517
|
+
"""
|
|
518
|
+
Parse a power or energy value and return it in watts (W).
|
|
519
|
+
Accepts:
|
|
520
|
+
- Numeric values (int, float)
|
|
521
|
+
- Strings with units: 'W', 'kW', 'kWh', 'MW', 'mW', etc.
|
|
522
|
+
- For 'kWh' (kilowatt-hour), returns equivalent average power in W (1kWh = 1000W for 1h)
|
|
523
|
+
- For 'kW', 'MW', etc., converts to W
|
|
524
|
+
Example:
|
|
525
|
+
9 -> 9.0
|
|
526
|
+
'9W' -> 9.0
|
|
527
|
+
'1kW' -> 1000.0
|
|
528
|
+
'1kWh' -> 1000.0
|
|
529
|
+
'2.5MW' -> 2500000.0
|
|
530
|
+
Returns float (watts) or raises ValueError if invalid.
|
|
531
|
+
"""
|
|
532
|
+
import re
|
|
533
|
+
if value is None:
|
|
534
|
+
return None
|
|
535
|
+
if isinstance(value, (int, float)):
|
|
536
|
+
return float(value)
|
|
537
|
+
if not isinstance(value, str):
|
|
538
|
+
raise ValueError(f"Unsupported type for power value: {type(value)}")
|
|
539
|
+
value = value.strip().replace(' ', '').lower()
|
|
540
|
+
pattern = r"^([-+]?[0-9]*\.?[0-9]+)([a-z]*)$"
|
|
541
|
+
match = re.match(pattern, value)
|
|
542
|
+
if not match:
|
|
543
|
+
_LOGGER.warning(f"Could not parse power value: {value}")
|
|
544
|
+
raise ValueError(f"Could not parse power value: {value}")
|
|
545
|
+
num, unit = match.groups()
|
|
546
|
+
num = float(num)
|
|
547
|
+
multiplier = 1.0
|
|
548
|
+
if unit in ('w', ''):
|
|
549
|
+
multiplier = 1.0
|
|
550
|
+
elif unit == 'kw':
|
|
551
|
+
multiplier = 1000.0
|
|
552
|
+
elif unit == 'mw':
|
|
553
|
+
multiplier = 1_000_000.0
|
|
554
|
+
elif unit == 'gw':
|
|
555
|
+
multiplier = 1_000_000_000.0
|
|
556
|
+
elif unit == 'mw':
|
|
557
|
+
multiplier = 1_000_000.0
|
|
558
|
+
elif unit == 'kwh':
|
|
559
|
+
# 1 kWh = 1000 W (for 1h). For config, treat as 1000W average.
|
|
560
|
+
multiplier = 1000.0
|
|
561
|
+
elif unit == 'mwh':
|
|
562
|
+
multiplier = 1_000_000.0
|
|
563
|
+
elif unit == 'gwh':
|
|
564
|
+
multiplier = 1_000_000_000.0
|
|
565
|
+
elif unit == 'mw':
|
|
566
|
+
multiplier = 1_000_000.0
|
|
567
|
+
elif unit == 'wh':
|
|
568
|
+
multiplier = 1.0
|
|
569
|
+
elif unit == 'mw':
|
|
570
|
+
multiplier = 1_000_000.0
|
|
571
|
+
elif unit == 'mw':
|
|
572
|
+
multiplier = 1_000_000.0
|
|
573
|
+
elif unit == 'mw':
|
|
574
|
+
multiplier = 1_000_000.0
|
|
575
|
+
elif unit == 'mw':
|
|
576
|
+
multiplier = 1_000_000.0
|
|
577
|
+
elif unit == 'mw':
|
|
578
|
+
multiplier = 1_000_000.0
|
|
579
|
+
elif unit == 'mw':
|
|
580
|
+
multiplier = 1_000_000.0
|
|
581
|
+
else:
|
|
582
|
+
_LOGGER.warning(f"Unknown unit for power value: {unit}")
|
|
583
|
+
raise ValueError(f"Unknown unit for power value: {unit}")
|
|
584
|
+
result = num * multiplier
|
|
585
|
+
_LOGGER.debug(f"Parsed power value '{value}' as {result} W")
|
|
586
|
+
return result
|
|
587
|
+
|
|
588
|
+
|
|
516
589
|
|
|
517
590
|
def load_config_from_string(config_str: str) -> dict:
|
|
518
591
|
"""Load config from string."""
|
|
@@ -549,3 +622,5 @@ def load_config_from_file(config_file: str):
|
|
|
549
622
|
_LOGGER.warning("Missing yaml file. %s", config_file)
|
|
550
623
|
return None
|
|
551
624
|
return load_config_from_string(config_yaml)
|
|
625
|
+
|
|
626
|
+
|