boneIO 0.12.0__tar.gz → 0.12.0.dev2__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.12.0 → boneio-0.12.0.dev2}/PKG-INFO +1 -1
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/cover/cover.py +9 -10
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/cover/previous.py +1 -1
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/cover/time_based.py +5 -3
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/cover/venetian.py +10 -3
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/24x16/output24x16A.yaml +1 -1
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/group/output.py +2 -3
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/events.py +65 -82
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/gpio.py +34 -44
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/loader.py +9 -10
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/schema_converter.py +24 -75
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/state_manager.py +1 -1
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/stats.py +1 -5
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/yaml_util.py +1 -128
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/input/gpio_new.py +7 -12
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/manager.py +72 -116
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/coordinator.py +10 -10
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/relay/basic.py +16 -19
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/relay/mcp.py +0 -2
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/runner.py +0 -13
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/schema/schema.yaml +3 -6
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/sensor/gpio_new.py +1 -1
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/sensor/ina219.py +5 -5
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/sensor/temp/__init__.py +5 -5
- boneio-0.12.0.dev2/boneio/version.py +2 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/app.py +7 -34
- boneio-0.12.0/boneio/webui/frontend-dist/assets/cssMode-DgDiKA-j.js → boneio-0.12.0.dev2/boneio/webui/frontend-dist/assets/cssMode-CIugHNWc.js +1 -1
- boneio-0.12.0.dev2/boneio/webui/frontend-dist/assets/editor.worker-oRlJJsnX.js +12 -0
- boneio-0.12.0/boneio/webui/frontend-dist/assets/freemarker2-_BpO1aZQ.js → boneio-0.12.0.dev2/boneio/webui/frontend-dist/assets/freemarker2-c6aq0KPQ.js +1 -1
- boneio-0.12.0/boneio/webui/frontend-dist/assets/handlebars-C-pIMUIu.js → boneio-0.12.0.dev2/boneio/webui/frontend-dist/assets/handlebars-Blio5gIC.js +1 -1
- boneio-0.12.0/boneio/webui/frontend-dist/assets/html-D9eFvRsj.js → boneio-0.12.0.dev2/boneio/webui/frontend-dist/assets/html-nAjYqGE2.js +1 -1
- boneio-0.12.0/boneio/webui/frontend-dist/assets/htmlMode-4ek0HzGX.js → boneio-0.12.0.dev2/boneio/webui/frontend-dist/assets/htmlMode-BNz1ae3o.js +1 -1
- boneio-0.12.0.dev2/boneio/webui/frontend-dist/assets/index-B0-VO6Hk.js +820 -0
- boneio-0.12.0.dev2/boneio/webui/frontend-dist/assets/index-C1Lt6bAz.css +1 -0
- boneio-0.12.0/boneio/webui/frontend-dist/assets/javascript-CzMDrZ0c.js → boneio-0.12.0.dev2/boneio/webui/frontend-dist/assets/javascript-BlgLdPQ3.js +1 -1
- boneio-0.12.0.dev2/boneio/webui/frontend-dist/assets/json.worker-BnUULff4.js +49 -0
- boneio-0.12.0/boneio/webui/frontend-dist/assets/jsonMode-CvGNp9v8.js → boneio-0.12.0.dev2/boneio/webui/frontend-dist/assets/jsonMode-Bn3YbulZ.js +1 -1
- boneio-0.12.0/boneio/webui/frontend-dist/assets/liquid-Bs6Zwmny.js → boneio-0.12.0.dev2/boneio/webui/frontend-dist/assets/liquid-Goo_mcvP.js +1 -1
- boneio-0.12.0/boneio/webui/frontend-dist/assets/mdx-RDAGI35B.js → boneio-0.12.0.dev2/boneio/webui/frontend-dist/assets/mdx-hECGU4Dx.js +1 -1
- boneio-0.12.0/boneio/webui/frontend-dist/assets/python-CsxtIWD4.js → boneio-0.12.0.dev2/boneio/webui/frontend-dist/assets/python-D3qegG3u.js +1 -1
- boneio-0.12.0/boneio/webui/frontend-dist/assets/razor-srkwbcs0.js → boneio-0.12.0.dev2/boneio/webui/frontend-dist/assets/razor-CMWhWMgO.js +1 -1
- boneio-0.12.0/boneio/webui/frontend-dist/assets/tsMode-Cu6NCIGb.js → boneio-0.12.0.dev2/boneio/webui/frontend-dist/assets/tsMode-DDshvxc6.js +2 -2
- boneio-0.12.0/boneio/webui/frontend-dist/assets/typescript-B5d2TDqJ.js → boneio-0.12.0.dev2/boneio/webui/frontend-dist/assets/typescript-CXWWf43Y.js +1 -1
- boneio-0.12.0/boneio/webui/frontend-dist/assets/xml-BFg5pZ32.js → boneio-0.12.0.dev2/boneio/webui/frontend-dist/assets/xml-CeRIMZvD.js +1 -1
- boneio-0.12.0/boneio/webui/frontend-dist/assets/yaml-6oQygw1Z.js → boneio-0.12.0.dev2/boneio/webui/frontend-dist/assets/yaml-DBApS5UB.js +1 -1
- boneio-0.12.0.dev2/boneio/webui/frontend-dist/assets/yaml.worker-CooL0-c7.js +411 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/index.html +2 -2
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/schema/adc.schema.json +14 -8
- {boneio-0.12.0/boneio/webui/frontend-dist/schem → boneio-0.12.0.dev2/boneio/webui/schema}/binary_sensor.schema.json +99 -211
- {boneio-0.12.0/boneio/webui/frontend-dist/schem → boneio-0.12.0.dev2/boneio/webui/schema}/boneio.schema.json +21 -39
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/schema/config.schema.json +582 -712
- {boneio-0.12.0/boneio/webui/frontend-dist/schem → boneio-0.12.0.dev2/boneio/webui/schema}/cover.schema.json +30 -15
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/schema/dallas.schema.json +6 -3
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/schema/ds2482.schema.json +10 -4
- {boneio-0.12.0/boneio/webui/frontend-dist/schem → boneio-0.12.0.dev2/boneio/webui/schema}/event.schema.json +134 -235
- {boneio-0.12.0/boneio/webui/frontend-dist/schem → boneio-0.12.0.dev2/boneio/webui/schema}/ina219.schema.json +21 -11
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/schema/lm75.schema.json +14 -8
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/schema/logger.schema.json +19 -29
- {boneio-0.12.0/boneio/webui/frontend-dist/schem → boneio-0.12.0.dev2/boneio/webui/schema}/mcp23017.schema.json +8 -5
- {boneio-0.12.0/boneio/webui/frontend-dist/schem → boneio-0.12.0.dev2/boneio/webui/schema}/mcp9808.schema.json +15 -8
- {boneio-0.12.0/boneio/webui/frontend-dist/schem → boneio-0.12.0.dev2/boneio/webui/schema}/modbus.schema.json +10 -4
- boneio-0.12.0/boneio/webui/schema/modbus_sensors.schema.json → boneio-0.12.0.dev2/boneio/webui/schema/modbus_devices.schema.json +7 -5
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/schema/mqtt.schema.json +24 -9
- {boneio-0.12.0/boneio/webui/frontend-dist/schem → boneio-0.12.0.dev2/boneio/webui/schema}/oled.schema.json +18 -9
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/schema/output.schema.json +49 -29
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/schema/output_group.schema.json +12 -10
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/schema/pca9685.schema.json +8 -5
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/schema/pcf8575.schema.json +8 -5
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/schema/sensor.schema.json +22 -10
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/schema/web.schema.json +12 -6
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/web_server.py +28 -45
- {boneio-0.12.0 → boneio-0.12.0.dev2}/pyproject.toml +1 -1
- boneio-0.12.0/boneio/version.py +0 -2
- boneio-0.12.0/boneio/webui/frontend-dist/assets/editor.worker-B7eDTY9b.js +0 -12
- boneio-0.12.0/boneio/webui/frontend-dist/assets/index-C5_B_rBj.js +0 -992
- boneio-0.12.0/boneio/webui/frontend-dist/assets/index-CYATq2Ns.css +0 -1
- boneio-0.12.0/boneio/webui/frontend-dist/assets/json.worker-CHql1Q9C.js +0 -49
- boneio-0.12.0/boneio/webui/frontend-dist/assets/yaml.worker-WtWMl2j5.js +0 -411
- boneio-0.12.0/boneio/webui/frontend-dist/schem/adc.schema.json +0 -101
- boneio-0.12.0/boneio/webui/frontend-dist/schem/config.schema.json +0 -2852
- boneio-0.12.0/boneio/webui/frontend-dist/schem/dallas.schema.json +0 -24
- boneio-0.12.0/boneio/webui/frontend-dist/schem/ds2482.schema.json +0 -33
- boneio-0.12.0/boneio/webui/frontend-dist/schem/lm75.schema.json +0 -76
- boneio-0.12.0/boneio/webui/frontend-dist/schem/logger.schema.json +0 -57
- boneio-0.12.0/boneio/webui/frontend-dist/schem/modbus_devices.schema.json +0 -181
- boneio-0.12.0/boneio/webui/frontend-dist/schem/mqtt.schema.json +0 -87
- boneio-0.12.0/boneio/webui/frontend-dist/schem/output.schema.json +0 -162
- boneio-0.12.0/boneio/webui/frontend-dist/schem/output_group.schema.json +0 -77
- boneio-0.12.0/boneio/webui/frontend-dist/schem/pca9685.schema.json +0 -48
- boneio-0.12.0/boneio/webui/frontend-dist/schem/pcf8575.schema.json +0 -48
- boneio-0.12.0/boneio/webui/frontend-dist/schem/sensor.schema.json +0 -117
- boneio-0.12.0/boneio/webui/frontend-dist/schem/web.schema.json +0 -48
- boneio-0.12.0/boneio/webui/schema/binary_sensor.schema.json +0 -592
- boneio-0.12.0/boneio/webui/schema/boneio.schema.json +0 -78
- boneio-0.12.0/boneio/webui/schema/cover.schema.json +0 -158
- boneio-0.12.0/boneio/webui/schema/event.schema.json +0 -663
- boneio-0.12.0/boneio/webui/schema/ina219.schema.json +0 -109
- boneio-0.12.0/boneio/webui/schema/mcp23017.schema.json +0 -48
- boneio-0.12.0/boneio/webui/schema/mcp9808.schema.json +0 -76
- boneio-0.12.0/boneio/webui/schema/modbus.schema.json +0 -74
- boneio-0.12.0/boneio/webui/schema/modbus_devices.schema.json +0 -181
- boneio-0.12.0/boneio/webui/schema/oled.schema.json +0 -121
- {boneio-0.12.0 → boneio-0.12.0.dev2}/LICENSE +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/README.md +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/__init__.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/boards/0.7/input.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/boards/0.7/output_24_16.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/boards/0.7/output_32_10.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/boards/0.7/output_cover.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/boards/0.7/output_cover_mix.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/boards/0.8/input.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/boards/0.8/output_24_16.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/boards/0.8/output_32_10.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/boards/0.8/output_cover.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/boards/0.8/output_cover_mix.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/bonecli.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/const.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/cover/__init__.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/24x16/adc.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/24x16/binary_sensor.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/24x16/config.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/24x16/event.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/24x16/mqtt.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/32x10/adc.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/32x10/binary_sensor.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/32x10/config.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/32x10/event.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/32x10/mqtt.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/32x10/output32x10A.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/__init__.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/cover/adc.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/cover/binary_sensor.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/cover/config.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/cover/cover.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/cover/event.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/cover/mqtt.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/cover/outputCover.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/cover_mix/adc.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/cover_mix/binary_sensor.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/cover_mix/config.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/cover_mix/cover.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/cover_mix/event.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/cover_mix/mqtt.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/cover_mix/outputCoverMix.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/different_configs/adc.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/different_configs/all_binary_sensor.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/different_configs/binary_sensor.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/different_configs/binary_sensor_v_0_7.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/different_configs/config_24_16.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/different_configs/event_all.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/different_configs/event_v_0_7.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/different_configs/led32x4A.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/different_configs/output24x16A.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/different_configs/output24x16A_v0.3.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/different_configs/output32x10A.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/example_config/different_configs/output32x5A.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/fonts/danube__.ttf +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/group/__init__.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/__init__.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/async_updater.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/click_timer.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/config.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/exceptions.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/filter.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/gpiod.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/ha_discovery.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/interlock.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/logger.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/mqtt.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/oled.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/onewire/W1ThermSensor.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/onewire/__init__.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/onewire/ds2482.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/onewire/onewire.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/pcf8575.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/queue.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/sensor/ina_219_smbus.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/timeperiod.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/helper/util.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/input/__init__.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/input/gpio.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/message_bus/__init__.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/message_bus/basic.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/message_bus/local.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/message_bus/mqtt.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/__init__.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/client.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/cwt.json +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/derived/__init__.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/derived/numeric.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/derived/select.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/derived/switch.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/derived/text.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/dts1964_3f.json +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/fujitsu-ac.json +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/liquid-sensor.json +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/modbuscli.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/orno-or-we-517.json +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/pt100.json +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/r4dcb08.json +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/sdm120.json +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/sdm630.json +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/sensor/__init__.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/sensor/base.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/sensor/binary.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/sensor/numeric.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/sensor/text.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/sht20.json +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/sht30.json +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/socomec_e03.json +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/socomec_e23.json +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/sofar.json +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/thessla.json +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/utils.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/ventclear.json +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/writeable/__init__.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/writeable/binary.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/modbus/writeable/numeric.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/models/__init__.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/models/files.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/models/logs.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/oled.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/relay/__init__.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/relay/gpio.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/relay/pca.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/relay/pcf.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/schema/actions.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/schema/actions_sensor.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/schema/actions_switch.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/schema/filters.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/schema/filters_adc.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/schema/id.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/schema/temp_unit.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/schema/update_interval.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/sensor/__init__.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/sensor/adc.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/sensor/gpio.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/sensor/serial_number.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/sensor/temp/dallas.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/sensor/temp/lm75.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/sensor/temp/mcp9808.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/abap-BrgZPUOV.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/apex-DyP6w7ZV.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/azcli-BaLxmfj-.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/bat-CFOPXBzS.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/bicep-BfEKNvv3.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/cameligo-BFG1Mk7z.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/clojure-DTECt2xU.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/codicon-DCmgc-ay.ttf +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/coffee-CDGzqUPQ.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/cpp-CLLBncYj.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/csharp-dUCx_-0o.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/csp-5Rap-vPy.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/css-D3h14YRZ.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/cypher-DrQuvNYM.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/dart-CFKIUWau.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/dockerfile-Zznr-cwX.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/ecl-Ce3n6wWz.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/elixir-deUWdS0T.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/flow9-i9-g7ZhI.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/fsharp-CzKuDChf.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/go-Cphgjts3.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/graphql-Cg7bfA9N.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/hcl-0cvrggvQ.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/ini-Drc7WvVn.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/java-B_fMsGYe.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/julia-Bqgm2twL.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/kotlin-BSkB5QuD.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/less-BsTHnhdd.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/lexon-YWi4-JPR.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/lua-nf6ki56Z.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/m3-Cpb6xl2v.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/markdown-DSZPf7rp.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/mips-B_c3zf-v.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/msdax-rUNN04Wq.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/mysql-DDwshQtU.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/objective-c-B5zXfXm9.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/pascal-CXOwvkN_.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/pascaligo-Bc-ZgV77.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/perl-CwNk8-XU.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/pgsql-tGk8EFnU.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/php-CpIb_Oan.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/pla-B03wrqEc.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/postiats-BKlk5iyT.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/powerquery-Bhzvs7bI.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/powershell-Dd3NCNK9.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/protobuf-COyEY5Pt.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/pug-BaJupSGV.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/qsharp-DXyYeYxl.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/r-CdQndTaG.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/redis-CVwtpugi.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/redshift-25W9uPmb.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/restructuredtext-DfzH4Xui.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/ruby-Cp1zYvxS.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/rust-D5C2fndG.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/sb-CDntyWJ8.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/scala-BoFRg7Ot.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/scheme-Bio4gycK.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/scss-4Ik7cdeQ.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/shell-CX-rkNHf.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/solidity-Tw7wswEv.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/sophia-C5WLch3f.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/sparql-DHaeiCBh.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/sql-CCSDG5nI.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/st-pnP8ivHi.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/swift-DwJ7jVG9.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/systemverilog-B9Xyijhd.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/tcl-DnHyzjbg.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/twig-CPajHgWi.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/typespec-D-MeaMDU.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/vb-DgyLZaXg.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/assets/wgsl-BIv9DU6q.js +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/boneio.svg +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/frontend-dist/boneio_fav.svg +0 -0
- {boneio-0.12.0/boneio/webui/frontend-dist/schem → boneio-0.12.0.dev2/boneio/webui/schema}/modbus_sensors.schema.json +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/boneio/webui/websocket_manager.py +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/tests/32_5_config.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/tests/bandit.yaml +0 -0
- {boneio-0.12.0 → boneio-0.12.0.dev2}/tests/relay_32_5.py +0 -0
|
@@ -172,10 +172,13 @@ class BaseCover(BaseCoverABC, BasicMqtt):
|
|
|
172
172
|
|
|
173
173
|
self._event_bus.add_sigterm_listener(self.on_exit)
|
|
174
174
|
|
|
175
|
+
def _schedule_send_state_task(state_to_send, json_pos_to_send):
|
|
176
|
+
asyncio.ensure_future(self.send_state(state_to_send, json_pos_to_send), loop=self._loop)
|
|
177
|
+
|
|
175
178
|
self._loop.call_soon_threadsafe(
|
|
176
179
|
self._loop.call_later,
|
|
177
180
|
0.5,
|
|
178
|
-
|
|
181
|
+
_schedule_send_state_task,
|
|
179
182
|
self.state,
|
|
180
183
|
self.json_position
|
|
181
184
|
)
|
|
@@ -192,7 +195,7 @@ class BaseCover(BaseCoverABC, BasicMqtt):
|
|
|
192
195
|
self._close_relay.turn_off()
|
|
193
196
|
self._current_operation = IDLE
|
|
194
197
|
if not on_exit:
|
|
195
|
-
self.send_state(self.state, self.json_position)
|
|
198
|
+
await self.send_state(self.state, self.json_position)
|
|
196
199
|
|
|
197
200
|
async def open(self) -> None:
|
|
198
201
|
if self._position >= 100:
|
|
@@ -267,7 +270,7 @@ class BaseCover(BaseCoverABC, BasicMqtt):
|
|
|
267
270
|
def last_timestamp(self) -> float:
|
|
268
271
|
return self._last_timestamp
|
|
269
272
|
|
|
270
|
-
def send_state(self, state: str, json_position: PositionDict = None) -> None:
|
|
273
|
+
async def send_state(self, state: str, json_position: PositionDict = None) -> None:
|
|
271
274
|
event = CoverState(
|
|
272
275
|
id=self.id,
|
|
273
276
|
name=self.name,
|
|
@@ -277,14 +280,10 @@ class BaseCover(BaseCoverABC, BasicMqtt):
|
|
|
277
280
|
current_operation=self._current_operation,
|
|
278
281
|
**json_position
|
|
279
282
|
)
|
|
280
|
-
self._event_bus.
|
|
281
|
-
"event_type": "cover",
|
|
282
|
-
"entity_id": self.id,
|
|
283
|
-
"event_state": event
|
|
284
|
-
})
|
|
283
|
+
await self._event_bus.async_trigger_event(event_type="cover", entity_id=self.id, event=event)
|
|
285
284
|
self._message_bus.send_message(topic=f"{self._send_topic}/state", payload=state)
|
|
286
285
|
self._message_bus.send_message(topic=f"{self._send_topic}/pos", payload=json_position)
|
|
287
286
|
|
|
288
|
-
def send_state_and_save(self, json_position: PositionDict):
|
|
289
|
-
self.send_state(self.state, json_position)
|
|
287
|
+
async def send_state_and_save(self, json_position: PositionDict):
|
|
288
|
+
await self.send_state(self.state, json_position)
|
|
290
289
|
self._state_save(json_position)
|
|
@@ -146,7 +146,7 @@ class PreviousCover(BasicMqtt):
|
|
|
146
146
|
timestamp=self.last_timestamp,
|
|
147
147
|
current_operation=self._current_operation,
|
|
148
148
|
)
|
|
149
|
-
self._event_bus.
|
|
149
|
+
await self._event_bus.async_trigger_event(event_type="cover", entity_id=self.id, event=event)
|
|
150
150
|
|
|
151
151
|
def send_state(self) -> None:
|
|
152
152
|
"""Send state of cover to mqtt."""
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import asyncio
|
|
3
4
|
import logging
|
|
4
5
|
import threading
|
|
5
6
|
import time
|
|
@@ -53,7 +54,7 @@ class TimeBasedCover(BaseCover):
|
|
|
53
54
|
|
|
54
55
|
if total_steps == 0 or duration == 0:
|
|
55
56
|
self._current_operation = IDLE
|
|
56
|
-
self._loop.call_soon_threadsafe(self.send_state(self.state, self.json_position))
|
|
57
|
+
self._loop.call_soon_threadsafe(asyncio.run_coroutine_threadsafe, self.send_state(self.state, self.json_position), self._loop)
|
|
57
58
|
return
|
|
58
59
|
|
|
59
60
|
relay.turn_on()
|
|
@@ -71,7 +72,7 @@ class TimeBasedCover(BaseCover):
|
|
|
71
72
|
|
|
72
73
|
self._last_timestamp = current_time # Użyj pobranego czasu
|
|
73
74
|
if current_time - self._last_update_time >= 1:
|
|
74
|
-
self._loop.call_soon_threadsafe(self.send_state(self.state, self.json_position))
|
|
75
|
+
self._loop.call_soon_threadsafe(asyncio.run_coroutine_threadsafe, self.send_state(self.state, self.json_position), self._loop)
|
|
75
76
|
self._last_update_time = current_time
|
|
76
77
|
|
|
77
78
|
if target_position is not None:
|
|
@@ -85,7 +86,8 @@ class TimeBasedCover(BaseCover):
|
|
|
85
86
|
time.sleep(0.05) # Małe opóźnienie, aby nie blokować CPU
|
|
86
87
|
relay.turn_off()
|
|
87
88
|
self._current_operation = IDLE
|
|
88
|
-
self._loop.call_soon_threadsafe(self.
|
|
89
|
+
self._loop.call_soon_threadsafe(asyncio.run_coroutine_threadsafe, self.async_state_save(self.json_position), self._loop)
|
|
90
|
+
self._loop.call_soon_threadsafe(asyncio.run_coroutine_threadsafe, self.send_state(self.state, self.json_position), self._loop)
|
|
89
91
|
self._last_update_time = time.monotonic() # Upewnij się, że aktualizacja jest wysłana na końcu ruchu
|
|
90
92
|
|
|
91
93
|
async def run_cover(self, current_operation: str, target_position: Optional[int] = None) -> None:
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import asyncio
|
|
3
4
|
import logging
|
|
4
5
|
import threading
|
|
5
6
|
import time
|
|
@@ -88,7 +89,9 @@ class VenetianCover(BaseCover, BaseVenetianCoverABC):
|
|
|
88
89
|
if total_steps == 0 or duration == 0:
|
|
89
90
|
self._current_operation = IDLE
|
|
90
91
|
self._loop.call_soon_threadsafe(
|
|
91
|
-
|
|
92
|
+
asyncio.run_coroutine_threadsafe,
|
|
93
|
+
self.send_state(self.state, self.json_position),
|
|
94
|
+
self._loop,
|
|
92
95
|
)
|
|
93
96
|
return
|
|
94
97
|
|
|
@@ -143,7 +146,9 @@ class VenetianCover(BaseCover, BaseVenetianCoverABC):
|
|
|
143
146
|
self._last_timestamp = current_time # Użyj pobranego czasu
|
|
144
147
|
if current_time - self._last_update_time >= 1:
|
|
145
148
|
self._loop.call_soon_threadsafe(
|
|
146
|
-
|
|
149
|
+
asyncio.run_coroutine_threadsafe,
|
|
150
|
+
self.send_state(self.state, self.json_position),
|
|
151
|
+
self._loop,
|
|
147
152
|
)
|
|
148
153
|
self._last_update_time = current_time
|
|
149
154
|
|
|
@@ -171,7 +176,9 @@ class VenetianCover(BaseCover, BaseVenetianCoverABC):
|
|
|
171
176
|
relay.turn_off()
|
|
172
177
|
self._current_operation = IDLE
|
|
173
178
|
self._loop.call_soon_threadsafe(
|
|
174
|
-
|
|
179
|
+
asyncio.run_coroutine_threadsafe,
|
|
180
|
+
self.send_state_and_save(self.json_position),
|
|
181
|
+
self._loop,
|
|
175
182
|
)
|
|
176
183
|
self._last_update_time = (
|
|
177
184
|
time.monotonic()
|
|
@@ -35,9 +35,8 @@ class OutputGroup(BasicRelay):
|
|
|
35
35
|
self.check_state()
|
|
36
36
|
|
|
37
37
|
for member in self._group_members:
|
|
38
|
-
self._event_bus.
|
|
39
|
-
|
|
40
|
-
entity_id=member.id,
|
|
38
|
+
self._event_bus.add_output_listener(
|
|
39
|
+
output_id=member.id,
|
|
41
40
|
listener_id=self.id,
|
|
42
41
|
target=self.event_listener,
|
|
43
42
|
)
|
|
@@ -6,6 +6,7 @@ from datetime import datetime
|
|
|
6
6
|
from typing import Any, Callable, Coroutine, List, Optional
|
|
7
7
|
|
|
8
8
|
from boneio.helper.util import callback
|
|
9
|
+
from boneio.models import OutputState
|
|
9
10
|
|
|
10
11
|
_LOGGER = logging.getLogger(__name__)
|
|
11
12
|
UTC = dt.timezone.utc
|
|
@@ -78,30 +79,23 @@ class ListenerJob:
|
|
|
78
79
|
|
|
79
80
|
|
|
80
81
|
class EventBus:
|
|
81
|
-
"""
|
|
82
|
-
Simple event bus with async queue for multiple event types.
|
|
83
|
-
Obsługuje wiele typów eventów oraz asynchroniczne kolejkowanie i dispatching.
|
|
84
|
-
"""
|
|
82
|
+
"""Simple event bus which ticks every second."""
|
|
85
83
|
|
|
86
|
-
def __init__(self, loop: asyncio.AbstractEventLoop
|
|
87
|
-
"""
|
|
88
|
-
Initialize the event bus.
|
|
89
|
-
:param loop: asyncio event loop
|
|
90
|
-
"""
|
|
84
|
+
def __init__(self, loop: asyncio.AbstractEventLoop) -> None:
|
|
85
|
+
"""Initialize handler"""
|
|
91
86
|
self._loop = loop or asyncio.get_event_loop()
|
|
92
|
-
self.
|
|
87
|
+
self._every_second_listeners = {}
|
|
88
|
+
self._output_listeners = {}
|
|
93
89
|
self._event_listeners = {
|
|
94
90
|
"input": {},
|
|
95
91
|
"output": {},
|
|
96
92
|
"cover": {},
|
|
97
|
-
"
|
|
93
|
+
"modbus_sensor": {},
|
|
98
94
|
"sensor": {},
|
|
99
95
|
"host": {}
|
|
100
96
|
}
|
|
97
|
+
# Index to track listener_ids across all event types
|
|
101
98
|
self._listener_id_index = {}
|
|
102
|
-
self._worker_task = None
|
|
103
|
-
self._every_second_listeners = {}
|
|
104
|
-
self._shutting_down = False
|
|
105
99
|
self._sigterm_listeners = []
|
|
106
100
|
self._haonline_listeners = []
|
|
107
101
|
self._timer_handle = _async_create_timer(
|
|
@@ -111,84 +105,37 @@ class EventBus:
|
|
|
111
105
|
self._monitor_task = None
|
|
112
106
|
|
|
113
107
|
async def start(self):
|
|
114
|
-
"""
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
"""
|
|
127
|
-
while not self._shutting_down:
|
|
128
|
-
try:
|
|
129
|
-
event = await self._event_queue.get()
|
|
130
|
-
except asyncio.CancelledError:
|
|
131
|
-
_LOGGER.info("Event bus worker cancelled.")
|
|
132
|
-
await self.stop()
|
|
133
|
-
raise
|
|
134
|
-
try:
|
|
135
|
-
await self._handle_event(event)
|
|
136
|
-
except Exception as exc:
|
|
137
|
-
_LOGGER.error(f"Error handling event: {exc}")
|
|
138
|
-
finally:
|
|
139
|
-
self._event_queue.task_done()
|
|
140
|
-
|
|
141
|
-
async def _handle_event(self, event: dict):
|
|
142
|
-
"""
|
|
143
|
-
Dispatch event to registered listeners.
|
|
144
|
-
:param event: dict or object with at least 'event_type' field
|
|
145
|
-
"""
|
|
146
|
-
event_type = event.get('event_type')
|
|
147
|
-
event_state = event.get('event_state')
|
|
148
|
-
entity_id = event.get('entity_id')
|
|
149
|
-
if not event_type or event_type not in self._event_listeners:
|
|
150
|
-
_LOGGER.warning(f"Unknown event_type: {event_type}")
|
|
151
|
-
return
|
|
152
|
-
if not entity_id:
|
|
153
|
-
_LOGGER.warning(f"Unknown entity_id: {entity_id}")
|
|
154
|
-
return
|
|
155
|
-
entity_id_listeners = self._event_listeners.get(event_type, {}).get(entity_id, {})
|
|
156
|
-
for listener in entity_id_listeners.values():
|
|
157
|
-
try:
|
|
158
|
-
await listener.target(event_state)
|
|
159
|
-
except Exception as exc:
|
|
160
|
-
_LOGGER.error(f"Listener error: {exc}")
|
|
161
|
-
|
|
162
|
-
def trigger_event(self, event):
|
|
163
|
-
"""
|
|
164
|
-
Put event into the queue for async processing.
|
|
165
|
-
:param event: dict or object with at least 'event_type' field
|
|
166
|
-
"""
|
|
167
|
-
self._event_queue.put_nowait(event)
|
|
108
|
+
"""Start the event bus monitor."""
|
|
109
|
+
self._monitor_task = asyncio.create_task(self._monitor_loop())
|
|
110
|
+
|
|
111
|
+
async def _monitor_loop(self):
|
|
112
|
+
"""Monitor loop that can be cancelled for cleanup."""
|
|
113
|
+
try:
|
|
114
|
+
while True:
|
|
115
|
+
await asyncio.sleep(1)
|
|
116
|
+
except asyncio.CancelledError:
|
|
117
|
+
_LOGGER.info("Monitor loop cancelled, cleaning up...")
|
|
118
|
+
await self.ask_stop()
|
|
119
|
+
raise
|
|
168
120
|
|
|
169
121
|
def request_stop(self):
|
|
170
122
|
"""Request the event bus to stop."""
|
|
171
|
-
if self.
|
|
123
|
+
if self._monitor_task and not self._shutting_down:
|
|
172
124
|
self._shutting_down = True
|
|
173
|
-
self.
|
|
125
|
+
self._monitor_task.cancel()
|
|
174
126
|
|
|
175
|
-
async def
|
|
176
|
-
"""
|
|
177
|
-
Stop the event bus and worker task gracefully.
|
|
178
|
-
"""
|
|
127
|
+
async def ask_stop(self):
|
|
128
|
+
"""Function to call on restart. Should invoke all sigterm listeners."""
|
|
179
129
|
if self._shutting_down:
|
|
180
130
|
return
|
|
181
131
|
self._shutting_down = True
|
|
132
|
+
self._every_second_listeners = {}
|
|
133
|
+
self._output_listeners = {}
|
|
134
|
+
|
|
182
135
|
await self._handle_sigterm_listeners()
|
|
183
136
|
for listener in self._every_second_listeners.values():
|
|
184
|
-
listener.target(
|
|
185
|
-
|
|
186
|
-
self._worker_task.cancel()
|
|
187
|
-
try:
|
|
188
|
-
await self._worker_task
|
|
189
|
-
except asyncio.CancelledError:
|
|
190
|
-
_LOGGER.info("Event bus worker cancelled.")
|
|
191
|
-
_LOGGER.info("Shutdown EventBus gracefully.")
|
|
137
|
+
listener.target()
|
|
138
|
+
_LOGGER.info("Shutdown Eventbus gracefully.")
|
|
192
139
|
|
|
193
140
|
def _run_second_event(self, time):
|
|
194
141
|
"""Run event every second."""
|
|
@@ -238,6 +185,9 @@ class EventBus:
|
|
|
238
185
|
exit_task = self._loop.create_task(cleanup_and_exit())
|
|
239
186
|
exit_task.add_done_callback(task_done_callback)
|
|
240
187
|
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
241
191
|
def add_every_second_listener(self, name, target):
|
|
242
192
|
"""Add listener on every second job."""
|
|
243
193
|
self._every_second_listeners[name] = ListenerJob(target=target)
|
|
@@ -247,6 +197,39 @@ class EventBus:
|
|
|
247
197
|
"""Add sigterm listener."""
|
|
248
198
|
self._sigterm_listeners.append(target)
|
|
249
199
|
|
|
200
|
+
def add_output_listener(self, output_id, listener_id, target) -> ListenerJob:
|
|
201
|
+
"""Add output listener.
|
|
202
|
+
|
|
203
|
+
listener_id is typically group_id for group outputs or ws (websocket)
|
|
204
|
+
"""
|
|
205
|
+
if output_id not in self._output_listeners:
|
|
206
|
+
self._output_listeners[output_id] = {}
|
|
207
|
+
if listener_id in self._output_listeners[output_id]:
|
|
208
|
+
listener = self._output_listeners[output_id][listener_id]
|
|
209
|
+
listener.set_target(target)
|
|
210
|
+
return listener
|
|
211
|
+
self._output_listeners[output_id][listener_id] = ListenerJob(target=target)
|
|
212
|
+
return self._output_listeners[output_id][listener_id]
|
|
213
|
+
|
|
214
|
+
def remove_output_listener(self, output_id, listener_id):
|
|
215
|
+
"""Add output listener.
|
|
216
|
+
|
|
217
|
+
listener_id is typically group_id for group outputs or ws (websocket)
|
|
218
|
+
"""
|
|
219
|
+
if output_id in self._output_listeners and listener_id in self._output_listeners[output_id]:
|
|
220
|
+
del self._output_listeners[output_id][listener_id]
|
|
221
|
+
|
|
222
|
+
async def async_trigger_output_event(self, output_id: str, event: OutputState):
|
|
223
|
+
listeners = self._output_listeners.get(output_id, {})
|
|
224
|
+
for listener in listeners.values():
|
|
225
|
+
await listener.target(event)
|
|
226
|
+
|
|
227
|
+
async def async_trigger_event(self, event_type: str, entity_id: str, event: Any):
|
|
228
|
+
"""Trigger event for all listeners of given type and entity."""
|
|
229
|
+
listeners = self._event_listeners.get(event_type, {}).get(entity_id, {})
|
|
230
|
+
for listener in listeners.values():
|
|
231
|
+
await listener.target(event)
|
|
232
|
+
|
|
250
233
|
def add_event_listener(
|
|
251
234
|
self, event_type: str, entity_id: str, listener_id: str, target
|
|
252
235
|
) -> ListenerJob:
|
|
@@ -121,7 +121,7 @@ class GpioBaseClass:
|
|
|
121
121
|
def __init__(
|
|
122
122
|
self,
|
|
123
123
|
pin: str,
|
|
124
|
-
|
|
124
|
+
press_callback: Callable[
|
|
125
125
|
[ClickTypes, GpioBaseClass, str, bool, float | None],
|
|
126
126
|
Awaitable[None],
|
|
127
127
|
],
|
|
@@ -141,7 +141,7 @@ class GpioBaseClass:
|
|
|
141
141
|
)
|
|
142
142
|
self._bounce_time = bounce_time.total_in_seconds
|
|
143
143
|
self._loop = asyncio.get_running_loop()
|
|
144
|
-
self.
|
|
144
|
+
self._press_callback = press_callback
|
|
145
145
|
self._name = name
|
|
146
146
|
setup_input(pin=self._pin, pull_mode=gpio_mode)
|
|
147
147
|
self._actions = actions
|
|
@@ -153,62 +153,52 @@ class GpioBaseClass:
|
|
|
153
153
|
self._last_state = "Unknown"
|
|
154
154
|
self._last_timestamp = 0.0
|
|
155
155
|
self._event_bus = event_bus
|
|
156
|
-
self._event_lock = asyncio.Lock()
|
|
157
156
|
|
|
158
157
|
@property
|
|
159
158
|
def boneio_input(self) -> str:
|
|
160
159
|
return self._boneio_input or ""
|
|
161
160
|
|
|
162
161
|
def press_callback(
|
|
163
|
-
self, click_type: ClickTypes, duration: float | None = None
|
|
162
|
+
self, click_type: ClickTypes, duration: float | None = None
|
|
164
163
|
) -> None:
|
|
165
164
|
"""Handle press callback."""
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
async def _handle_press_with_lock(self, click_type: ClickTypes, duration: float | None = None, start_time: float | None = None):
|
|
170
|
-
"""Handle press event with a lock to ensure sequential execution."""
|
|
171
|
-
now = time.time()
|
|
165
|
+
self._last_timestamp = time.time()
|
|
172
166
|
_LOGGER.debug(
|
|
173
|
-
"
|
|
167
|
+
"Press callback: %s on pin %s - %s at %s",
|
|
168
|
+
click_type,
|
|
169
|
+
self._pin,
|
|
170
|
+
self.name,
|
|
171
|
+
self._last_timestamp,
|
|
174
172
|
)
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
self.name,
|
|
173
|
+
self._last_state = click_type
|
|
174
|
+
self._loop.create_task(
|
|
175
|
+
self.async_press_callback(
|
|
179
176
|
click_type,
|
|
180
|
-
)
|
|
181
|
-
self._last_timestamp = time.time()
|
|
182
|
-
_LOGGER.debug(
|
|
183
|
-
"Press callback: %s on pin %s - %s. Duration: %s",
|
|
184
|
-
click_type,
|
|
185
|
-
self._pin,
|
|
186
|
-
self.name,
|
|
187
|
-
self._last_timestamp - start_time,
|
|
188
|
-
)
|
|
189
|
-
self._last_state = click_type
|
|
190
|
-
await self._manager_press_callback(
|
|
191
|
-
click_type,
|
|
192
|
-
self,
|
|
193
|
-
self._empty_message_after,
|
|
194
177
|
duration,
|
|
195
|
-
start_time,
|
|
196
|
-
)
|
|
197
|
-
event = InputState(
|
|
198
|
-
name=self.name,
|
|
199
|
-
pin=self._pin,
|
|
200
|
-
state=self.last_state,
|
|
201
|
-
type=self.input_type,
|
|
202
|
-
timestamp=self.last_press_timestamp,
|
|
203
|
-
boneio_input=self.boneio_input,
|
|
204
178
|
)
|
|
205
|
-
|
|
206
|
-
"event_type": "input",
|
|
207
|
-
"entity_id": self.id,
|
|
208
|
-
"event_state": event
|
|
209
|
-
})
|
|
210
|
-
_LOGGER.debug("[%s] Released lock for event '%s'", self.name, click_type)
|
|
179
|
+
)
|
|
211
180
|
|
|
181
|
+
async def async_press_callback(
|
|
182
|
+
self,
|
|
183
|
+
click_type: ClickTypes,
|
|
184
|
+
duration: float | None = None,
|
|
185
|
+
) -> None:
|
|
186
|
+
|
|
187
|
+
await self._press_callback(
|
|
188
|
+
click_type,
|
|
189
|
+
self,
|
|
190
|
+
self._empty_message_after,
|
|
191
|
+
duration,
|
|
192
|
+
)
|
|
193
|
+
event = InputState(
|
|
194
|
+
name=self.name,
|
|
195
|
+
pin=self._pin,
|
|
196
|
+
state=self.last_state,
|
|
197
|
+
type=self.input_type,
|
|
198
|
+
timestamp=self.last_press_timestamp,
|
|
199
|
+
boneio_input=self.boneio_input,
|
|
200
|
+
)
|
|
201
|
+
await self._event_bus.async_trigger_event(event_type="input", entity_id=self.id, event=event)
|
|
212
202
|
|
|
213
203
|
def set_actions(self, actions: dict) -> None:
|
|
214
204
|
self._actions = actions
|
|
@@ -9,6 +9,7 @@ from adafruit_mcp230xx.mcp23017 import MCP23017
|
|
|
9
9
|
from adafruit_pca9685 import PCA9685
|
|
10
10
|
|
|
11
11
|
from boneio.const import (
|
|
12
|
+
ACTIONS,
|
|
12
13
|
ADDRESS,
|
|
13
14
|
BINARY_SENSOR,
|
|
14
15
|
COVER,
|
|
@@ -447,11 +448,10 @@ def configure_relay(
|
|
|
447
448
|
def configure_event_sensor(
|
|
448
449
|
gpio: dict,
|
|
449
450
|
pin: str,
|
|
450
|
-
|
|
451
|
+
press_callback: Callable,
|
|
451
452
|
event_bus: EventBus,
|
|
452
453
|
send_ha_autodiscovery: Callable,
|
|
453
454
|
input: GpioEventButtonOld | GpioEventButtonNew | GpioInputBinarySensorOld | GpioInputBinarySensorNew | None = None,
|
|
454
|
-
actions: dict = {},
|
|
455
455
|
) -> GpioEventButtonOld | GpioEventButtonNew | None:
|
|
456
456
|
"""Configure input sensor or button."""
|
|
457
457
|
try:
|
|
@@ -467,15 +467,15 @@ def configure_event_sensor(
|
|
|
467
467
|
"You reconfigured type of input. It's forbidden. Please restart boneIO."
|
|
468
468
|
)
|
|
469
469
|
return input
|
|
470
|
-
input.set_actions(actions=
|
|
470
|
+
input.set_actions(actions=gpio.get(ACTIONS, {}))
|
|
471
471
|
else:
|
|
472
472
|
input = gpioEventButtonClass(
|
|
473
473
|
pin=pin,
|
|
474
474
|
name=name,
|
|
475
475
|
input_type=INPUT,
|
|
476
476
|
empty_message_after=gpio.pop("clear_message", False),
|
|
477
|
-
actions=
|
|
478
|
-
|
|
477
|
+
actions=gpio.pop(ACTIONS, {}),
|
|
478
|
+
press_callback=press_callback,
|
|
479
479
|
event_bus=event_bus,
|
|
480
480
|
**gpio,
|
|
481
481
|
)
|
|
@@ -496,11 +496,10 @@ def configure_event_sensor(
|
|
|
496
496
|
def configure_binary_sensor(
|
|
497
497
|
gpio: dict,
|
|
498
498
|
pin: str,
|
|
499
|
-
|
|
499
|
+
press_callback: Callable,
|
|
500
500
|
event_bus: EventBus,
|
|
501
501
|
send_ha_autodiscovery: Callable,
|
|
502
502
|
input: GpioEventButtonOld | GpioEventButtonNew | GpioInputBinarySensorOld | GpioInputBinarySensorNew | None = None,
|
|
503
|
-
actions: dict = {},
|
|
504
503
|
) -> GpioInputBinarySensorOld | GpioInputBinarySensorNew | None:
|
|
505
504
|
"""Configure input sensor or button."""
|
|
506
505
|
try:
|
|
@@ -516,15 +515,15 @@ def configure_binary_sensor(
|
|
|
516
515
|
"You preconfigured type of input. It's forbidden. Please restart boneIO."
|
|
517
516
|
)
|
|
518
517
|
return input
|
|
519
|
-
input.set_actions(actions=
|
|
518
|
+
input.set_actions(actions=gpio.get(ACTIONS, {}))
|
|
520
519
|
else:
|
|
521
520
|
input = GpioInputBinarySensorClass(
|
|
522
521
|
pin=pin,
|
|
523
522
|
name=name,
|
|
524
|
-
actions=
|
|
523
|
+
actions=gpio.pop(ACTIONS, {}),
|
|
525
524
|
input_type=INPUT_SENSOR,
|
|
526
525
|
empty_message_after=gpio.pop("clear_message", False),
|
|
527
|
-
|
|
526
|
+
press_callback=press_callback,
|
|
528
527
|
event_bus=event_bus,
|
|
529
528
|
**gpio,
|
|
530
529
|
)
|