boneIO 0.5.0dev5__tar.gz → 0.5.0dev6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of boneIO might be problematic. Click here for more details.
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/PKG-INFO +1 -1
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/bonecli.py +3 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/helper/gpio.py +2 -3
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/manager.py +24 -9
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/schema/schema.yaml +6 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/sensor/gpio.py +10 -10
- boneIO-0.5.0.dev6/boneio/version.py +2 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/pyproject.toml +1 -1
- boneIO-0.5.0.dev5/boneio/version.py +0 -2
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/LICENSE +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/README.md +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/__init__.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/const.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/cover.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/example_config/__init__.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/example_config/adc.yaml +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/example_config/config.yaml +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/example_config/cover.yaml +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/example_config/input.yaml +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/example_config/output24x16A.yaml +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/example_config/output32x5A.yaml +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/fonts/danube__.ttf +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/helper/__init__.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/helper/async_updater.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/helper/config.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/helper/events.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/helper/exceptions.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/helper/filter.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/helper/ha_discovery.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/helper/loader.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/helper/logger.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/helper/mqtt.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/helper/oled.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/helper/onewire/W1ThermSensor.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/helper/onewire/__init__.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/helper/onewire/ds2482.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/helper/onewire/onewire.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/helper/queue.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/helper/state_manager.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/helper/stats.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/helper/timeperiod.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/helper/util.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/helper/yaml_util.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/input/__init__.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/input/gpio.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/modbus.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/mqtt_client.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/oled.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/relay/__init__.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/relay/basic.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/relay/gpio.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/relay/mcp.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/runner.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/schema/actions.yaml +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/schema/actions_sensor.yaml +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/schema/actions_switch.yaml +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/schema/filters.yaml +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/schema/filters_adc.yaml +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/schema/update_interval.yaml +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/sensor/__init__.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/sensor/adc.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/sensor/modbus/__init__.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/sensor/modbus/sdm120.json +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/sensor/modbus/sdm630.json +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/sensor/modbus/sofar.json +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/sensor/temp/__init__.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/sensor/temp/dallas.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/sensor/temp/lm75.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/boneio/sensor/temp/mcp9808.py +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/tests/32_5_config.yaml +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/tests/bandit.yaml +0 -0
- {boneIO-0.5.0.dev5 → boneIO-0.5.0.dev6}/tests/relay_32_5.py +0 -0
|
@@ -90,9 +90,8 @@ class GpioBaseClass:
|
|
|
90
90
|
) -> None:
|
|
91
91
|
"""Setup GPIO Input Button"""
|
|
92
92
|
self._pin = pin
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
self._bounce_time = gpio.get("bounce_time", TimePeriod(milliseconds=10))
|
|
93
|
+
gpio_mode = kwargs.get(GPIO_MODE, GPIO_STR)
|
|
94
|
+
self._bounce_time = kwargs.get("bounce_time", TimePeriod(milliseconds=10))
|
|
96
95
|
self._loop = asyncio.get_running_loop()
|
|
97
96
|
self._press_callback = press_callback
|
|
98
97
|
setup_input(pin=self._pin, pull_mode=gpio_mode)
|
|
@@ -2,7 +2,6 @@ import asyncio
|
|
|
2
2
|
import logging
|
|
3
3
|
from collections import deque
|
|
4
4
|
from typing import Callable, Coroutine, List, Optional, Set, Union
|
|
5
|
-
|
|
6
5
|
from board import SCL, SDA
|
|
7
6
|
from busio import I2C
|
|
8
7
|
|
|
@@ -60,6 +59,8 @@ from boneio.helper.logger import configure_logger
|
|
|
60
59
|
from boneio.helper.yaml_util import load_config_from_file
|
|
61
60
|
from boneio.modbus import Modbus
|
|
62
61
|
|
|
62
|
+
from w1thermsensor.errors import KernelModuleLoadError
|
|
63
|
+
|
|
63
64
|
_LOGGER = logging.getLogger(__name__)
|
|
64
65
|
|
|
65
66
|
|
|
@@ -253,6 +254,7 @@ class Manager:
|
|
|
253
254
|
from boneio.helper.loader import (
|
|
254
255
|
configure_ds2482,
|
|
255
256
|
)
|
|
257
|
+
from boneio.sensor import DallasSensorDS2482
|
|
256
258
|
|
|
257
259
|
_ds_onewire_bus[_single_ds[ID]] = configure_ds2482(
|
|
258
260
|
i2cbusio=self._i2cbusio, address=_single_ds[ADDRESS]
|
|
@@ -268,22 +270,35 @@ class Manager:
|
|
|
268
270
|
_LOGGER.debug("Preparing Dallas bus.")
|
|
269
271
|
from boneio.helper.loader import configure_dallas
|
|
270
272
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
273
|
+
try:
|
|
274
|
+
from w1thermsensor.kernel import load_kernel_modules
|
|
275
|
+
|
|
276
|
+
load_kernel_modules()
|
|
277
|
+
from boneio.sensor.temp.dallas_w1 import DallasSensorW1
|
|
278
|
+
|
|
279
|
+
_one_wire_devices.update(
|
|
280
|
+
find_onewire_devices(
|
|
281
|
+
ow_bus=configure_dallas(),
|
|
282
|
+
bus_id=dallas[ID],
|
|
283
|
+
bus_type=DALLAS,
|
|
284
|
+
)
|
|
276
285
|
)
|
|
277
|
-
|
|
286
|
+
except KernelModuleLoadError as err:
|
|
287
|
+
_LOGGER.error("Can't configure Dallas W1 device %s", err)
|
|
288
|
+
pass
|
|
289
|
+
|
|
278
290
|
for sensor in sensors:
|
|
279
291
|
address = _one_wire_devices.get(sensor[ADDRESS])
|
|
280
292
|
if not address:
|
|
281
293
|
continue
|
|
282
294
|
ds2482_bus_id = sensor.get("bus_id")
|
|
283
295
|
if ds2482_bus_id and ds2482_bus_id in _ds_onewire_bus:
|
|
284
|
-
kwargs = {
|
|
296
|
+
kwargs = {
|
|
297
|
+
"bus": _ds_onewire_bus[ds2482_bus_id],
|
|
298
|
+
"cls": DallasSensorDS2482,
|
|
299
|
+
}
|
|
285
300
|
else:
|
|
286
|
-
kwargs = {}
|
|
301
|
+
kwargs = {"cls": DallasSensorW1}
|
|
287
302
|
_LOGGER.debug("Configuring sensor %s for boneIO", address)
|
|
288
303
|
self._temp_sensors.append(
|
|
289
304
|
create_dallas_sensor(
|
|
@@ -326,6 +326,12 @@ input:
|
|
|
326
326
|
required: True
|
|
327
327
|
meta:
|
|
328
328
|
label: Either switch or sensor. If sensor then no clicks are detected, just simple on/off on gpio.
|
|
329
|
+
inverted:
|
|
330
|
+
type: boolean
|
|
331
|
+
default: False
|
|
332
|
+
required: True
|
|
333
|
+
meta:
|
|
334
|
+
label: Check if sensor type is inverted. Only aplicable for sensor kind.
|
|
329
335
|
actions:
|
|
330
336
|
required: False
|
|
331
337
|
type: dict
|
|
@@ -14,6 +14,11 @@ class GpioInputSensor(GpioBaseClass):
|
|
|
14
14
|
def __init__(self, **kwargs) -> None:
|
|
15
15
|
"""Setup GPIO Input Button"""
|
|
16
16
|
super().__init__(**kwargs)
|
|
17
|
+
self._click_type = (
|
|
18
|
+
(PRESSED, RELEASED)
|
|
19
|
+
if kwargs.get("inverted", False)
|
|
20
|
+
else (PRESSED, RELEASED)
|
|
21
|
+
)
|
|
17
22
|
edge_detect(
|
|
18
23
|
self._pin,
|
|
19
24
|
callback=self._handle_press,
|
|
@@ -25,13 +30,8 @@ class GpioInputSensor(GpioBaseClass):
|
|
|
25
30
|
def _handle_press(self, pin: str) -> None:
|
|
26
31
|
"""Handle the button press callback"""
|
|
27
32
|
# Ignore if we are in a long press
|
|
28
|
-
if self.is_pressed
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
else:
|
|
34
|
-
_LOGGER.debug("Released event on pin %s", self._pin)
|
|
35
|
-
self._loop.call_soon_threadsafe(
|
|
36
|
-
partial(self._press_callback, RELEASED, self._pin)
|
|
37
|
-
)
|
|
33
|
+
click_type = self._click_type[0] if self.is_pressed else self._click_type[1]
|
|
34
|
+
_LOGGER.debug("%s event on pin %s", click_type, self._pin)
|
|
35
|
+
self._loop.call_soon_threadsafe(
|
|
36
|
+
partial(self._press_callback, click_type, self._pin)
|
|
37
|
+
)
|
|
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
|