boneIO 0.7.0dev6__py3-none-any.whl → 0.7.2.dev2__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.
Files changed (50) hide show
  1. {boneIO-0.7.0.dev6.dist-info → boneIO-0.7.2.dev2.dist-info}/METADATA +2 -1
  2. boneIO-0.7.2.dev2.dist-info/RECORD +89 -0
  3. boneio/bonecli.py +1 -1
  4. boneio/const.py +58 -2
  5. boneio/example_config/binary_sensor.yaml +2 -0
  6. boneio/example_config/config.yaml +1 -1
  7. boneio/example_config/event.yaml +2 -0
  8. boneio/example_config/event_all.yaml +186 -0
  9. boneio/group/output.py +13 -18
  10. boneio/helper/__init__.py +2 -0
  11. boneio/helper/async_updater.py +3 -3
  12. boneio/helper/click_timer.py +8 -0
  13. boneio/helper/events.py +21 -1
  14. boneio/helper/gpio.py +53 -17
  15. boneio/helper/ha_discovery.py +22 -0
  16. boneio/helper/loader.py +78 -82
  17. boneio/helper/mqtt.py +3 -1
  18. boneio/helper/sensor/ina_219_smbus.py +167 -0
  19. boneio/helper/state_manager.py +13 -3
  20. boneio/helper/stats.py +29 -10
  21. boneio/helper/util.py +6 -0
  22. boneio/helper/yaml_util.py +1 -1
  23. boneio/input/__init__.py +3 -3
  24. boneio/input/gpio.py +2 -8
  25. boneio/input/{gpio_beta.py → gpio_new.py} +24 -34
  26. boneio/manager.py +134 -35
  27. boneio/modbus.py +41 -30
  28. boneio/mqtt_client.py +4 -0
  29. boneio/oled.py +24 -16
  30. boneio/relay/basic.py +42 -18
  31. boneio/relay/mcp.py +7 -18
  32. boneio/relay/pca.py +11 -70
  33. boneio/relay/pcf.py +3 -6
  34. boneio/runner.py +5 -1
  35. boneio/schema/actions_sensor.yaml +0 -2
  36. boneio/schema/actions_switch.yaml +0 -2
  37. boneio/schema/schema.yaml +130 -34
  38. boneio/sensor/__init__.py +6 -4
  39. boneio/sensor/gpio.py +2 -5
  40. boneio/sensor/{gpio_beta.py → gpio_new.py} +5 -8
  41. boneio/sensor/ina219.py +107 -0
  42. boneio/sensor/modbus/__init__.py +54 -10
  43. boneio/sensor/modbus/sdm630.json +296 -297
  44. boneio/sensor/modbus/socomec_e23.json +102 -0
  45. boneio/version.py +1 -1
  46. boneIO-0.7.0.dev6.dist-info/RECORD +0 -85
  47. {boneIO-0.7.0.dev6.dist-info → boneIO-0.7.2.dev2.dist-info}/WHEEL +0 -0
  48. {boneIO-0.7.0.dev6.dist-info → boneIO-0.7.2.dev2.dist-info}/entry_points.txt +0 -0
  49. {boneIO-0.7.0.dev6.dist-info → boneIO-0.7.2.dev2.dist-info}/licenses/LICENSE +0 -0
  50. /boneio/example_config/{adc_v0_4.yaml → adc.yaml} +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: boneIO
3
- Version: 0.7.0dev6
3
+ Version: 0.7.2dev2
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>
@@ -16,6 +16,7 @@ Requires-Dist: adafruit-circuitpython-onewire>=2.0.5
16
16
  Requires-Dist: adafruit-circuitpython-pca9685>=3.4.10
17
17
  Requires-Dist: adafruit-circuitpython-pcf8575>=1.0.2
18
18
  Requires-Dist: adafruit-circuitpython-pct2075>=1.1.19
19
+ Requires-Dist: adafruit-circuitpython-typing==1.9.5
19
20
  Requires-Dist: aiomqtt>=1.1.0
20
21
  Requires-Dist: colorlog>=6.7.0
21
22
  Requires-Dist: gpio>=1.0.0
@@ -0,0 +1,89 @@
1
+ boneio/__init__.py,sha256=hoLKnu6h1uEsiCHA9Ql2MMDC7VQS0E-s_2cxBS-CTOg,147
2
+ boneio/bonecli.py,sha256=fKPcTEMjYG8zhWig3F6dqE2jDxBd17ydWHp0XVnq6sc,3491
3
+ boneio/const.py,sha256=eIpq1EvFYh1p9I83xaDSOrF_JfdYr-1-yXO5vsAaqCg,5093
4
+ boneio/cover.py,sha256=EfO1DAOGTPQykfgJHzg1WqPs0U8b1AnD2NMI-sLZccM,8444
5
+ boneio/example_config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ boneio/example_config/adc.yaml,sha256=GKNpl2t7ebsH57UhJlJioXNuBflsL6eO4JMnyYwZrFs,168
7
+ boneio/example_config/binary_sensor.yaml,sha256=4oErCX-5t6e9e0KVo5GkkFplKkgKs0st-wTmyiCZNzM,286
8
+ boneio/example_config/config.yaml,sha256=7QOFD5P8wJYJrpA2qOwNM975ZKgeO7oKZphgJCP589k,397
9
+ boneio/example_config/cover.yaml,sha256=rs7lv3vIEgAb3q96RKsJL7VMRsEvSNHG848dzZzSKsI,150
10
+ boneio/example_config/event.yaml,sha256=9TMKXGLTAz4umSJCiMs53ReFmhY84LtmEPnanIIw-uY,2692
11
+ boneio/example_config/event_all.yaml,sha256=9TMKXGLTAz4umSJCiMs53ReFmhY84LtmEPnanIIw-uY,2692
12
+ boneio/example_config/led32x4A.yaml,sha256=YkcZ5XH2JF9Oa3pAmrYM5wsE8qQODCHcjYH47AEQpUI,3392
13
+ boneio/example_config/output24x16A.yaml,sha256=BTtHToRgz-U_rMMDbmHkM4wQxHakdzInb3zKMkOkj4w,1691
14
+ boneio/example_config/output24x16A_v0.3.yaml,sha256=XkI4rHn_XdX37xG02-wHieZzSHKiKN5mtnyfRE24NII,1713
15
+ boneio/example_config/output32x5A.yaml,sha256=G2Pb6qL8mXs6MliIM1roAanPag9ozRe3McYYuFsiBc0,2403
16
+ boneio/fonts/danube__.ttf,sha256=KBRPUcGvmroCjrWC8zK4MulUb9lV8R0lXkOY7lNnQWc,19372
17
+ boneio/group/__init__.py,sha256=eUN51J6nU1MdQfcl6JQ2AQwkP6K91mR9caDZyZ18rig,80
18
+ boneio/group/output.py,sha256=qvNxd5xOWDyqpP6eRuyd2XMPAwjPgxIzVltaA7r-RPU,1992
19
+ boneio/helper/__init__.py,sha256=-dv_Wxk1cK9zyx3JEp7TdMJZkZ1_TU7N9k5gM_jXLqA,2118
20
+ boneio/helper/async_updater.py,sha256=oJkuWAepR66gY38W1WAMAa3r8uYy9cEbbDS8o_JGktQ,1018
21
+ boneio/helper/click_timer.py,sha256=Gu8sEi1S8GG42SYbfaMju7WXFhnnil9gYfirLZX7kJk,1315
22
+ boneio/helper/config.py,sha256=5cDnJ7usJDlUvXv8K2rSWEx30OFcU2k1U1vUEjO69WY,2431
23
+ boneio/helper/events.py,sha256=f4JDMMkyp0lWz9w8ABZ_hlKyAbJWtYHGnGTs2vv4vac,8648
24
+ boneio/helper/exceptions.py,sha256=vyYSUojwB7OttOPUjbxeHFM7C_o5ZQmRUcZ_vYpxYYI,717
25
+ boneio/helper/filter.py,sha256=UcjifjaC5wHDW2He7wmwCX2IjSSeLVhXyhrXHeT8RmA,885
26
+ boneio/helper/gpio.py,sha256=q2r2uklPWePuuekPO63kVfoaQdkvNObUJ3ktwsHgOB0,4771
27
+ boneio/helper/ha_discovery.py,sha256=B2t1cfOfKWys4EM1H7OxvOaYL8H_v18CTuHCEVP2w2c,7107
28
+ boneio/helper/loader.py,sha256=zbg6WrKg7sfFRjny6qNQL7l-6ENbPq5AoEuW2T69PQE,17333
29
+ boneio/helper/logger.py,sha256=zyF_Vk3o2eSHuXypJhNzK99eZgkWDWybuB5KcJgurDs,1801
30
+ boneio/helper/mqtt.py,sha256=novgn5Xl--dmwJ3p6gYVnurVxF5uf-i_t9rj5EmmvP8,859
31
+ boneio/helper/oled.py,sha256=f0XYbaFstUbJ6ISmFe1vQCnmNVMctQWtnStNdROrblc,351
32
+ boneio/helper/onewire/W1ThermSensor.py,sha256=Pu5Fp29pKbxjJqDbFs05Mjg3Vy-9z_DTVoBpSWM_byA,2430
33
+ boneio/helper/onewire/__init__.py,sha256=4djH-uxiq5XhAiFTOxyqjvWVoJe0c8U8iN0BfmH8nSU,448
34
+ boneio/helper/onewire/ds2482.py,sha256=c2t_hdAMtFsHw4Vw41QzO_hEDDNMeb3J71mEwEMUBhM,5169
35
+ boneio/helper/onewire/onewire.py,sha256=tHofTu1l0qG7hH2XoSf-lj8gW7wVKe27j57qQWpVMPg,2497
36
+ boneio/helper/pcf8575.py,sha256=qeNYLqV5foDEQCyAz1WRQRi1CYYxtbPIha06Z5TyZVQ,311
37
+ boneio/helper/queue.py,sha256=7fE7d344-BEW8sljN40wmqsbBr4kPLvz4ShBjkT04p8,1066
38
+ boneio/helper/sensor/ina_219_smbus.py,sha256=eXp2epjUgsqaXamTSWSn3LMow5X_YxAxdREaWD7N3mk,6170
39
+ boneio/helper/state_manager.py,sha256=W63oGPCKo1vZ8zr5Q_3SALM0mgjuab5b8Y397HAiO_o,2633
40
+ boneio/helper/stats.py,sha256=Ard04Z0WpkV7U6hgv1Uf4KxkjIde5iIW8W2cqRGXZyg,6731
41
+ boneio/helper/timeperiod.py,sha256=xpg9oe30Z5WiLDQPq3EBKKScejOnN47NhcpeFvDd3bY,5806
42
+ boneio/helper/util.py,sha256=SwTxVnUFe-YCmzubRzfICJDgrr0xMAJaR0G1wBXCMR8,681
43
+ boneio/helper/yaml_util.py,sha256=aaXMwXC2JoDYkBMcZkkB8nic3QOyGOhxPTRxWvMf3G4,11334
44
+ boneio/input/__init__.py,sha256=8Hcps-wCCl6bCAMoEmDJecR-Q9giFL29AvG1ZGe0dZw,200
45
+ boneio/input/gpio.py,sha256=mqmce4P_dNzmNHqNNiNAmKeeZKbbKtPUtQ6zd8-R-9I,2438
46
+ boneio/input/gpio_new.py,sha256=gpPfDr39B8FVUyh9XHtLgVQr4glMGFBgQsyIMzXDPaw,2822
47
+ boneio/manager.py,sha256=Qgnk_5-rnVZ4ZcvpsFMmJndXJiWnxb4AarlPs37E_1s,29859
48
+ boneio/modbus.py,sha256=j9RrSRH4py8rf7FfMBLoTQ7VeeZAjAgMUB8qj0DvaiQ,4575
49
+ boneio/mqtt_client.py,sha256=hzGT3IyftPHNrQXSKbWUXGYZBpP-VdRBkOrILkXDNHs,8665
50
+ boneio/oled.py,sha256=dLfAaH2Qto9P3mil_JK4siGvkSQ7LebhCabhL-OYGaM,5505
51
+ boneio/relay/__init__.py,sha256=Cz6D37GKHxm8DiuPuxE2EMaey2wdUdJYVet_hfR0lzA,231
52
+ boneio/relay/basic.py,sha256=UfckgRtLC7qp4nuQihqmjTRPu-xJDL53YV9lJb3LnUU,4377
53
+ boneio/relay/gpio.py,sha256=s64FBf6zlxciF57xJ6nrvy0t5Rie0uiXlwos0HL3RKM,1163
54
+ boneio/relay/mcp.py,sha256=m1-AtmgFiIzy00uns3gGGCTwr-ppfAiN_zeIdZXVtQE,2000
55
+ boneio/relay/pca.py,sha256=qiO5YWaywbtkbjVlqKi0y9VomsWuMHsfdQiGG6b_yug,2951
56
+ boneio/relay/pcf.py,sha256=TU5yCqUVMFj_-W1rRqweRtCQWOu24Z6kFnBKGZHjptk,2498
57
+ boneio/runner.py,sha256=PC1rbgsURBbtXe3xIX1zk0bDgSGNKwxTdgX1eq68vfc,2855
58
+ boneio/schema/actions.yaml,sha256=kaJZ9B6SOl4Wbujtnr5k-g5JcAi2NSC1oGc0wZy8fnQ,1039
59
+ boneio/schema/actions_sensor.yaml,sha256=rWd8pfsN7KvmvVvW6VedelFayRVehNQt6x4ou6yN9BY,91
60
+ boneio/schema/actions_switch.yaml,sha256=cDgSi12k4S-TWADQ20Fy9NvYKOXnm7YkyMaWpPyXVoc,96
61
+ boneio/schema/filters.yaml,sha256=WopX1SmCZsSZXNiGccLoi7uMCsUpdbs0eVfsAjmbay4,286
62
+ boneio/schema/filters_adc.yaml,sha256=3e0ts92MoFKOnfGOOn6WYIHxu0-tnZe9OjAjN9m7hiI,304
63
+ boneio/schema/id.yaml,sha256=vHI_6dxkJwoiGp5ien_pPpyaWA1F06eirTgfWMyWa1E,75
64
+ boneio/schema/schema.yaml,sha256=f7fgzVI14yMmL_j2ojFKx2kG95a1KjkuSnP3tP8Vay0,18368
65
+ boneio/schema/temp_unit.yaml,sha256=m32VGz9RTW92Lz08l9n6RftkcVNZquOGPPr5mc3eZVc,65
66
+ boneio/schema/update_interval.yaml,sha256=L_YLddAZdybcdO-T57Qhlv1GaWIVDwhvH-GadD1oOIo,133
67
+ boneio/sensor/__init__.py,sha256=Ztj-xzey-SWrEdVEozcwFsZSuEmJW8STVaf_vPMWiVc,619
68
+ boneio/sensor/adc.py,sha256=tCUdr3KN5uSbgXiwhNXbMjeNkO2CzPYhIOncHR5_LD0,1328
69
+ boneio/sensor/gpio.py,sha256=8m07tW1xDsrhBM2dZ9_VvmvYRn-5hLQVTTUhPlKg1rg,1199
70
+ boneio/sensor/gpio_new.py,sha256=m54agOF2gUh3aoC6f8WpCPAmBRADvqlKeWLqwlon9fg,1223
71
+ boneio/sensor/ina219.py,sha256=kBwaCjY63CNFj1mRZ2EEtm2BrMZ6BW4ahjAD2LT-0jo,3439
72
+ boneio/sensor/modbus/__init__.py,sha256=ZXo27OUlMJ6a0oE_0h3s4r0K5d1dDzsB5Fkk-o0kLA0,10091
73
+ boneio/sensor/modbus/dts1964_3f.json,sha256=WABph_2X4OgMidSM28vw4dLd9ZByRoiUP-RqE0UMpR8,8810
74
+ boneio/sensor/modbus/pt100.json,sha256=bzKNYDc3lMto94Ut8gutVIsHytQiMobwFCkonOiMegs,526
75
+ boneio/sensor/modbus/r4dcb08.json,sha256=oj4eK3bD1bG8BTRE4STVHB5L92luWaJ3FYFHQvFg-ZA,2735
76
+ boneio/sensor/modbus/sdm120.json,sha256=4sueFfSw7G6a77gdIUhbfJvE-MNVJFOeVbRvHDw5Rvk,4145
77
+ boneio/sensor/modbus/sdm630.json,sha256=TUiuc060IpF64p_HSDvdxEQcwkWHWUpnd48_xaGU-_o,8255
78
+ boneio/sensor/modbus/socomec_e23.json,sha256=G4dEvOQbJpkLonubpjI77KFtlt13iwVxmArMgUzuwm0,2859
79
+ boneio/sensor/modbus/sofar.json,sha256=A_YztQN_ctyItIm2LH1tfcs-pSyG18I530qleLd2tOw,5592
80
+ boneio/sensor/temp/__init__.py,sha256=OViqBb7DwVn_aFIy6V0iqkSUDjsDNLQ5sOS_4frYdwg,1808
81
+ boneio/sensor/temp/dallas.py,sha256=xrvd1LNBh1fRcjz_yd_9S29Lv26ItVtLCmhZgVQWJos,2485
82
+ boneio/sensor/temp/lm75.py,sha256=-mpOv78429plRPBp9s09Ljz1x2Bdxuagalqz40vlAKE,243
83
+ boneio/sensor/temp/mcp9808.py,sha256=yAh5yJzZLGTqa39xV4fyqsruj7oy3niOZAUV2W6eyCM,271
84
+ boneio/version.py,sha256=6LMhVvDLSF9ucTFbSrTUvqk15CsvSyxb311WP31KI7A,41
85
+ boneIO-0.7.2.dev2.dist-info/entry_points.txt,sha256=Igl1SMDEWwMg144bwRz28UOCb80hdxomC99QJ3u6qC0,46
86
+ boneIO-0.7.2.dev2.dist-info/WHEEL,sha256=B19PGBCYhWaz2p_UjAoRVh767nYQfk14Sn4TpIZ-nfU,87
87
+ boneIO-0.7.2.dev2.dist-info/METADATA,sha256=QDvmtTw5FnNq5efZJ3e_IM05TKTd5mj8cfuQJW7x0c4,1801
88
+ boneIO-0.7.2.dev2.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
89
+ boneIO-0.7.2.dev2.dist-info/RECORD,,
boneio/bonecli.py CHANGED
@@ -113,7 +113,7 @@ def main() -> int:
113
113
  mqttpassword=args.mqttpassword,
114
114
  debug=debug,
115
115
  )
116
-
116
+ _LOGGER.info("Exiting with exit code %s", exit_code)
117
117
  return exit_code
118
118
 
119
119
 
boneio/const.py CHANGED
@@ -56,7 +56,11 @@ UARTS = {
56
56
  "uart5": {ID: "/dev/ttyS5", TX: "P8.37", RX: "P8.38"},
57
57
  }
58
58
 
59
- relay_actions = {ON: "turn_on", OFF: "turn_off", TOGGLE: "toggle"}
59
+ relay_actions = {
60
+ ON: "async_turn_on",
61
+ OFF: "async_turn_off",
62
+ TOGGLE: "async_toggle",
63
+ }
60
64
 
61
65
  # HA CONSTS
62
66
  HOMEASSISTANT = "homeassistant"
@@ -67,7 +71,8 @@ SHOW_HA = "show_in_ha"
67
71
  # OLED CONST
68
72
  OLED = "oled"
69
73
  FONTS = "fonts"
70
- OLED_PIN = "P9_41"
74
+ OLED_PIN = ("",)
75
+ "P9_41"
71
76
  GIGABYTE = 1073741824
72
77
  MEGABYTE = 1048576
73
78
  WIDTH = 128
@@ -158,3 +163,54 @@ cover_actions = {
158
163
  "TOGGLE_OPEN": "toggle_open",
159
164
  "TOGGLE_CLOSE": "toggle_close",
160
165
  }
166
+
167
+ INA219 = "ina219"
168
+ PINS = {
169
+ "P9_22": {"chip": 0, "line": 2},
170
+ "P9_21": {"chip": 0, "line": 3},
171
+ "P9_18": {"chip": 0, "line": 4},
172
+ "P9_17": {"chip": 0, "line": 5},
173
+ "P8_35": {"chip": 0, "line": 8},
174
+ "P8_33": {"chip": 0, "line": 9},
175
+ "P8_31": {"chip": 0, "line": 10},
176
+ "P8_32": {"chip": 0, "line": 11},
177
+ "P8_19": {"chip": 0, "line": 22},
178
+ "P8_13": {"chip": 0, "line": 23},
179
+ "P8_14": {"chip": 0, "line": 26},
180
+ "P8_17": {"chip": 0, "line": 27},
181
+ "P8_12": {"chip": 1, "line": 12},
182
+ "P8_11": {"chip": 1, "line": 13},
183
+ "P8_16": {"chip": 1, "line": 14},
184
+ "P8_15": {"chip": 1, "line": 15},
185
+ "P9_23": {"chip": 1, "line": 17},
186
+ "P9_14": {"chip": 1, "line": 18},
187
+ "P9_16": {"chip": 1, "line": 19},
188
+ "P8_26": {"chip": 1, "line": 29},
189
+ "P8_18": {"chip": 2, "line": 1},
190
+ "P8_7": {"chip": 2, "line": 2},
191
+ "P8_8": {"chip": 2, "line": 3},
192
+ "P8_10": {"chip": 2, "line": 4},
193
+ "P8_9": {"chip": 2, "line": 5},
194
+ "P8_45": {"chip": 2, "line": 6},
195
+ "P8_46": {"chip": 2, "line": 7},
196
+ "P8_43": {"chip": 2, "line": 8},
197
+ "P8_44": {"chip": 2, "line": 9},
198
+ "P8_41": {"chip": 2, "line": 10},
199
+ "P8_42": {"chip": 2, "line": 11},
200
+ "P8_39": {"chip": 2, "line": 12},
201
+ "P8_40": {"chip": 2, "line": 13},
202
+ "P8_37": {"chip": 2, "line": 14},
203
+ "P8_38": {"chip": 2, "line": 15},
204
+ "P8_36": {"chip": 2, "line": 16},
205
+ "P8_34": {"chip": 2, "line": 17},
206
+ "P8_27": {"chip": 2, "line": 22},
207
+ "P8_29": {"chip": 2, "line": 23},
208
+ "P8_28": {"chip": 2, "line": 24},
209
+ "P8_30": {"chip": 2, "line": 25},
210
+ "P9_31": {"chip": 3, "line": 14},
211
+ "P9_29": {"chip": 3, "line": 15},
212
+ "P9_30": {"chip": 3, "line": 16},
213
+ "P9_28": {"chip": 3, "line": 17},
214
+ "P9_27": {"chip": 3, "line": 19},
215
+ "P9_25": {"chip": 3, "line": 21},
216
+ }
@@ -1,9 +1,11 @@
1
1
  - id: IN_47
2
2
  pin: P8_12
3
3
  kind: sensor
4
+ detection_type: "old"
4
5
  - id: IN_48
5
6
  pin: P8_11
6
7
  kind: sensor
8
+ detection_type: "new"
7
9
  - id: IN_49
8
10
  pin: P8_10
9
11
  kind: sensor
@@ -23,4 +23,4 @@ binary_sensor: !include binary_sensor.yaml
23
23
 
24
24
  output: !include output32x5A.yaml
25
25
 
26
- adc: !include adc.yaml
26
+ # adc: !include adc.yaml Uncomment only if needed.
@@ -1,5 +1,6 @@
1
1
  - id: IN_01
2
2
  pin: P8_37
3
+ detection_type: "old"
3
4
  actions:
4
5
  single:
5
6
  - action: output
@@ -9,6 +10,7 @@
9
10
  pin: switch 1
10
11
  - id: IN_02
11
12
  pin: P8_38
13
+ detection_type: "new"
12
14
  actions:
13
15
  single:
14
16
  - action: output
@@ -0,0 +1,186 @@
1
+ - id: IN_01
2
+ pin: P8_37
3
+ detection_type: "old"
4
+ actions:
5
+ single:
6
+ - action: output
7
+ pin: light 1
8
+ double:
9
+ - action: output
10
+ pin: switch 1
11
+ - id: IN_02
12
+ pin: P8_38
13
+ detection_type: "new"
14
+ actions:
15
+ single:
16
+ - action: output
17
+ pin: light 2
18
+ double:
19
+ - action: output
20
+ pin: switch 2
21
+ - id: IN_03
22
+ pin: P8_39
23
+ actions:
24
+ single:
25
+ - action: output
26
+ pin: light 3
27
+ double:
28
+ - action: output
29
+ pin: switch 3
30
+ - id: IN_04
31
+ pin: P8_40
32
+ actions:
33
+ single:
34
+ - action: output
35
+ pin: light 4
36
+ double:
37
+ - action: output
38
+ pin: switch 4
39
+ - id: IN_05
40
+ pin: P8_41
41
+ actions:
42
+ single:
43
+ - action: output
44
+ pin: light 5
45
+ double:
46
+ - action: output
47
+ pin: switch 5
48
+ - id: IN_06
49
+ pin: P8_42
50
+ actions:
51
+ single:
52
+ - action: output
53
+ pin: light 6
54
+ double:
55
+ - action: output
56
+ pin: switch 6
57
+ - id: IN_07
58
+ pin: P8_43
59
+ actions:
60
+ single:
61
+ - action: output
62
+ pin: light 7
63
+
64
+ - id: IN_08
65
+ pin: P8_44
66
+ actions:
67
+ single:
68
+ - action: output
69
+ pin: light 8
70
+ - id: IN_09
71
+ pin: P8_45
72
+ actions:
73
+ single:
74
+ - action: output
75
+ pin: light 9
76
+ - id: IN_10
77
+ pin: P8_46
78
+ actions:
79
+ single:
80
+ - action: output
81
+ pin: light 10
82
+ - id: IN_11
83
+ pin: P9_42
84
+ actions:
85
+ single:
86
+ - action: output
87
+ pin: light 11
88
+ - id: IN_12
89
+ pin: P9_31
90
+ actions:
91
+ single:
92
+ - action: output
93
+ pin: light 12
94
+ - id: IN_13
95
+ pin: P9_30
96
+ actions:
97
+ single:
98
+ - action: output
99
+ pin: light 13
100
+ - id: IN_14
101
+ pin: P9_29
102
+ actions:
103
+ single:
104
+ - action: output
105
+ pin: light 14
106
+
107
+ - id: IN_15
108
+ pin: P9_28
109
+ actions:
110
+ single:
111
+ - action: output
112
+ pin: light 15
113
+ - id: IN_16
114
+ pin: P9_27
115
+ actions:
116
+ single:
117
+ - action: output
118
+ pin: light 16
119
+ - id: IN_17
120
+ pin: P9_25
121
+ actions:
122
+ single:
123
+ - action: output
124
+ pin: light 4
125
+ - id: IN_18
126
+ pin: P9_23
127
+ - id: IN_19
128
+ pin: P9_22
129
+ - id: IN_20
130
+ pin: P9_21
131
+ - id: IN_21
132
+ pin: P9_18
133
+
134
+ - id: IN_22
135
+ pin: P9_17
136
+ - id: IN_23
137
+ pin: P9_16
138
+ - id: IN_24
139
+ pin: P9_15
140
+ - id: IN_25
141
+ pin: P9_14
142
+ - id: IN_26
143
+ pin: P9_13
144
+ - id: IN_27
145
+ pin: P9_12
146
+ - id: IN_28
147
+ pin: P9_11
148
+
149
+ - id: IN_29
150
+ pin: P8_36
151
+ - id: IN_30
152
+ pin: P8_35
153
+ - id: IN_31
154
+ pin: P8_34
155
+ - id: IN_32
156
+ pin: P8_33
157
+
158
+ - id: IN_33
159
+ pin: P8_32
160
+ - id: IN_34
161
+ pin: P8_31
162
+ - id: IN_35
163
+ pin: P8_30
164
+ - id: IN_36
165
+ pin: P8_29
166
+ - id: IN_37
167
+ pin: P8_28
168
+ - id: IN_38
169
+ pin: P8_27
170
+ - id: IN_39
171
+ pin: P8_26
172
+
173
+ - id: IN_40
174
+ pin: P8_19
175
+ - id: IN_41
176
+ pin: P8_18
177
+ - id: IN_42
178
+ pin: P8_17
179
+ - id: IN_43
180
+ pin: P8_16
181
+ - id: IN_44
182
+ pin: P8_15
183
+ - id: IN_45
184
+ pin: P8_14
185
+ - id: IN_46
186
+ pin: P8_13
boneio/group/output.py CHANGED
@@ -1,14 +1,10 @@
1
- """Cover module."""
1
+ """Group output module."""
2
2
  from __future__ import annotations
3
- import logging
4
3
  import asyncio
5
4
  from typing import List
6
-
7
5
  from boneio.const import COVER, SWITCH, ON, OFF
8
6
  from boneio.relay.basic import BasicRelay
9
7
 
10
- _LOGGER = logging.getLogger(__name__)
11
-
12
8
 
13
9
  class OutputGroup(BasicRelay):
14
10
  """Cover class of boneIO"""
@@ -41,23 +37,22 @@ class OutputGroup(BasicRelay):
41
37
  self._state = state
42
38
  self._loop.call_soon_threadsafe(self.send_state)
43
39
 
44
- def turn_on(self) -> None:
40
+ async def async_turn_on(self) -> None:
45
41
  """Call turn on action."""
46
- for x in self._group_members:
47
- asyncio.create_task(x.async_turn_on())
42
+ await asyncio.gather(
43
+ *[self._loop.run_in_executor(self.executor, x.turn_on) for x in self._group_members]
44
+ )
48
45
 
49
- def turn_off(self) -> None:
46
+ async def async_turn_off(self) -> None:
50
47
  """Call turn off action."""
51
- for x in self._group_members:
52
- asyncio.create_task(x.async_turn_off())
48
+ await asyncio.gather(
49
+ *[self._loop.run_in_executor(self.executor, x.turn_off) for x in self._group_members]
50
+ )
53
51
 
54
- def toggle(self) -> None:
55
- """Toggle group."""
56
- _LOGGER.debug("Toggle relay.")
57
- if self._state == ON:
58
- self.turn_off()
59
- else:
60
- self.turn_on()
52
+ @property
53
+ def is_active(self) -> bool:
54
+ """Is relay active."""
55
+ return self._state == ON
61
56
 
62
57
  def send_state(self) -> None:
63
58
  """Send state to Mqtt on action."""
boneio/helper/__init__.py CHANGED
@@ -21,6 +21,7 @@ from boneio.helper.ha_discovery import (
21
21
  ha_sensor_temp_availabilty_message,
22
22
  ha_switch_availabilty_message,
23
23
  ha_led_availabilty_message,
24
+ ha_sensor_ina_availabilty_message
24
25
  )
25
26
  from boneio.helper.mqtt import BasicMqtt
26
27
  from boneio.helper.async_updater import AsyncUpdater
@@ -54,6 +55,7 @@ __all__ = [
54
55
  "ha_sensor_temp_availabilty_message",
55
56
  "ha_binary_sensor_availabilty_message",
56
57
  "ha_button_availabilty_message",
58
+ "ha_sensor_ina_availabilty_message",
57
59
  "ha_event_availabilty_message",
58
60
  "ha_led_availabilty_message",
59
61
  "GPIOInputException",
@@ -1,6 +1,6 @@
1
1
  from __future__ import annotations
2
2
  import asyncio
3
-
3
+ import time
4
4
  # Typing imports that create a circular dependency
5
5
  from typing import TYPE_CHECKING
6
6
 
@@ -19,11 +19,11 @@ class AsyncUpdater:
19
19
  while True:
20
20
  if hasattr(self, "async_update"):
21
21
  update_interval = (
22
- await self.async_update(time=None)
22
+ await self.async_update(time=time.time())
23
23
  or self._update_interval.total_in_seconds
24
24
  )
25
25
  else:
26
26
  update_interval = (
27
- self.update(time=None) or self._update_interval.total_in_seconds
27
+ self.update(time=time.time()) or self._update_interval.total_in_seconds
28
28
  )
29
29
  await asyncio.sleep(update_interval)
@@ -1,8 +1,12 @@
1
1
  from __future__ import annotations
2
+ import logging
2
3
  import asyncio
3
4
  from boneio.helper.timeperiod import TimePeriod
4
5
  import time
5
6
 
7
+ _LOGGER = logging.getLogger(__name__)
8
+
9
+
6
10
  class ClickTimer:
7
11
  """Represent async call later function with variable to check if timing is ON."""
8
12
 
@@ -16,6 +20,10 @@ class ClickTimer:
16
20
  def is_waiting(self) -> bool:
17
21
  """If variable is set then timer is ON, if None is Off."""
18
22
  return self._remove_listener is not None
23
+
24
+ @property
25
+ def delay(self) -> float:
26
+ return self._delay
19
27
 
20
28
  def reset(self) -> None:
21
29
  """Uninitialize variable remove_listener."""
boneio/helper/events.py CHANGED
@@ -4,7 +4,8 @@ import logging
4
4
  import signal
5
5
  import time
6
6
  from datetime import datetime
7
- from typing import Callable, Optional
7
+ from typing import Any, Coroutine, List, Optional, Callable, Optional
8
+
8
9
 
9
10
  from boneio.helper.util import callback
10
11
 
@@ -261,3 +262,22 @@ def async_call_later_miliseconds(
261
262
  return async_track_point_in_timestamp(
262
263
  loop=loop, action=action, timestamp=expected_fire_timestamp
263
264
  )
265
+
266
+
267
+ def create_unawaited_task_threadsafe(
268
+ loop: asyncio.AbstractEventLoop,
269
+ transient_tasks: List["asyncio.Task[Any]"],
270
+ coro: Coroutine[Any, Any, None],
271
+ task_future: Optional["asyncio.Future[asyncio.Task[Any]]"] = None,
272
+ ) -> None:
273
+ """
274
+ Schedule a coroutine on the loop and add the Task to transient_tasks.
275
+ """
276
+
277
+ def callback() -> None:
278
+ task = loop.create_task(coro)
279
+ transient_tasks.append(task)
280
+ if task_future is not None:
281
+ task_future.set_result(task)
282
+
283
+ loop.call_soon_threadsafe(callback)