boneIO 0.11.0.dev4__tar.gz → 0.11.0.dev6__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.dev6}/PKG-INFO +1 -1
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/const.py +2 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/cover/cover.py +4 -4
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/cover/previous.py +6 -6
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/group/output.py +1 -1
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/config.py +18 -1
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/filter.py +3 -2
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/ha_discovery.py +26 -6
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/loader.py +50 -23
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/mqtt.py +3 -6
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/util.py +26 -1
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/yaml_util.py +108 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/manager.py +113 -101
- boneio-0.11.0.dev6/boneio/message_bus/__init__.py +6 -0
- boneio-0.11.0.dev6/boneio/message_bus/basic.py +51 -0
- boneio-0.11.0.dev4/boneio/helper/message_bus.py → boneio-0.11.0.dev6/boneio/message_bus/local.py +8 -34
- boneio-0.11.0.dev4/boneio/mqtt_client.py → boneio-0.11.0.dev6/boneio/message_bus/mqtt.py +22 -5
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/modbus/liquid-sensor.json +11 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/modbus/sensor.py +84 -5
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/modbus/single_sensor.py +55 -6
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/relay/basic.py +109 -4
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/runner.py +16 -13
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/schema/actions.yaml +16 -8
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/schema/schema.yaml +35 -2
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/sensor/adc.py +1 -1
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/sensor/ina219.py +1 -1
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/sensor/serial_number.py +1 -1
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/sensor/temp/__init__.py +1 -1
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/sensor/temp/dallas.py +1 -1
- boneio-0.11.0.dev6/boneio/version.py +2 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/schema/binary_sensor.schema.json +22 -2
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/schema/config.schema.json +94 -6
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/schema/event.schema.json +33 -3
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/schema/modbus_sensors.schema.json +30 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/schema/mqtt.schema.json +0 -1
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/schema/output.schema.json +9 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/pyproject.toml +1 -1
- boneio-0.11.0.dev4/boneio/version.py +0 -2
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/LICENSE +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/README.md +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/__init__.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/boards/0.7/input.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/boards/0.7/output_24_16.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/boards/0.7/output_32_10.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/boards/0.7/output_cover.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/boards/0.7/output_cover_mix.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/boards/0.8/input.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/boards/0.8/output_24_16.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/boards/0.8/output_32_10.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/boards/0.8/output_cover.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/boards/0.8/output_cover_mix.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/bonecli.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/cover/__init__.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/cover/time_based.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/cover/venetian.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/24x16/adc.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/24x16/binary_sensor.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/24x16/config.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/24x16/event.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/24x16/mqtt.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/24x16/output24x16A.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/32x10/adc.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/32x10/binary_sensor.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/32x10/config.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/32x10/event.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/32x10/mqtt.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/32x10/output32x10A.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/__init__.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/cover/adc.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/cover/binary_sensor.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/cover/config.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/cover/cover.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/cover/event.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/cover/mqtt.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/cover/outputCover.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/cover_mix/adc.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/cover_mix/binary_sensor.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/cover_mix/config.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/cover_mix/cover.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/cover_mix/event.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/cover_mix/mqtt.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/cover_mix/outputCoverMix.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/different_configs/adc.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/different_configs/all_binary_sensor.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/different_configs/binary_sensor.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/different_configs/binary_sensor_v_0_7.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/different_configs/config_24_16.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/different_configs/event_all.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/different_configs/event_v_0_7.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/different_configs/led32x4A.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/different_configs/output24x16A.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/different_configs/output24x16A_v0.3.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/different_configs/output32x10A.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/example_config/different_configs/output32x5A.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/fonts/danube__.ttf +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/group/__init__.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/__init__.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/async_updater.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/click_timer.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/events.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/exceptions.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/gpio.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/gpiod.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/interlock.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/logger.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/oled.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/onewire/W1ThermSensor.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/onewire/__init__.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/onewire/ds2482.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/onewire/onewire.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/pcf8575.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/queue.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/schema_converter.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/sensor/ina_219_smbus.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/state_manager.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/stats.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/helper/timeperiod.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/input/__init__.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/input/gpio.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/input/gpio_new.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/modbus/__init__.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/modbus/client.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/modbus/cwt.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/modbus/dts1964_3f.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/modbus/modbuscli.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/modbus/orno-or-we-517.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/modbus/pt100.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/modbus/r4dcb08.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/modbus/sdm120.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/modbus/sdm630.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/modbus/sht20.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/modbus/sht30.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/modbus/socomec_e03.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/modbus/socomec_e23.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/modbus/sofar.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/modbus/utils.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/models/__init__.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/models/files.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/models/logs.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/oled.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/relay/__init__.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/relay/gpio.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/relay/mcp.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/relay/pca.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/relay/pcf.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/schema/actions_sensor.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/schema/actions_switch.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/schema/filters.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/schema/filters_adc.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/schema/id.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/schema/temp_unit.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/schema/update_interval.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/sensor/__init__.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/sensor/gpio.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/sensor/gpio_new.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/sensor/temp/lm75.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/sensor/temp/mcp9808.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/app.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/abap-BrgZPUOV.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/apex-DyP6w7ZV.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/azcli-BaLxmfj-.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/bat-CFOPXBzS.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/bicep-BfEKNvv3.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/cameligo-BFG1Mk7z.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/clojure-DTECt2xU.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/codicon-DCmgc-ay.ttf +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/coffee-CDGzqUPQ.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/cpp-CLLBncYj.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/csharp-dUCx_-0o.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/csp-5Rap-vPy.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/css-D3h14YRZ.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/cssMode-C5afUc0K.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/cypher-DrQuvNYM.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/dart-CFKIUWau.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/dockerfile-Zznr-cwX.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/ecl-Ce3n6wWz.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/editor.worker-oRlJJsnX.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/elixir-deUWdS0T.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/flow9-i9-g7ZhI.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/freemarker2-emRcpycN.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/fsharp-CzKuDChf.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/go-Cphgjts3.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/graphql-Cg7bfA9N.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/handlebars-mMSD-c9g.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/hcl-0cvrggvQ.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/html-Clq5L_-r.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/htmlMode-CYqwdxDX.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/index-BcJKL9Rz.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/index-DzcnWIxb.css +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/ini-Drc7WvVn.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/java-B_fMsGYe.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/javascript-BR7Nbw1G.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/json.worker-BnUULff4.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/jsonMode-aJvzz7xf.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/julia-Bqgm2twL.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/kotlin-BSkB5QuD.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/less-BsTHnhdd.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/lexon-YWi4-JPR.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/liquid-BNyvmcbu.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/lua-nf6ki56Z.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/m3-Cpb6xl2v.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/markdown-DSZPf7rp.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/mdx-pWhQfMuK.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/mips-B_c3zf-v.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/msdax-rUNN04Wq.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/mysql-DDwshQtU.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/objective-c-B5zXfXm9.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/pascal-CXOwvkN_.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/pascaligo-Bc-ZgV77.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/perl-CwNk8-XU.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/pgsql-tGk8EFnU.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/php-CpIb_Oan.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/pla-B03wrqEc.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/postiats-BKlk5iyT.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/powerquery-Bhzvs7bI.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/powershell-Dd3NCNK9.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/protobuf-COyEY5Pt.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/pug-BaJupSGV.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/python-CVtAQrrC.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/qsharp-DXyYeYxl.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/r-CdQndTaG.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/razor-BBiV-C6e.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/redis-CVwtpugi.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/redshift-25W9uPmb.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/restructuredtext-DfzH4Xui.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/ruby-Cp1zYvxS.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/rust-D5C2fndG.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/sb-CDntyWJ8.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/scala-BoFRg7Ot.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/scheme-Bio4gycK.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/scss-4Ik7cdeQ.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/shell-CX-rkNHf.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/solidity-Tw7wswEv.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/sophia-C5WLch3f.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/sparql-DHaeiCBh.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/sql-CCSDG5nI.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/st-pnP8ivHi.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/swift-DwJ7jVG9.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/systemverilog-B9Xyijhd.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/tcl-DnHyzjbg.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/tsMode-COZIvtMx.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/twig-CPajHgWi.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/typescript-DKdGc2VX.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/typespec-D-MeaMDU.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/vb-DgyLZaXg.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/wgsl-BIv9DU6q.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/xml-CTK9ybeu.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/yaml-ggTgJ1wa.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/assets/yaml.worker-DSHdx_mx.js +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/boneio.svg +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/boneio_fav.svg +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/frontend-dist/index.html +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/schema/adc.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/schema/boneio.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/schema/cover.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/schema/dallas.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/schema/ds2482.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/schema/ina219.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/schema/lm75.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/schema/logger.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/schema/mcp23017.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/schema/mcp9808.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/schema/modbus.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/schema/oled.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/schema/output_group.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/schema/pca9685.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/schema/pcf8575.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/schema/sensor.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/schema/web.schema.json +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/web_server.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/boneio/webui/websocket_manager.py +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/tests/32_5_config.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/tests/bandit.yaml +0 -0
- {boneio-0.11.0.dev4 → boneio-0.11.0.dev6}/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(
|
|
@@ -3,6 +3,7 @@ Module to provide basic config options.
|
|
|
3
3
|
"""
|
|
4
4
|
from __future__ import annotations
|
|
5
5
|
|
|
6
|
+
import logging
|
|
6
7
|
from _collections_abc import dict_values
|
|
7
8
|
from typing import Union
|
|
8
9
|
|
|
@@ -18,6 +19,9 @@ from boneio.const import (
|
|
|
18
19
|
SWITCH,
|
|
19
20
|
VALVE,
|
|
20
21
|
)
|
|
22
|
+
from boneio.helper.util import sanitize_mqtt_topic
|
|
23
|
+
|
|
24
|
+
_LOGGER = logging.getLogger(__name__)
|
|
21
25
|
|
|
22
26
|
|
|
23
27
|
class ConfigHelper:
|
|
@@ -28,9 +32,12 @@ class ConfigHelper:
|
|
|
28
32
|
device_type: str = "boneIO Black",
|
|
29
33
|
ha_discovery: bool = True,
|
|
30
34
|
ha_discovery_prefix: str = HOMEASSISTANT,
|
|
35
|
+
network_info: dict = None,
|
|
36
|
+
is_web_active: bool = False,
|
|
31
37
|
):
|
|
32
38
|
self._name = name
|
|
33
|
-
|
|
39
|
+
sanitized_topic_prefix = sanitize_mqtt_topic(topic_prefix) if topic_prefix else sanitize_mqtt_topic(name)
|
|
40
|
+
self._topic_prefix = sanitized_topic_prefix
|
|
34
41
|
self._ha_discovery = ha_discovery
|
|
35
42
|
self._ha_discovery_prefix = ha_discovery_prefix
|
|
36
43
|
self._device_type = device_type
|
|
@@ -46,6 +53,16 @@ class ConfigHelper:
|
|
|
46
53
|
VALVE: {},
|
|
47
54
|
}
|
|
48
55
|
self.manager_ready: bool = False
|
|
56
|
+
self._network_info = network_info
|
|
57
|
+
self._is_web_active = is_web_active
|
|
58
|
+
|
|
59
|
+
@property
|
|
60
|
+
def network_info(self) -> dict:
|
|
61
|
+
return self._network_info
|
|
62
|
+
|
|
63
|
+
@property
|
|
64
|
+
def is_web_active(self) -> bool:
|
|
65
|
+
return self._is_web_active
|
|
49
66
|
|
|
50
67
|
@property
|
|
51
68
|
def topic_prefix(self) -> str:
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"""Filter class to adjust sensor values."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
import logging
|
|
6
|
+
from typing import Optional
|
|
6
7
|
|
|
7
8
|
_LOGGER = logging.getLogger(__name__)
|
|
8
9
|
|
|
@@ -13,7 +14,7 @@ FILTERS = {
|
|
|
13
14
|
"multiply": lambda x, y: x * y if x else x,
|
|
14
15
|
"filter_out": lambda x, y: None if x == y else x,
|
|
15
16
|
"filter_out_greater": lambda x, y: None if x > y else x,
|
|
16
|
-
"filter_out_lower": lambda x, y: None if x < y else x
|
|
17
|
+
"filter_out_lower": lambda x, y: None if x < y else x
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
|
|
@@ -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):
|
|
@@ -213,7 +233,7 @@ def modbus_sensor_availabilty_message(
|
|
|
213
233
|
"identifiers": [id],
|
|
214
234
|
"manufacturer": "boneIO",
|
|
215
235
|
"model": model,
|
|
216
|
-
"name":
|
|
236
|
+
"name": name,
|
|
217
237
|
"sw_version": __version__,
|
|
218
238
|
},
|
|
219
239
|
"name": sensor_id,
|
|
@@ -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
|
|
|
@@ -231,6 +235,8 @@ def create_modbus_sensors(manager: Manager, sensors, **kwargs) -> dict:
|
|
|
231
235
|
for sensor in sensors:
|
|
232
236
|
name = sensor.get(ID)
|
|
233
237
|
id = name.replace(" ", "")
|
|
238
|
+
print("name to check", name)
|
|
239
|
+
additional_data = sensor.get("data", {})
|
|
234
240
|
try:
|
|
235
241
|
modbus_sensors[id.lower()] = ModbusSensor(
|
|
236
242
|
address=sensor[ADDRESS],
|
|
@@ -238,11 +244,12 @@ def create_modbus_sensors(manager: Manager, sensors, **kwargs) -> dict:
|
|
|
238
244
|
name=name,
|
|
239
245
|
manager=manager,
|
|
240
246
|
model=sensor[MODEL],
|
|
241
|
-
|
|
247
|
+
message_bus=message_bus,
|
|
242
248
|
update_interval=sensor.get(
|
|
243
249
|
UPDATE_INTERVAL, TimePeriod(seconds=60)
|
|
244
250
|
),
|
|
245
251
|
sensors_filters=sensor.get("sensors_filters", {}),
|
|
252
|
+
additional_data=additional_data,
|
|
246
253
|
**kwargs,
|
|
247
254
|
)
|
|
248
255
|
except FileNotFoundError as err:
|
|
@@ -276,7 +283,7 @@ def output_chooser(output_kind: str, config):
|
|
|
276
283
|
|
|
277
284
|
|
|
278
285
|
def configure_output_group(
|
|
279
|
-
|
|
286
|
+
message_bus: MessageBus,
|
|
280
287
|
topic_prefix: str,
|
|
281
288
|
config: dict,
|
|
282
289
|
**kwargs,
|
|
@@ -285,7 +292,7 @@ def configure_output_group(
|
|
|
285
292
|
_id = config.pop(ID)
|
|
286
293
|
|
|
287
294
|
output = OutputGroup(
|
|
288
|
-
|
|
295
|
+
message_bus=message_bus,
|
|
289
296
|
topic_prefix=topic_prefix,
|
|
290
297
|
id=_id,
|
|
291
298
|
callback=lambda: None,
|
|
@@ -297,6 +304,7 @@ def configure_output_group(
|
|
|
297
304
|
|
|
298
305
|
def configure_relay(
|
|
299
306
|
manager: Manager,
|
|
307
|
+
message_bus: MessageBus,
|
|
300
308
|
state_manager: StateManager,
|
|
301
309
|
topic_prefix: str,
|
|
302
310
|
relay_id: str,
|
|
@@ -367,19 +375,12 @@ def configure_relay(
|
|
|
367
375
|
)
|
|
368
376
|
return
|
|
369
377
|
|
|
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
378
|
interlock_groups = config.get("interlock_group", [])
|
|
378
379
|
if isinstance(interlock_groups, str):
|
|
379
380
|
interlock_groups = [interlock_groups]
|
|
380
381
|
|
|
381
382
|
relay = getattr(output, "OutputClass")(
|
|
382
|
-
|
|
383
|
+
message_bus=message_bus,
|
|
383
384
|
topic_prefix=topic_prefix,
|
|
384
385
|
id=relay_id,
|
|
385
386
|
restored_state=restored_state,
|
|
@@ -389,10 +390,34 @@ def configure_relay(
|
|
|
389
390
|
**config,
|
|
390
391
|
**kwargs,
|
|
391
392
|
**extra_args,
|
|
392
|
-
# callback=relay_callback_wrapper,
|
|
393
393
|
)
|
|
394
394
|
manager._interlock_manager.register(relay, interlock_groups)
|
|
395
395
|
manager.grouped_outputs[expander_id][relay_id] = relay
|
|
396
|
+
if relay.virtual_power_usage is not None:
|
|
397
|
+
manager.send_ha_autodiscovery(
|
|
398
|
+
id=f"{relay_id}_virtual_power",
|
|
399
|
+
relay_id=relay_id,
|
|
400
|
+
name=f"{name} Virtual Power",
|
|
401
|
+
ha_type="sensor",
|
|
402
|
+
device_type="energy",
|
|
403
|
+
availability_msg_func=ha_virtual_energy_sensor_discovery_message,
|
|
404
|
+
unit_of_measurement="W",
|
|
405
|
+
device_class="power",
|
|
406
|
+
state_class="measurement",
|
|
407
|
+
value_template="{{ value_json.power }}"
|
|
408
|
+
)
|
|
409
|
+
manager.send_ha_autodiscovery(
|
|
410
|
+
id=f"{relay_id}_virtual_energy",
|
|
411
|
+
relay_id=relay_id,
|
|
412
|
+
name=f"{name} Virtual Energy",
|
|
413
|
+
ha_type="sensor",
|
|
414
|
+
device_type="energy",
|
|
415
|
+
availability_msg_func=ha_virtual_energy_sensor_discovery_message,
|
|
416
|
+
unit_of_measurement="Wh",
|
|
417
|
+
device_class="energy",
|
|
418
|
+
state_class="total_increasing",
|
|
419
|
+
value_template="{{ value_json.energy }}"
|
|
420
|
+
)
|
|
396
421
|
return relay
|
|
397
422
|
|
|
398
423
|
|
|
@@ -493,7 +518,7 @@ def configure_binary_sensor(
|
|
|
493
518
|
|
|
494
519
|
|
|
495
520
|
def configure_cover(
|
|
496
|
-
|
|
521
|
+
message_bus: MessageBus,
|
|
497
522
|
cover_id: str,
|
|
498
523
|
state_manager: StateManager,
|
|
499
524
|
send_ha_autodiscovery: Callable,
|
|
@@ -522,7 +547,7 @@ def configure_cover(
|
|
|
522
547
|
cover = VenetianCover(
|
|
523
548
|
id=cover_id,
|
|
524
549
|
state_save=state_save,
|
|
525
|
-
|
|
550
|
+
message_bus=message_bus,
|
|
526
551
|
restored_state=restored_state,
|
|
527
552
|
tilt_duration=tilt_duration,
|
|
528
553
|
actuator_activation_duration=config.get("actuator_activation_duration", TimePeriod(milliseconds=0)),
|
|
@@ -539,7 +564,7 @@ def configure_cover(
|
|
|
539
564
|
cover = TimeBasedCover(
|
|
540
565
|
id=cover_id,
|
|
541
566
|
state_save=state_save,
|
|
542
|
-
|
|
567
|
+
message_bus=message_bus,
|
|
543
568
|
restored_state=restored_state,
|
|
544
569
|
**kwargs,
|
|
545
570
|
)
|
|
@@ -554,7 +579,7 @@ def configure_cover(
|
|
|
554
579
|
cover = PreviousCover(
|
|
555
580
|
id=cover_id,
|
|
556
581
|
state_save=state_save,
|
|
557
|
-
|
|
582
|
+
message_bus=message_bus,
|
|
558
583
|
restored_state=restored_state,
|
|
559
584
|
**kwargs,
|
|
560
585
|
)
|
|
@@ -604,6 +629,7 @@ def find_onewire_devices(
|
|
|
604
629
|
|
|
605
630
|
def create_dallas_sensor(
|
|
606
631
|
manager: Manager,
|
|
632
|
+
message_bus: MessageBus,
|
|
607
633
|
address: OneWireAddress,
|
|
608
634
|
config: dict,
|
|
609
635
|
**kwargs,
|
|
@@ -614,11 +640,11 @@ def create_dallas_sensor(
|
|
|
614
640
|
cls = DallasSensorDS2482 if bus else DallasSensorW1
|
|
615
641
|
sensor = cls(
|
|
616
642
|
manager=manager,
|
|
643
|
+
message_bus=message_bus,
|
|
617
644
|
address=address,
|
|
618
645
|
id=id,
|
|
619
646
|
name=name,
|
|
620
647
|
update_interval=config.get(UPDATE_INTERVAL, TimePeriod(seconds=60)),
|
|
621
|
-
send_message=manager.send_message,
|
|
622
648
|
filters=config.get(FILTERS, []),
|
|
623
649
|
**kwargs,
|
|
624
650
|
)
|
|
@@ -635,6 +661,7 @@ def create_dallas_sensor(
|
|
|
635
661
|
|
|
636
662
|
def create_ina219_sensor(
|
|
637
663
|
manager: Manager,
|
|
664
|
+
message_bus: MessageBus,
|
|
638
665
|
topic_prefix: str,
|
|
639
666
|
config: dict = {},
|
|
640
667
|
):
|
|
@@ -649,7 +676,7 @@ def create_ina219_sensor(
|
|
|
649
676
|
address=address,
|
|
650
677
|
sensors=config.get("sensors", []),
|
|
651
678
|
manager=manager,
|
|
652
|
-
|
|
679
|
+
message_bus=message_bus,
|
|
653
680
|
topic_prefix=topic_prefix,
|
|
654
681
|
update_interval=config.get(UPDATE_INTERVAL, TimePeriod(seconds=60)),
|
|
655
682
|
)
|
|
@@ -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
|
|
|
@@ -19,7 +19,7 @@ def is_callback(func: Callable[..., Any]) -> bool:
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
def strip_accents(s):
|
|
22
|
-
|
|
22
|
+
"""Remove accents and spaces from a string."""
|
|
23
23
|
return "".join(
|
|
24
24
|
c
|
|
25
25
|
for c in unicodedata.normalize("NFD", s)
|
|
@@ -27,6 +27,31 @@ def strip_accents(s):
|
|
|
27
27
|
)
|
|
28
28
|
|
|
29
29
|
|
|
30
|
+
def sanitize_mqtt_topic(name: str) -> str:
|
|
31
|
+
"""
|
|
32
|
+
Sanitize a string to be used as an MQTT topic:
|
|
33
|
+
- Replace spaces with underscores
|
|
34
|
+
- Remove Polish diacritics
|
|
35
|
+
- Remove/replace forbidden characters (leave only a-z, A-Z, 0-9, '_', '-')
|
|
36
|
+
Args:
|
|
37
|
+
name (str): Input string
|
|
38
|
+
Returns:
|
|
39
|
+
str: Sanitized string
|
|
40
|
+
"""
|
|
41
|
+
import re
|
|
42
|
+
from .logger import _LOGGER
|
|
43
|
+
|
|
44
|
+
original = name
|
|
45
|
+
# Zamień spacje na podkreślenia
|
|
46
|
+
name = name.replace(' ', '_')
|
|
47
|
+
# Usuń polskie znaki
|
|
48
|
+
name = strip_accents(name)
|
|
49
|
+
# Zostaw tylko dozwolone znaki
|
|
50
|
+
name = re.sub(r'[^a-zA-Z0-9_-]', '', name)
|
|
51
|
+
_LOGGER.debug(f"Sanitized MQTT topic: '{original}' -> '{name}'")
|
|
52
|
+
return name
|
|
53
|
+
|
|
54
|
+
|
|
30
55
|
def open_json(path: str, model: str) -> dict:
|
|
31
56
|
"""Open json file."""
|
|
32
57
|
file = f"{os.path.join(path)}/{model}.json"
|