boneIO 0.6.3.dev2__py3-none-any.whl → 0.6.3.dev3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: boneIO
3
- Version: 0.6.3_dev2
3
+ Version: 0.6.3_dev3
4
4
  Summary: Python App for BoneIO
5
5
  License: GNU General Public License v3.0
6
6
  Author-email: Paweł Szafer <pszafer@gmail.com>
@@ -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=vldjzyi-gFqRJUw6Jucj56XXbVQxriLpZtWDcRnFQz0,3440
39
- boneio/manager.py,sha256=ZldVPnmQ_IRu3ldj7p2HR0-tobNeRjRf2pBM3V3qm-E,20922
38
+ boneio/input/gpio.py,sha256=kn3McEgWfMrv_BcZlNmp7RbUyIcM9_nFdoOa6dh0N6E,3220
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=lELkUhPyqz9wrO0Yfi4xgdYwqNB6En4AmL1Or73si50,42
73
- boneIO-0.6.3.dev2.dist-info/entry_points.txt,sha256=Igl1SMDEWwMg144bwRz28UOCb80hdxomC99QJ3u6qC0,46
74
- boneIO-0.6.3.dev2.dist-info/WHEEL,sha256=B19PGBCYhWaz2p_UjAoRVh767nYQfk14Sn4TpIZ-nfU,87
75
- boneIO-0.6.3.dev2.dist-info/METADATA,sha256=zJ01oNSWDqEAVffzyM8MNdNnwToTq9A-Zvle3K69ES0,1699
76
- boneIO-0.6.3.dev2.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
77
- boneIO-0.6.3.dev2.dist-info/RECORD,,
72
+ boneio/version.py,sha256=HJQ9qRm-Pe2cqUNfgnBvOa_oIhUX-66a7bfKfgiZFjc,42
73
+ boneIO-0.6.3.dev3.dist-info/entry_points.txt,sha256=Igl1SMDEWwMg144bwRz28UOCb80hdxomC99QJ3u6qC0,46
74
+ boneIO-0.6.3.dev3.dist-info/WHEEL,sha256=B19PGBCYhWaz2p_UjAoRVh767nYQfk14Sn4TpIZ-nfU,87
75
+ boneIO-0.6.3.dev3.dist-info/METADATA,sha256=LjDa18zsZ3WNgi4s21ZijqykwEi1Ps6NRxjoH2ONnBE,1699
76
+ boneIO-0.6.3.dev3.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
77
+ boneIO-0.6.3.dev3.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=PERIOD_TO_WAIT_FOR_SECOND_PRESS_MS),
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: self.double_click_press_callback(),
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,6 +74,7 @@ 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()
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
- _LOGGER.warn("PIN %s for action not found", device)
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.3_dev2"
2
+ __version__ = "0.6.3_dev3"