boneIO 0.6.0.dev1__tar.gz → 0.6.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.6.0.dev1 → boneIO-0.6.0.dev2}/PKG-INFO +1 -1
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/manager.py +22 -11
- boneIO-0.6.0.dev2/boneio/version.py +2 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/pyproject.toml +1 -1
- boneIO-0.6.0.dev1/boneio/version.py +0 -2
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/LICENSE +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/README.md +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/__init__.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/bonecli.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/const.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/cover.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/example_config/__init__.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/example_config/adc.yaml +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/example_config/config.yaml +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/example_config/cover.yaml +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/example_config/input.yaml +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/example_config/led32x4A.yaml +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/example_config/output24x16A.yaml +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/example_config/output32x5A.yaml +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/fonts/danube__.ttf +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/helper/__init__.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/helper/async_updater.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/helper/config.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/helper/events.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/helper/exceptions.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/helper/filter.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/helper/gpio.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/helper/ha_discovery.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/helper/loader.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/helper/logger.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/helper/mqtt.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/helper/oled.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/helper/onewire/W1ThermSensor.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/helper/onewire/__init__.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/helper/onewire/ds2482.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/helper/onewire/onewire.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/helper/queue.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/helper/state_manager.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/helper/stats.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/helper/timeperiod.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/helper/util.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/helper/yaml_util.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/input/__init__.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/input/gpio.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/modbus.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/mqtt_client.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/oled.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/relay/__init__.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/relay/basic.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/relay/gpio.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/relay/mcp.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/relay/pca.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/runner.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/schema/actions.yaml +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/schema/actions_sensor.yaml +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/schema/actions_switch.yaml +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/schema/filters.yaml +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/schema/filters_adc.yaml +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/schema/id.yaml +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/schema/schema.yaml +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/schema/temp_unit.yaml +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/schema/update_interval.yaml +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/sensor/__init__.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/sensor/adc.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/sensor/gpio.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/sensor/modbus/__init__.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/sensor/modbus/dts1964_3f.json +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/sensor/modbus/pt100.json +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/sensor/modbus/r4dcb08.json +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/sensor/modbus/sdm120.json +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/sensor/modbus/sdm630.json +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/sensor/modbus/sofar.json +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/sensor/temp/__init__.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/sensor/temp/dallas.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/sensor/temp/lm75.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/boneio/sensor/temp/mcp9808.py +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/tests/32_5_config.yaml +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/tests/bandit.yaml +0 -0
- {boneIO-0.6.0.dev1 → boneIO-0.6.0.dev2}/tests/relay_32_5.py +0 -0
|
@@ -46,7 +46,7 @@ from boneio.helper import (
|
|
|
46
46
|
ha_button_availabilty_message,
|
|
47
47
|
ha_light_availabilty_message,
|
|
48
48
|
ha_switch_availabilty_message,
|
|
49
|
-
ha_led_availabilty_message
|
|
49
|
+
ha_led_availabilty_message,
|
|
50
50
|
)
|
|
51
51
|
from boneio.helper.config import ConfigHelper
|
|
52
52
|
from boneio.helper.events import EventBus
|
|
@@ -69,12 +69,14 @@ from w1thermsensor.errors import KernelModuleLoadError
|
|
|
69
69
|
_LOGGER = logging.getLogger(__name__)
|
|
70
70
|
|
|
71
71
|
AVAILABILITY_FUNCTION_CHOOSER = {
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
LIGHT: ha_light_availabilty_message,
|
|
73
|
+
LED: ha_led_availabilty_message,
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
|
|
76
77
|
class Manager:
|
|
77
78
|
"""Manager to communicate MQTT with GPIO inputs and outputs."""
|
|
79
|
+
|
|
78
80
|
def __init__(
|
|
79
81
|
self,
|
|
80
82
|
send_message: Callable[[str, Union[str, dict], bool], None],
|
|
@@ -129,9 +131,9 @@ class Manager:
|
|
|
129
131
|
self.grouped_outputs = create_mcp23017(
|
|
130
132
|
manager=self, mcp23017=mcp23017, i2cbusio=self._i2cbusio
|
|
131
133
|
)
|
|
132
|
-
self.grouped_outputs.update(
|
|
133
|
-
manager=self, pca9685=pca9685, i2cbusio=self._i2cbusio
|
|
134
|
-
)
|
|
134
|
+
self.grouped_outputs.update(
|
|
135
|
+
create_pca9685(manager=self, pca9685=pca9685, i2cbusio=self._i2cbusio)
|
|
136
|
+
)
|
|
135
137
|
|
|
136
138
|
self._configure_adc(adc_list=adc_list)
|
|
137
139
|
|
|
@@ -154,7 +156,9 @@ class Manager:
|
|
|
154
156
|
id=out.id,
|
|
155
157
|
name=out.name,
|
|
156
158
|
ha_type=LIGHT if out.output_type == LED else out.output_type,
|
|
157
|
-
availability_msg_func=AVAILABILITY_FUNCTION_CHOOSER.get(
|
|
159
|
+
availability_msg_func=AVAILABILITY_FUNCTION_CHOOSER.get(
|
|
160
|
+
out.output_type, ha_switch_availabilty_message
|
|
161
|
+
),
|
|
158
162
|
)
|
|
159
163
|
self._loop.call_soon_threadsafe(
|
|
160
164
|
self._loop.call_later,
|
|
@@ -435,13 +439,16 @@ class Manager:
|
|
|
435
439
|
if not device:
|
|
436
440
|
continue
|
|
437
441
|
relay = self._output.get(device.replace(" ", ""))
|
|
438
|
-
|
|
439
|
-
|
|
442
|
+
action = relay_actions.get(action_definition["action_output"])
|
|
443
|
+
if relay and action:
|
|
444
|
+
getattr(relay, action)()
|
|
440
445
|
elif action_definition[ACTION] == MQTT:
|
|
441
446
|
action_topic = action_definition.get(TOPIC)
|
|
442
447
|
action_payload = action_definition.get("action_mqtt_msg")
|
|
443
448
|
if action_topic and action_payload:
|
|
444
|
-
self.send_message(
|
|
449
|
+
self.send_message(
|
|
450
|
+
topic=action_topic, payload=action_payload, retain=False
|
|
451
|
+
)
|
|
445
452
|
elif action_definition[ACTION] == COVER:
|
|
446
453
|
device = action_definition.get(PIN)
|
|
447
454
|
if not device:
|
|
@@ -515,7 +522,11 @@ class Manager:
|
|
|
515
522
|
_LOGGER.debug("Target device not found %s.", device_id)
|
|
516
523
|
elif msg_type == RELAY and command == SET_BRIGHTNESS:
|
|
517
524
|
target_device = self._output.get(device_id)
|
|
518
|
-
if
|
|
525
|
+
if (
|
|
526
|
+
target_device
|
|
527
|
+
and target_device.output_type != NONE
|
|
528
|
+
and message is not ""
|
|
529
|
+
):
|
|
519
530
|
target_device.set_brightness(int(message))
|
|
520
531
|
else:
|
|
521
532
|
_LOGGER.debug("Target device not found %s.", device_id)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|