boneIO 0.8.0.dev6__tar.gz → 0.8.0.dev8__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.
Files changed (101) hide show
  1. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/PKG-INFO +1 -1
  2. boneIO-0.8.0.dev8/boneio/example_config/binary_sensor_v_0_7.yaml +11 -0
  3. boneIO-0.8.0.dev8/boneio/example_config/event_v_0_7.yaml +292 -0
  4. boneIO-0.8.0.dev8/boneio/example_config/output32x10A.yaml +192 -0
  5. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/group/output.py +40 -11
  6. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/events.py +13 -9
  7. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/loader.py +2 -1
  8. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/stats.py +68 -22
  9. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/input/gpio.py +13 -3
  10. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/manager.py +1 -1
  11. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/modbus/client.py +3 -3
  12. boneIO-0.8.0.dev8/boneio/modbus/orno-or-we-517.json +36 -0
  13. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/schema/schema.yaml +6 -0
  14. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/sensor/ina219.py +18 -11
  15. boneIO-0.8.0.dev8/boneio/version.py +2 -0
  16. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/pyproject.toml +1 -1
  17. boneIO-0.8.0.dev6/boneio/modbus/orno-or-we-517.json +0 -20
  18. boneIO-0.8.0.dev6/boneio/version.py +0 -2
  19. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/LICENSE +0 -0
  20. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/README.md +0 -0
  21. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/__init__.py +0 -0
  22. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/bonecli.py +0 -0
  23. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/const.py +0 -0
  24. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/cover.py +0 -0
  25. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/example_config/__init__.py +0 -0
  26. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/example_config/adc.yaml +0 -0
  27. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/example_config/binary_sensor.yaml +0 -0
  28. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/example_config/config.yaml +0 -0
  29. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/example_config/cover.yaml +0 -0
  30. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/example_config/event.yaml +0 -0
  31. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/example_config/event_all.yaml +0 -0
  32. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/example_config/led32x4A.yaml +0 -0
  33. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/example_config/output24x16A.yaml +0 -0
  34. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/example_config/output24x16A_v0.3.yaml +0 -0
  35. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/example_config/output32x5A.yaml +0 -0
  36. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/fonts/danube__.ttf +0 -0
  37. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/group/__init__.py +0 -0
  38. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/__init__.py +0 -0
  39. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/async_updater.py +0 -0
  40. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/click_timer.py +0 -0
  41. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/config.py +0 -0
  42. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/exceptions.py +0 -0
  43. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/filter.py +0 -0
  44. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/gpio.py +0 -0
  45. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/ha_discovery.py +0 -0
  46. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/logger.py +0 -0
  47. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/mqtt.py +0 -0
  48. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/oled.py +0 -0
  49. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/onewire/W1ThermSensor.py +0 -0
  50. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/onewire/__init__.py +0 -0
  51. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/onewire/ds2482.py +0 -0
  52. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/onewire/onewire.py +0 -0
  53. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/pcf8575.py +0 -0
  54. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/queue.py +0 -0
  55. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/sensor/ina_219_smbus.py +0 -0
  56. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/state_manager.py +0 -0
  57. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/timeperiod.py +0 -0
  58. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/util.py +0 -0
  59. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/helper/yaml_util.py +0 -0
  60. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/input/__init__.py +0 -0
  61. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/input/gpio_new.py +0 -0
  62. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/modbus/__init__.py +0 -0
  63. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/modbus/cwt.json +0 -0
  64. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/modbus/dts1964_3f.json +0 -0
  65. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/modbus/modbuscli.py +0 -0
  66. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/modbus/pt100.json +0 -0
  67. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/modbus/r4dcb08.json +0 -0
  68. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/modbus/sdm120.json +0 -0
  69. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/modbus/sdm630.json +0 -0
  70. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/modbus/sensor.py +0 -0
  71. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/modbus/socomec_e23.json +0 -0
  72. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/modbus/sofar.json +0 -0
  73. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/modbus/utils.py +0 -0
  74. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/mqtt_client.py +0 -0
  75. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/oled.py +0 -0
  76. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/relay/__init__.py +0 -0
  77. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/relay/basic.py +0 -0
  78. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/relay/gpio.py +0 -0
  79. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/relay/mcp.py +0 -0
  80. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/relay/pca.py +0 -0
  81. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/relay/pcf.py +0 -0
  82. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/runner.py +0 -0
  83. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/schema/actions.yaml +0 -0
  84. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/schema/actions_sensor.yaml +0 -0
  85. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/schema/actions_switch.yaml +0 -0
  86. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/schema/filters.yaml +0 -0
  87. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/schema/filters_adc.yaml +0 -0
  88. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/schema/id.yaml +0 -0
  89. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/schema/temp_unit.yaml +0 -0
  90. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/schema/update_interval.yaml +0 -0
  91. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/sensor/__init__.py +0 -0
  92. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/sensor/adc.py +0 -0
  93. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/sensor/gpio.py +0 -0
  94. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/sensor/gpio_new.py +0 -0
  95. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/sensor/temp/__init__.py +0 -0
  96. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/sensor/temp/dallas.py +0 -0
  97. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/sensor/temp/lm75.py +0 -0
  98. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/boneio/sensor/temp/mcp9808.py +0 -0
  99. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/tests/32_5_config.yaml +0 -0
  100. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/tests/bandit.yaml +0 -0
  101. {boneIO-0.8.0.dev6 → boneIO-0.8.0.dev8}/tests/relay_32_5.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: boneIO
3
- Version: 0.8.0.dev6
3
+ Version: 0.8.0.dev8
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>
@@ -0,0 +1,11 @@
1
+ #- id: IN_02
2
+ # pin: P8_38
3
+ # gpio_mode: gpio_pu
4
+ # detection_type: new
5
+ - id: IN_26
6
+ detection_type: new
7
+ pin: P8_7
8
+ actions:
9
+ pressed:
10
+ - action: output
11
+ pin: OUT_26
@@ -0,0 +1,292 @@
1
+ - id: IN_01
2
+ pin: P8_37
3
+ gpio_mode: gpio_pu
4
+ detection_type: new
5
+ actions:
6
+ single:
7
+ - action: output
8
+ pin: OUT_01
9
+ - id: IN_02
10
+ pin: P8_38
11
+ gpio_mode: gpio_pu
12
+ actions:
13
+ single:
14
+ - action: output
15
+ pin: OUT_02
16
+ - id: IN_03
17
+ pin: P8_39
18
+ detection_type: new
19
+ actions:
20
+ single:
21
+ - action: output
22
+ pin: OUT_03
23
+ - id: IN_04
24
+ pin: P8_40
25
+ detection_type: new
26
+ actions:
27
+ single:
28
+ - action: output
29
+ pin: OUT_04
30
+ - id: IN_05
31
+ pin: P8_41
32
+ detection_type: new
33
+ actions:
34
+ single:
35
+ - action: output
36
+ pin: OUT_05
37
+ - id: IN_06
38
+ pin: P8_42
39
+ detection_type: new
40
+ actions:
41
+ single:
42
+ - action: output
43
+ pin: OUT_06
44
+ - id: IN_07
45
+ detection_type: new
46
+ pin: P8_43
47
+ actions:
48
+ single:
49
+ - action: output
50
+ pin: OUT_07
51
+ - id: IN_08
52
+ pin: P8_44
53
+ detection_type: new
54
+ actions:
55
+ single:
56
+ - action: output
57
+ pin: OUT_08
58
+ - id: IN_09
59
+ pin: P8_45
60
+ detection_type: new
61
+ gpio_mode: gpio_pu
62
+ actions:
63
+ single:
64
+ - action: output
65
+ pin: OUT_09
66
+ - id: IN_10
67
+ pin: P8_46
68
+ gpio_mode: gpio_pu
69
+ detection_type: new
70
+ actions:
71
+ single:
72
+ - action: output
73
+ pin: OUT_10
74
+ - id: IN_11
75
+ pin: P9_42
76
+ detection_type: new
77
+ actions:
78
+ single:
79
+ - action: output
80
+ pin: OUT_11
81
+ - id: IN_12
82
+ detection_type: new
83
+ pin: P9_31
84
+ actions:
85
+ single:
86
+ - action: output
87
+ pin: OUT_12
88
+ # double:
89
+ # - action: mqtt
90
+ # topic: beagle2/cmd/relay/OUT_12/set
91
+ # action_mqtt_msg: 'toggle'
92
+ - id: IN_13
93
+ detection_type: new
94
+ pin: P9_30
95
+ actions:
96
+ single:
97
+ - action: output
98
+ pin: OUT_13
99
+ # long:
100
+ # - action: mqtt
101
+ # topic: beagle2/cmd/relay/OUT_13/set
102
+ # action_mqtt_msg: 'toggle'
103
+ - id: IN_14
104
+ detection_type: new
105
+ pin: P9_29
106
+ actions:
107
+ single:
108
+ - action: output
109
+ pin: OUT_14
110
+
111
+ - id: IN_15
112
+ detection_type: new
113
+ pin: P9_28
114
+ actions:
115
+ single:
116
+ - action: output
117
+ pin: OUT_15
118
+ - id: IN_16
119
+ detection_type: new
120
+ pin: P9_27
121
+ actions:
122
+ single:
123
+ - action: output
124
+ pin: OUT_16
125
+ - id: IN_17
126
+ detection_type: new
127
+ pin: P9_25
128
+ actions:
129
+ single:
130
+ - action: output
131
+ pin: OUT_17
132
+ - id: IN_18
133
+ detection_type: new
134
+ pin: P9_23
135
+ actions:
136
+ single:
137
+ - action: output
138
+ pin: OUT_18
139
+ - id: IN_19
140
+ detection_type: new
141
+ pin: P9_22
142
+ gpio_mode: gpio_pu
143
+ actions:
144
+ single:
145
+ - action: output
146
+ pin: OUT_19
147
+ - id: IN_20
148
+ detection_type: new
149
+ pin: P9_21
150
+ gpio_mode: gpio_pu
151
+ actions:
152
+ single:
153
+ - action: output
154
+ pin: OUT_20
155
+ - id: IN_21
156
+ detection_type: new
157
+ pin: P9_18
158
+ actions:
159
+ single:
160
+ - action: output
161
+ pin: OUT_21
162
+ - id: IN_22
163
+ detection_type: new
164
+ pin: P9_17
165
+ actions:
166
+ single:
167
+ - action: output
168
+ pin: OUT_22
169
+ - id: IN_23
170
+ detection_type: new
171
+ pin: P9_16
172
+ actions:
173
+ single:
174
+ - action: output
175
+ pin: OUT_23
176
+ - id: IN_24
177
+ detection_type: new
178
+ pin: P9_15
179
+ actions:
180
+ single:
181
+ - action: output
182
+ pin: OUT_24
183
+ - id: IN_25
184
+ detection_type: new
185
+ pin: P9_14
186
+ actions:
187
+ single:
188
+ - action: output
189
+ pin: OUT_25
190
+
191
+ #- id: IN_26_binary_sensor!
192
+ # detection_type: new
193
+ # pin: P8_07
194
+
195
+ - id: IN_27
196
+ detection_type: new
197
+ pin: P8_8
198
+ actions:
199
+ single:
200
+ - action: output
201
+ pin: OUT_27
202
+ - id: IN_28
203
+ detection_type: new
204
+ pin: P8_9
205
+ actions:
206
+ single:
207
+ - action: output
208
+ pin: OUT_28
209
+ - id: IN_29
210
+ detection_type: new
211
+ pin: P8_36
212
+ gpio_mode: gpio_pu
213
+ actions:
214
+ single:
215
+ - action: output
216
+ pin: OUT_29
217
+ - id: IN_30
218
+ detection_type: new
219
+ pin: P8_35
220
+ gpio_mode: gpio_pu
221
+ actions:
222
+ single:
223
+ - action: output
224
+ pin: OUT_30
225
+ - id: IN_31
226
+ detection_type: new
227
+ pin: P8_34
228
+ gpio_mode: gpio_pu
229
+ actions:
230
+ single:
231
+ - action: output
232
+ pin: OUT_31
233
+ - id: IN_32
234
+ detection_type: new
235
+ pin: P8_33
236
+ gpio_mode: gpio_pu
237
+ actions:
238
+ single:
239
+ - action: output
240
+ pin: OUT_32
241
+ - id: IN_33
242
+ detection_type: new
243
+ pin: P8_32
244
+ gpio_mode: gpio_pu
245
+ - id: IN_34
246
+ detection_type: new
247
+ pin: P8_31
248
+ - id: IN_35
249
+ detection_type: new
250
+ pin: P8_30
251
+ - id: IN_36
252
+ detection_type: new
253
+ pin: P8_29
254
+ - id: IN_37
255
+ detection_type: new
256
+ pin: P8_28
257
+ - id: IN_38
258
+ detection_type: new
259
+ pin: P8_27
260
+ - id: IN_39
261
+ detection_type: new
262
+ pin: P8_26
263
+ - id: IN_40
264
+ detection_type: new
265
+ pin: P8_19
266
+ - id: IN_41
267
+ detection_type: new
268
+ pin: P8_18
269
+ - id: IN_42
270
+ detection_type: new
271
+ pin: P8_17
272
+ - id: IN_43
273
+ detection_type: new
274
+ pin: P8_16
275
+ - id: IN_44
276
+ detection_type: new
277
+ pin: P8_15
278
+ - id: IN_45
279
+ detection_type: new
280
+ pin: P8_14
281
+ - id: IN_46
282
+ detection_type: new
283
+ pin: P8_13
284
+ - id: IN_47
285
+ detection_type: new
286
+ pin: P8_12
287
+ - id: IN_48
288
+ detection_type: new
289
+ pin: P8_11
290
+ - id: IN_49
291
+ detection_type: new
292
+ pin: P8_10
@@ -0,0 +1,192 @@
1
+ # config to Relay board 32x10 v0.4
2
+ - id: OUT_01
3
+ kind: mcp
4
+ mcp_id: mcp2
5
+ pin: 7
6
+ output_type: light
7
+
8
+ - id: OUT_02
9
+ kind: mcp
10
+ mcp_id: mcp2
11
+ pin: 6
12
+ output_type: light
13
+
14
+ - id: OUT_03
15
+ kind: mcp
16
+ mcp_id: mcp2
17
+ pin: 5
18
+ output_type: light
19
+
20
+ - id: OUT_04
21
+ kind: mcp
22
+ mcp_id: mcp2
23
+ pin: 4
24
+ output_type: light
25
+
26
+ - id: OUT_05
27
+ kind: mcp
28
+ mcp_id: mcp2
29
+ pin: 3
30
+ output_type: light
31
+
32
+ - id: OUT_06
33
+ kind: mcp
34
+ mcp_id: mcp2
35
+ pin: 2
36
+ output_type: light
37
+
38
+ - id: OUT_07
39
+ kind: mcp
40
+ mcp_id: mcp2
41
+ pin: 1
42
+ output_type: light
43
+
44
+ - id: OUT_08
45
+ kind: mcp
46
+ mcp_id: mcp2
47
+ pin: 0
48
+ output_type: light
49
+
50
+ - id: OUT_09
51
+ kind: mcp
52
+ mcp_id: mcp1
53
+ pin: 7
54
+ output_type: light
55
+
56
+ - id: OUT_10
57
+ kind: mcp
58
+ mcp_id: mcp1
59
+ pin: 6
60
+ output_type: light
61
+
62
+ - id: OUT_11
63
+ kind: mcp
64
+ mcp_id: mcp1
65
+ pin: 5
66
+ output_type: light
67
+
68
+ - id: OUT_12
69
+ kind: mcp
70
+ mcp_id: mcp1
71
+ pin: 4
72
+ output_type: light
73
+
74
+ - id: OUT_13
75
+ kind: mcp
76
+ mcp_id: mcp1
77
+ pin: 3
78
+ output_type: light
79
+
80
+ - id: OUT_14
81
+ kind: mcp
82
+ mcp_id: mcp1
83
+ pin: 2
84
+ output_type: light
85
+
86
+ - id: OUT_15
87
+ kind: mcp
88
+ mcp_id: mcp1
89
+ pin: 1
90
+ output_type: light
91
+
92
+ - id: OUT_16
93
+ kind: mcp
94
+ mcp_id: mcp1
95
+ pin: 0
96
+ output_type: light
97
+
98
+ - id: OUT_17
99
+ kind: mcp
100
+ mcp_id: mcp2
101
+ pin: 8
102
+ output_type: light
103
+
104
+ - id: OUT_18
105
+ kind: mcp
106
+ mcp_id: mcp2
107
+ pin: 9
108
+ output_type: light
109
+
110
+ - id: OUT_19
111
+ kind: mcp
112
+ mcp_id: mcp2
113
+ pin: 10
114
+ output_type: light
115
+
116
+ - id: OUT_20
117
+ kind: mcp
118
+ mcp_id: mcp2
119
+ pin: 11
120
+ output_type: light
121
+
122
+ - id: OUT_21
123
+ kind: mcp
124
+ mcp_id: mcp2
125
+ pin: 12
126
+ output_type: light
127
+
128
+ - id: OUT_22
129
+ kind: mcp
130
+ mcp_id: mcp2
131
+ pin: 13
132
+ output_type: light
133
+
134
+ - id: OUT_23
135
+ kind: mcp
136
+ mcp_id: mcp2
137
+ pin: 14
138
+ output_type: light
139
+
140
+ - id: OUT_24
141
+ kind: mcp
142
+ mcp_id: mcp2
143
+ pin: 15
144
+ output_type: light
145
+
146
+ - id: OUT_25
147
+ kind: mcp
148
+ mcp_id: mcp1
149
+ pin: 8
150
+ output_type: light
151
+
152
+ - id: OUT_26
153
+ kind: mcp
154
+ mcp_id: mcp1
155
+ pin: 9
156
+ output_type: light
157
+
158
+ - id: OUT_27
159
+ kind: mcp
160
+ mcp_id: mcp1
161
+ pin: 10
162
+ output_type: light
163
+
164
+ - id: OUT_28
165
+ kind: mcp
166
+ mcp_id: mcp1
167
+ pin: 11
168
+ output_type: light
169
+
170
+ - id: OUT_29
171
+ kind: mcp
172
+ mcp_id: mcp1
173
+ pin: 12
174
+ output_type: light
175
+
176
+ - id: OUT_30
177
+ kind: mcp
178
+ mcp_id: mcp1
179
+ pin: 13
180
+ output_type: light
181
+
182
+ - id: OUT_31
183
+ kind: mcp
184
+ mcp_id: mcp1
185
+ pin: 14
186
+ output_type: light
187
+
188
+ - id: OUT_32
189
+ kind: mcp
190
+ mcp_id: mcp1
191
+ pin: 15
192
+ output_type: light
@@ -1,4 +1,5 @@
1
1
  """Group output module."""
2
+
2
3
  from __future__ import annotations
3
4
  import asyncio
4
5
  from typing import List
@@ -13,26 +14,46 @@ class OutputGroup(BasicRelay):
13
14
  self,
14
15
  members: List[BasicRelay],
15
16
  output_type: str = SWITCH,
16
- restored_state: bool = True,
17
+ restored_state: bool = False,
18
+ all_on_behaviour: bool = False,
17
19
  **kwargs,
18
20
  ) -> None:
19
21
  """Initialize cover class."""
20
22
  self._loop = asyncio.get_event_loop()
21
23
  super().__init__(
22
- **kwargs, output_type=output_type, restored_state=restored_state, topic_type="group"
24
+ **kwargs,
25
+ output_type=output_type,
26
+ restored_state=False,
27
+ topic_type="group",
23
28
  )
29
+ self._all_on_behaviour = all_on_behaviour
24
30
  self._group_members = [x for x in members if x.output_type != COVER]
25
31
  self._timer_handle = None
32
+ self.check_state()
33
+
26
34
  for member in self._group_members:
27
- self._event_bus.add_output_listener(member.id, self.event_listener)
35
+ self._event_bus.add_output_listener(
36
+ output_id=member.id,
37
+ group_id=self.id,
38
+ target=self.event_listener,
39
+ )
28
40
 
29
- async def event_listener(self, relay_id=None) -> None:
30
- """Listen for events called by children relays."""
31
- state = OFF
41
+ def check_state(self) -> None:
32
42
  for x in self._group_members:
33
43
  if x.state == ON:
34
- state = ON
35
- break
44
+ self._state = ON
45
+ return
46
+
47
+ async def event_listener(self, relay_id=None) -> None:
48
+ """Listen for events called by children relays."""
49
+ if self._all_on_behaviour:
50
+ state = (
51
+ ON if all(x.state == ON for x in self._group_members) else OFF
52
+ )
53
+ else:
54
+ state = (
55
+ ON if any(x.state == ON for x in self._group_members) else OFF
56
+ )
36
57
  if state != self._state or not relay_id:
37
58
  self._state = state
38
59
  self._loop.call_soon_threadsafe(self.send_state)
@@ -40,13 +61,19 @@ class OutputGroup(BasicRelay):
40
61
  async def async_turn_on(self) -> None:
41
62
  """Call turn on action."""
42
63
  await asyncio.gather(
43
- *[self._loop.run_in_executor(self.executor, x.turn_on) for x in self._group_members]
64
+ *[
65
+ self._loop.run_in_executor(self.executor, x.turn_on)
66
+ for x in self._group_members
67
+ ]
44
68
  )
45
69
 
46
70
  async def async_turn_off(self) -> None:
47
71
  """Call turn off action."""
48
72
  await asyncio.gather(
49
- *[self._loop.run_in_executor(self.executor, x.turn_off) for x in self._group_members]
73
+ *[
74
+ self._loop.run_in_executor(self.executor, x.turn_off)
75
+ for x in self._group_members
76
+ ]
50
77
  )
51
78
 
52
79
  @property
@@ -56,4 +83,6 @@ class OutputGroup(BasicRelay):
56
83
 
57
84
  def send_state(self) -> None:
58
85
  """Send state to Mqtt on action."""
59
- self._send_message(topic=self._send_topic, payload=self.payload(), retain=True)
86
+ self._send_message(
87
+ topic=self._send_topic, payload=self.payload(), retain=True
88
+ )
@@ -4,7 +4,7 @@ import logging
4
4
  import signal
5
5
  import time
6
6
  from datetime import datetime
7
- from typing import Any, Coroutine, List, Optional, Callable, Optional
7
+ from typing import Any, Coroutine, List, Optional, Callable
8
8
 
9
9
 
10
10
  from boneio.helper.util import callback
@@ -85,7 +85,9 @@ class EventBus:
85
85
  self._output_listeners = {}
86
86
  self._sigterm_listeners = []
87
87
  self._haonline_listeners = []
88
- self._timer_handle = _async_create_timer(self._loop, self._run_second_event)
88
+ self._timer_handle = _async_create_timer(
89
+ self._loop, self._run_second_event
90
+ )
89
91
  for signame in {"SIGINT", "SIGTERM"}:
90
92
  self._loop.add_signal_handler(
91
93
  getattr(signal, signame),
@@ -121,17 +123,19 @@ class EventBus:
121
123
  """Add sigterm listener."""
122
124
  self._sigterm_listeners.append(target)
123
125
 
124
- def add_output_listener(self, name, target):
126
+ def add_output_listener(self, output_id, group_id, target):
125
127
  """Add output listener."""
126
- self._output_listeners[name] = ListenerJob(target=target)
127
- return self._output_listeners[name]
128
-
128
+ if output_id not in self._output_listeners:
129
+ self._output_listeners[output_id] = {}
130
+ self._output_listeners[output_id][group_id] = ListenerJob(target=target)
131
+ return self._output_listeners[output_id]
132
+
129
133
  def trigger_output_event(self, event):
130
134
  asyncio.create_task(self.async_trigger_output_event(event=event))
131
-
135
+
132
136
  async def async_trigger_output_event(self, event):
133
- listener = self._output_listeners.get(event)
134
- if listener:
137
+ listeners = self._output_listeners.get(event, {})
138
+ for listener in listeners.values():
135
139
  await listener.target(event)
136
140
 
137
141
  def add_haonline_listener(self, target):
@@ -15,7 +15,6 @@ from boneio.const import (
15
15
  DEVICE_CLASS,
16
16
  FILTERS,
17
17
  GPIO,
18
- PCA,
19
18
  ID,
20
19
  INIT_SLEEP,
21
20
  INPUT,
@@ -135,6 +134,8 @@ def create_temp_sensor(
135
134
  else:
136
135
  return
137
136
  name = config.get(ID)
137
+ if not name:
138
+ return
138
139
  id = name.replace(" ", "")
139
140
  try:
140
141
  temp_sensor = TempSensor(