boneIO 0.6.3.dev2__py3-none-any.whl → 0.6.3.dev4__py3-none-any.whl
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.3.dev2.dist-info → boneIO-0.6.3.dev4.dist-info}/METADATA +1 -1
- {boneIO-0.6.3.dev2.dist-info → boneIO-0.6.3.dev4.dist-info}/RECORD +8 -8
- boneio/input/gpio.py +6 -9
- boneio/manager.py +5 -1
- boneio/version.py +1 -1
- {boneIO-0.6.3.dev2.dist-info → boneIO-0.6.3.dev4.dist-info}/WHEEL +0 -0
- {boneIO-0.6.3.dev2.dist-info → boneIO-0.6.3.dev4.dist-info}/entry_points.txt +0 -0
- {boneIO-0.6.3.dev2.dist-info → boneIO-0.6.3.dev4.dist-info}/licenses/LICENSE +0 -0
|
@@ -35,8 +35,8 @@ boneio/helper/timeperiod.py,sha256=xpg9oe30Z5WiLDQPq3EBKKScejOnN47NhcpeFvDd3bY,5
|
|
|
35
35
|
boneio/helper/util.py,sha256=QfSoT3H3WnOQAKO5bFRIBCy62HT5NMa9Ek-FmfTW_rw,508
|
|
36
36
|
boneio/helper/yaml_util.py,sha256=gAX7hCaHUlPgkhGCIQ4zjv0Vj9JmLzQsSyF51ZmSb9g,11304
|
|
37
37
|
boneio/input/__init__.py,sha256=u9wuehuC_TNizL4tyn7EygZW5LaTFjSnFaZeZr3zZ1U,99
|
|
38
|
-
boneio/input/gpio.py,sha256=
|
|
39
|
-
boneio/manager.py,sha256=
|
|
38
|
+
boneio/input/gpio.py,sha256=xdtgfzL_OrmyGe3yCyu5OLIgn0aVl4ZOQspsHOQV1bo,3286
|
|
39
|
+
boneio/manager.py,sha256=jUMOFNTSkqo5RJftsHobux3N5201i7KNWULjfPpYeWE,21129
|
|
40
40
|
boneio/modbus.py,sha256=eA_sGnmdcIneXX75ZcXOI223-UkKN1UYmWFqiJBAhJo,4176
|
|
41
41
|
boneio/mqtt_client.py,sha256=NYvok8y_g8iRXDopVojzcDGVnDJEFqHBEYhOGy8m7T8,8331
|
|
42
42
|
boneio/oled.py,sha256=d_ofDQHc7zr3j0qOR0B_L3C8TJhvRH85nnb9Le-88nk,5244
|
|
@@ -69,9 +69,9 @@ boneio/sensor/temp/__init__.py,sha256=OViqBb7DwVn_aFIy6V0iqkSUDjsDNLQ5sOS_4frYdw
|
|
|
69
69
|
boneio/sensor/temp/dallas.py,sha256=xrvd1LNBh1fRcjz_yd_9S29Lv26ItVtLCmhZgVQWJos,2485
|
|
70
70
|
boneio/sensor/temp/lm75.py,sha256=-mpOv78429plRPBp9s09Ljz1x2Bdxuagalqz40vlAKE,243
|
|
71
71
|
boneio/sensor/temp/mcp9808.py,sha256=yAh5yJzZLGTqa39xV4fyqsruj7oy3niOZAUV2W6eyCM,271
|
|
72
|
-
boneio/version.py,sha256=
|
|
73
|
-
boneIO-0.6.3.
|
|
74
|
-
boneIO-0.6.3.
|
|
75
|
-
boneIO-0.6.3.
|
|
76
|
-
boneIO-0.6.3.
|
|
77
|
-
boneIO-0.6.3.
|
|
72
|
+
boneio/version.py,sha256=OGkobkT-4dx8B6Nh2GRb4aKrqZ7tZ3jG_EEBism0FWo,42
|
|
73
|
+
boneIO-0.6.3.dev4.dist-info/entry_points.txt,sha256=Igl1SMDEWwMg144bwRz28UOCb80hdxomC99QJ3u6qC0,46
|
|
74
|
+
boneIO-0.6.3.dev4.dist-info/WHEEL,sha256=B19PGBCYhWaz2p_UjAoRVh767nYQfk14Sn4TpIZ-nfU,87
|
|
75
|
+
boneIO-0.6.3.dev4.dist-info/METADATA,sha256=E-CIR_A1OoQ6euABuHMuoL6dh_6L-N7xiR73CulMBNg,1699
|
|
76
|
+
boneIO-0.6.3.dev4.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
77
|
+
boneIO-0.6.3.dev4.dist-info/RECORD,,
|
boneio/input/gpio.py
CHANGED
|
@@ -12,7 +12,6 @@ from boneio.helper.timeperiod import TimePeriod
|
|
|
12
12
|
|
|
13
13
|
_LOGGER = logging.getLogger(__name__)
|
|
14
14
|
|
|
15
|
-
PERIOD_TO_WAIT_FOR_SECOND_PRESS_MS = 30
|
|
16
15
|
DOUBLE_CLICK_DURATION_MS = 250
|
|
17
16
|
LONG_PRESS_DURATION_MS = 500
|
|
18
17
|
|
|
@@ -25,15 +24,16 @@ class GpioInputButton(GpioBaseClass):
|
|
|
25
24
|
self._state = self.is_pressed
|
|
26
25
|
self.button_pressed_time = 0.0
|
|
27
26
|
self._debounce_time: float = self._bounce_time.total_in_seconds
|
|
27
|
+
self._period_to_wait_for_2nd_click: float = self._debounce_time
|
|
28
28
|
|
|
29
29
|
self._timer_single = ClickTimer(
|
|
30
|
-
delay=TimePeriod(milliseconds=
|
|
30
|
+
delay=TimePeriod(milliseconds=self._period_to_wait_for_2nd_click),
|
|
31
31
|
action=lambda x: self.press_callback(click_type=SINGLE),
|
|
32
32
|
)
|
|
33
33
|
|
|
34
34
|
self._timer_double = ClickTimer(
|
|
35
35
|
delay=TimePeriod(milliseconds=DOUBLE_CLICK_DURATION_MS),
|
|
36
|
-
action=lambda x:
|
|
36
|
+
action=lambda x: None,
|
|
37
37
|
)
|
|
38
38
|
self._timer_long = ClickTimer(
|
|
39
39
|
delay=TimePeriod(milliseconds=LONG_PRESS_DURATION_MS),
|
|
@@ -47,10 +47,6 @@ class GpioInputButton(GpioBaseClass):
|
|
|
47
47
|
add_event_callback(pin=self._pin, callback=self.check_state)
|
|
48
48
|
_LOGGER.debug("Configured listening for input pin %s", self._pin)
|
|
49
49
|
|
|
50
|
-
def double_click_press_callback(self):
|
|
51
|
-
self._is_waiting_for_second_click = False
|
|
52
|
-
if not self._state and not self._timer_long.is_waiting():
|
|
53
|
-
self.press_callback(click_type=SINGLE)
|
|
54
50
|
|
|
55
51
|
def check_state(self, channel) -> None:
|
|
56
52
|
self._state = self.is_pressed
|
|
@@ -63,7 +59,6 @@ class GpioInputButton(GpioBaseClass):
|
|
|
63
59
|
if self._timer_double.is_waiting():
|
|
64
60
|
self._double_click_ran = True
|
|
65
61
|
self.press_callback(click_type=DOUBLE)
|
|
66
|
-
self._is_waiting_for_second_click = False
|
|
67
62
|
return
|
|
68
63
|
else:
|
|
69
64
|
self._timer_double.start_timer()
|
|
@@ -79,12 +74,14 @@ class GpioInputButton(GpioBaseClass):
|
|
|
79
74
|
self._double_click_ran = False
|
|
80
75
|
|
|
81
76
|
def reset_all_timers(self) -> None:
|
|
77
|
+
self._is_waiting_for_second_click = False
|
|
82
78
|
self._timer_single.reset()
|
|
83
79
|
self._timer_double.reset()
|
|
84
80
|
self._timer_long.reset()
|
|
85
81
|
|
|
86
82
|
def press_callback(self, click_type: ClickTypes):
|
|
83
|
+
_LOGGER.debug("Detected press %s", click_type)
|
|
87
84
|
self.reset_all_timers()
|
|
88
|
-
self._loop.
|
|
85
|
+
self._loop.call_soon_threadsafe(
|
|
89
86
|
partial(self._press_callback, click_type, self._pin)
|
|
90
87
|
)
|
boneio/manager.py
CHANGED
|
@@ -456,10 +456,14 @@ class Manager:
|
|
|
456
456
|
continue
|
|
457
457
|
relay = self._output.get(device.replace(" ", ""))
|
|
458
458
|
action = relay_actions.get(action_definition["action_output"])
|
|
459
|
+
print("reya", relay, action)
|
|
459
460
|
if relay and action:
|
|
460
461
|
getattr(relay, action)()
|
|
461
462
|
else:
|
|
462
|
-
|
|
463
|
+
if not action:
|
|
464
|
+
_LOGGER.warn("Action doesn't exists %s. Check spelling", action)
|
|
465
|
+
if not relay:
|
|
466
|
+
_LOGGER.warn("PIN %s for action not found", device)
|
|
463
467
|
elif action_definition[ACTION] == MQTT:
|
|
464
468
|
action_topic = action_definition.get(TOPIC)
|
|
465
469
|
action_payload = action_definition.get("action_mqtt_msg")
|
boneio/version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# flake8: noqa
|
|
2
|
-
__version__ = "0.6.
|
|
2
|
+
__version__ = "0.6.3_dev4"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|