boneIO 1.3.0.dev1__py3-none-any.whl → 1.3.0.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/boards/0.7/output_48_4.yaml +250 -0
- boneio/boards/0.8/output_48_4.yaml +250 -0
- boneio/bonecli.py +43 -15
- boneio/core/cloud/registration.py +41 -31
- boneio/core/config/config_helper.py +13 -0
- boneio/core/config/migrations/__init__.py +8 -0
- boneio/core/config/yaml_util.py +223 -12
- boneio/core/manager/canopen.py +231 -79
- boneio/core/manager/display.py +12 -3
- boneio/core/manager/manager.py +85 -2
- boneio/core/manager/outputs.py +24 -4
- boneio/core/manager/remote.py +41 -33
- boneio/core/manager/sensors.py +149 -5
- boneio/core/remote/__init__.py +0 -31
- boneio/core/remote/can.py +39 -6
- boneio/core/remote/esphome.py +5 -6
- boneio/core/utils/conditions.py +309 -0
- boneio/example_config/48x4/adc.yaml +14 -0
- boneio/example_config/48x4/binary_sensor.yaml +17 -0
- boneio/example_config/48x4/config.yaml +41 -0
- boneio/example_config/48x4/event.yaml +300 -0
- boneio/example_config/48x4/mqtt.yaml +6 -0
- boneio/example_config/48x4/output48x4A.yaml +192 -0
- boneio/example_config/can_master.yaml +1 -0
- boneio/hardware/analog/adc.py +27 -2
- boneio/hardware/can/client.py +208 -65
- boneio/hardware/can/node_id.py +27 -19
- boneio/hardware/can/sudoers.py +199 -0
- boneio/hardware/can/test_od.py +15 -0
- boneio/hardware/display/oled.py +14 -9
- boneio/integration/homeassistant.py +32 -9
- boneio/modbus/coordinator.py +16 -1
- boneio/modbus/devices/sensors/boneio-edge-temp.json +44 -4
- boneio/modbus/entities/base.py +11 -3
- boneio/modbus/entities/derived/numeric.py +5 -3
- boneio/modbus/entities/derived/select.py +19 -0
- boneio/modbus/entities/derived/switch.py +16 -0
- boneio/modbus/entities/derived/text.py +2 -0
- boneio/modbus/entities/sensor/numeric.py +6 -4
- boneio/modbus/entities/sensor/text.py +6 -4
- boneio/modbus/entities/writeable/numeric.py +8 -1
- boneio/runner.py +132 -34
- boneio/schema/actions.yaml +27 -0
- boneio/schema/condition.yaml +75 -0
- boneio/schema/schema.yaml +30 -5
- boneio/version.py +1 -1
- boneio/webui/action_validation.py +205 -0
- boneio/webui/app.py +148 -59
- boneio/webui/frontend-dist/assets/ConfigEditor-BjgbUQCx.js +1 -0
- boneio/webui/frontend-dist/assets/aiWizardPrompt-Cq1L-Rty.js +2 -0
- boneio/webui/frontend-dist/assets/cssMode-DShylJqh.js +4 -0
- boneio/webui/frontend-dist/assets/{freemarker2-Bemoup4X.js → freemarker2-CdX7KyE5.js} +1 -1
- boneio/webui/frontend-dist/assets/handlebars-C3LDizRo.js +1 -0
- boneio/webui/frontend-dist/assets/html-z-YV0Mzh.js +1 -0
- boneio/webui/frontend-dist/assets/htmlMode-D7IIR2va.js +4 -0
- boneio/webui/frontend-dist/assets/index-B4KSgzwj.css +1 -0
- boneio/webui/frontend-dist/assets/index-BIYR1hqR.js +105 -0
- boneio/webui/frontend-dist/assets/javascript-CH6jkTQ0.js +1 -0
- boneio/webui/frontend-dist/assets/{jsonMode-B_TKboJF.js → jsonMode-CLzeI5HJ.js} +1 -1
- boneio/webui/frontend-dist/assets/liquid-DuoI_Tv0.js +1 -0
- boneio/webui/frontend-dist/assets/mdx-C2KSoPE6.js +1 -0
- boneio/webui/frontend-dist/assets/monaco-DVn9mNSL.js +739 -0
- boneio/webui/frontend-dist/assets/monaco-xnhJeWAr.css +1 -0
- boneio/webui/frontend-dist/assets/python-Dh7Kzq6D.js +1 -0
- boneio/webui/frontend-dist/assets/razor-CJwYmOfy.js +1 -0
- boneio/webui/frontend-dist/assets/{tsMode-Deid1skj.js → tsMode-VSMpyycN.js} +1 -1
- boneio/webui/frontend-dist/assets/typescript-C4HjhnfC.js +1 -0
- boneio/webui/frontend-dist/assets/vendor-8TE4Uyqi.js +3 -0
- boneio/webui/frontend-dist/assets/xml-ByUHJiRO.js +1 -0
- boneio/webui/frontend-dist/assets/yaml-CTy8Ej0Q.js +1 -0
- boneio/webui/frontend-dist/index.html +5 -2
- boneio/webui/frontend-dist/schema/adc.schema.json +11 -1
- boneio/webui/frontend-dist/schema/binary_sensor.schema.json +332 -0
- boneio/webui/frontend-dist/schema/boneio.schema.json +20 -0
- boneio/webui/frontend-dist/schema/config.schema.json +1528 -4
- boneio/webui/frontend-dist/schema/event.schema.json +1162 -0
- boneio/webui/frontend-dist/schema/ina219.schema.json +3 -3
- boneio/webui/frontend-dist/sw.js +1 -1
- boneio/webui/routes/can.py +173 -14
- boneio/webui/routes/config.py +141 -14
- boneio/webui/routes/system.py +24 -4
- boneio/webui/routes/update.py +82 -2
- boneio/webui/schema/adc.schema.json +11 -1
- boneio/webui/schema/binary_sensor.schema.json +332 -0
- boneio/webui/schema/boneio.schema.json +20 -0
- boneio/webui/schema/config.schema.json +1528 -4
- boneio/webui/schema/event.schema.json +1162 -0
- boneio/webui/schema/ina219.schema.json +3 -3
- boneio/webui/web_server.py +87 -8
- {boneio-1.3.0.dev1.dist-info → boneio-1.3.0.dev4.dist-info}/METADATA +2 -2
- {boneio-1.3.0.dev1.dist-info → boneio-1.3.0.dev4.dist-info}/RECORD +95 -77
- boneio/webui/frontend-dist/assets/cssMode-DYzYCxj1.js +0 -4
- boneio/webui/frontend-dist/assets/handlebars-3t5vS37H.js +0 -1
- boneio/webui/frontend-dist/assets/html-Cq68Vj92.js +0 -1
- boneio/webui/frontend-dist/assets/htmlMode-zRg51dux.js +0 -4
- boneio/webui/frontend-dist/assets/index-CedvLek6.js +0 -836
- boneio/webui/frontend-dist/assets/index-yfVmKD9N.css +0 -1
- boneio/webui/frontend-dist/assets/javascript-BeqHop1l.js +0 -1
- boneio/webui/frontend-dist/assets/liquid-BK7PsOyv.js +0 -1
- boneio/webui/frontend-dist/assets/mdx-Ckb8-VUx.js +0 -1
- boneio/webui/frontend-dist/assets/python-CO1-gBqF.js +0 -1
- boneio/webui/frontend-dist/assets/razor-Dx6x9ypa.js +0 -1
- boneio/webui/frontend-dist/assets/typescript-JSH4I7cf.js +0 -1
- boneio/webui/frontend-dist/assets/xml-BX_Opm8D.js +0 -1
- boneio/webui/frontend-dist/assets/yaml-BRsnPpO3.js +0 -1
- {boneio-1.3.0.dev1.dist-info → boneio-1.3.0.dev4.dist-info}/WHEEL +0 -0
- {boneio-1.3.0.dev1.dist-info → boneio-1.3.0.dev4.dist-info}/entry_points.txt +0 -0
- {boneio-1.3.0.dev1.dist-info → boneio-1.3.0.dev4.dist-info}/licenses/LICENSE +0 -0
- {boneio-1.3.0.dev1.dist-info → boneio-1.3.0.dev4.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
# Relay board 48x4A v0.7 - DISCONTINUED
|
|
2
|
+
mcp23017:
|
|
3
|
+
- id: mcp_left
|
|
4
|
+
address: 0x20
|
|
5
|
+
- id: mcp_middle
|
|
6
|
+
address: 0x21
|
|
7
|
+
- id: mcp_right
|
|
8
|
+
address: 0x22
|
|
9
|
+
|
|
10
|
+
output_mapping:
|
|
11
|
+
out_01:
|
|
12
|
+
kind: mcp
|
|
13
|
+
mcp_id: mcp_left
|
|
14
|
+
pin: 7
|
|
15
|
+
output_type: light
|
|
16
|
+
out_02:
|
|
17
|
+
kind: mcp
|
|
18
|
+
mcp_id: mcp_left
|
|
19
|
+
pin: 6
|
|
20
|
+
output_type: light
|
|
21
|
+
out_03:
|
|
22
|
+
kind: mcp
|
|
23
|
+
mcp_id: mcp_left
|
|
24
|
+
pin: 5
|
|
25
|
+
output_type: light
|
|
26
|
+
out_04:
|
|
27
|
+
kind: mcp
|
|
28
|
+
mcp_id: mcp_left
|
|
29
|
+
pin: 4
|
|
30
|
+
output_type: light
|
|
31
|
+
out_05:
|
|
32
|
+
kind: mcp
|
|
33
|
+
mcp_id: mcp_left
|
|
34
|
+
pin: 3
|
|
35
|
+
output_type: light
|
|
36
|
+
out_06:
|
|
37
|
+
kind: mcp
|
|
38
|
+
mcp_id: mcp_left
|
|
39
|
+
pin: 2
|
|
40
|
+
output_type: light
|
|
41
|
+
out_07:
|
|
42
|
+
kind: mcp
|
|
43
|
+
mcp_id: mcp_left
|
|
44
|
+
pin: 1
|
|
45
|
+
output_type: light
|
|
46
|
+
out_08:
|
|
47
|
+
kind: mcp
|
|
48
|
+
mcp_id: mcp_left
|
|
49
|
+
pin: 0
|
|
50
|
+
output_type: light
|
|
51
|
+
out_09:
|
|
52
|
+
kind: mcp
|
|
53
|
+
mcp_id: mcp_middle
|
|
54
|
+
pin: 7
|
|
55
|
+
output_type: light
|
|
56
|
+
out_10:
|
|
57
|
+
kind: mcp
|
|
58
|
+
mcp_id: mcp_middle
|
|
59
|
+
pin: 6
|
|
60
|
+
output_type: light
|
|
61
|
+
out_11:
|
|
62
|
+
kind: mcp
|
|
63
|
+
mcp_id: mcp_middle
|
|
64
|
+
pin: 5
|
|
65
|
+
output_type: light
|
|
66
|
+
out_12:
|
|
67
|
+
kind: mcp
|
|
68
|
+
mcp_id: mcp_middle
|
|
69
|
+
pin: 4
|
|
70
|
+
output_type: light
|
|
71
|
+
out_13:
|
|
72
|
+
kind: mcp
|
|
73
|
+
mcp_id: mcp_middle
|
|
74
|
+
pin: 3
|
|
75
|
+
output_type: light
|
|
76
|
+
out_14:
|
|
77
|
+
kind: mcp
|
|
78
|
+
mcp_id: mcp_middle
|
|
79
|
+
pin: 2
|
|
80
|
+
output_type: light
|
|
81
|
+
out_15:
|
|
82
|
+
kind: mcp
|
|
83
|
+
mcp_id: mcp_middle
|
|
84
|
+
pin: 1
|
|
85
|
+
output_type: light
|
|
86
|
+
out_16:
|
|
87
|
+
kind: mcp
|
|
88
|
+
mcp_id: mcp_middle
|
|
89
|
+
pin: 0
|
|
90
|
+
output_type: light
|
|
91
|
+
out_17:
|
|
92
|
+
kind: mcp
|
|
93
|
+
mcp_id: mcp_right
|
|
94
|
+
pin: 7
|
|
95
|
+
output_type: light
|
|
96
|
+
out_18:
|
|
97
|
+
kind: mcp
|
|
98
|
+
mcp_id: mcp_right
|
|
99
|
+
pin: 6
|
|
100
|
+
output_type: light
|
|
101
|
+
out_19:
|
|
102
|
+
kind: mcp
|
|
103
|
+
mcp_id: mcp_right
|
|
104
|
+
pin: 5
|
|
105
|
+
output_type: light
|
|
106
|
+
out_20:
|
|
107
|
+
kind: mcp
|
|
108
|
+
mcp_id: mcp_right
|
|
109
|
+
pin: 4
|
|
110
|
+
output_type: light
|
|
111
|
+
out_21:
|
|
112
|
+
kind: mcp
|
|
113
|
+
mcp_id: mcp_right
|
|
114
|
+
pin: 3
|
|
115
|
+
output_type: light
|
|
116
|
+
out_22:
|
|
117
|
+
kind: mcp
|
|
118
|
+
mcp_id: mcp_right
|
|
119
|
+
pin: 2
|
|
120
|
+
output_type: light
|
|
121
|
+
out_23:
|
|
122
|
+
kind: mcp
|
|
123
|
+
mcp_id: mcp_right
|
|
124
|
+
pin: 1
|
|
125
|
+
output_type: light
|
|
126
|
+
out_24:
|
|
127
|
+
kind: mcp
|
|
128
|
+
mcp_id: mcp_right
|
|
129
|
+
pin: 0
|
|
130
|
+
output_type: light
|
|
131
|
+
out_25:
|
|
132
|
+
kind: mcp
|
|
133
|
+
mcp_id: mcp_left
|
|
134
|
+
pin: 8
|
|
135
|
+
output_type: light
|
|
136
|
+
out_26:
|
|
137
|
+
kind: mcp
|
|
138
|
+
mcp_id: mcp_left
|
|
139
|
+
pin: 9
|
|
140
|
+
output_type: light
|
|
141
|
+
out_27:
|
|
142
|
+
kind: mcp
|
|
143
|
+
mcp_id: mcp_left
|
|
144
|
+
pin: 10
|
|
145
|
+
output_type: light
|
|
146
|
+
out_28:
|
|
147
|
+
kind: mcp
|
|
148
|
+
mcp_id: mcp_left
|
|
149
|
+
pin: 11
|
|
150
|
+
output_type: light
|
|
151
|
+
out_29:
|
|
152
|
+
kind: mcp
|
|
153
|
+
mcp_id: mcp_left
|
|
154
|
+
pin: 12
|
|
155
|
+
output_type: light
|
|
156
|
+
out_30:
|
|
157
|
+
kind: mcp
|
|
158
|
+
mcp_id: mcp_left
|
|
159
|
+
pin: 13
|
|
160
|
+
output_type: light
|
|
161
|
+
out_31:
|
|
162
|
+
kind: mcp
|
|
163
|
+
mcp_id: mcp_left
|
|
164
|
+
pin: 14
|
|
165
|
+
output_type: light
|
|
166
|
+
out_32:
|
|
167
|
+
kind: mcp
|
|
168
|
+
mcp_id: mcp_left
|
|
169
|
+
pin: 15
|
|
170
|
+
output_type: light
|
|
171
|
+
out_33:
|
|
172
|
+
kind: mcp
|
|
173
|
+
mcp_id: mcp_middle
|
|
174
|
+
pin: 8
|
|
175
|
+
output_type: light
|
|
176
|
+
out_34:
|
|
177
|
+
kind: mcp
|
|
178
|
+
mcp_id: mcp_middle
|
|
179
|
+
pin: 9
|
|
180
|
+
output_type: light
|
|
181
|
+
out_35:
|
|
182
|
+
kind: mcp
|
|
183
|
+
mcp_id: mcp_middle
|
|
184
|
+
pin: 10
|
|
185
|
+
output_type: light
|
|
186
|
+
out_36:
|
|
187
|
+
kind: mcp
|
|
188
|
+
mcp_id: mcp_middle
|
|
189
|
+
pin: 11
|
|
190
|
+
output_type: light
|
|
191
|
+
out_37:
|
|
192
|
+
kind: mcp
|
|
193
|
+
mcp_id: mcp_middle
|
|
194
|
+
pin: 12
|
|
195
|
+
output_type: light
|
|
196
|
+
out_38:
|
|
197
|
+
kind: mcp
|
|
198
|
+
mcp_id: mcp_middle
|
|
199
|
+
pin: 13
|
|
200
|
+
output_type: light
|
|
201
|
+
out_39:
|
|
202
|
+
kind: mcp
|
|
203
|
+
mcp_id: mcp_middle
|
|
204
|
+
pin: 14
|
|
205
|
+
output_type: light
|
|
206
|
+
out_40:
|
|
207
|
+
kind: mcp
|
|
208
|
+
mcp_id: mcp_middle
|
|
209
|
+
pin: 15
|
|
210
|
+
output_type: light
|
|
211
|
+
out_41:
|
|
212
|
+
kind: mcp
|
|
213
|
+
mcp_id: mcp_right
|
|
214
|
+
pin: 8
|
|
215
|
+
output_type: light
|
|
216
|
+
out_42:
|
|
217
|
+
kind: mcp
|
|
218
|
+
mcp_id: mcp_right
|
|
219
|
+
pin: 9
|
|
220
|
+
output_type: light
|
|
221
|
+
out_43:
|
|
222
|
+
kind: mcp
|
|
223
|
+
mcp_id: mcp_right
|
|
224
|
+
pin: 10
|
|
225
|
+
output_type: light
|
|
226
|
+
out_44:
|
|
227
|
+
kind: mcp
|
|
228
|
+
mcp_id: mcp_right
|
|
229
|
+
pin: 11
|
|
230
|
+
output_type: light
|
|
231
|
+
out_45:
|
|
232
|
+
kind: mcp
|
|
233
|
+
mcp_id: mcp_right
|
|
234
|
+
pin: 12
|
|
235
|
+
output_type: light
|
|
236
|
+
out_46:
|
|
237
|
+
kind: mcp
|
|
238
|
+
mcp_id: mcp_right
|
|
239
|
+
pin: 13
|
|
240
|
+
output_type: light
|
|
241
|
+
out_47:
|
|
242
|
+
kind: mcp
|
|
243
|
+
mcp_id: mcp_right
|
|
244
|
+
pin: 14
|
|
245
|
+
output_type: light
|
|
246
|
+
out_48:
|
|
247
|
+
kind: mcp
|
|
248
|
+
mcp_id: mcp_right
|
|
249
|
+
pin: 15
|
|
250
|
+
output_type: light
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
# Relay board 48x4A v0.8 - DISCONTINUED
|
|
2
|
+
mcp23017:
|
|
3
|
+
- id: mcp_left
|
|
4
|
+
address: 0x23
|
|
5
|
+
- id: mcp_middle
|
|
6
|
+
address: 0x24
|
|
7
|
+
- id: mcp_right
|
|
8
|
+
address: 0x25
|
|
9
|
+
|
|
10
|
+
output_mapping:
|
|
11
|
+
out_01:
|
|
12
|
+
kind: mcp
|
|
13
|
+
mcp_id: mcp_left
|
|
14
|
+
pin: 7
|
|
15
|
+
output_type: light
|
|
16
|
+
out_02:
|
|
17
|
+
kind: mcp
|
|
18
|
+
mcp_id: mcp_left
|
|
19
|
+
pin: 6
|
|
20
|
+
output_type: light
|
|
21
|
+
out_03:
|
|
22
|
+
kind: mcp
|
|
23
|
+
mcp_id: mcp_left
|
|
24
|
+
pin: 5
|
|
25
|
+
output_type: light
|
|
26
|
+
out_04:
|
|
27
|
+
kind: mcp
|
|
28
|
+
mcp_id: mcp_left
|
|
29
|
+
pin: 4
|
|
30
|
+
output_type: light
|
|
31
|
+
out_05:
|
|
32
|
+
kind: mcp
|
|
33
|
+
mcp_id: mcp_left
|
|
34
|
+
pin: 3
|
|
35
|
+
output_type: light
|
|
36
|
+
out_06:
|
|
37
|
+
kind: mcp
|
|
38
|
+
mcp_id: mcp_left
|
|
39
|
+
pin: 2
|
|
40
|
+
output_type: light
|
|
41
|
+
out_07:
|
|
42
|
+
kind: mcp
|
|
43
|
+
mcp_id: mcp_left
|
|
44
|
+
pin: 1
|
|
45
|
+
output_type: light
|
|
46
|
+
out_08:
|
|
47
|
+
kind: mcp
|
|
48
|
+
mcp_id: mcp_left
|
|
49
|
+
pin: 0
|
|
50
|
+
output_type: light
|
|
51
|
+
out_09:
|
|
52
|
+
kind: mcp
|
|
53
|
+
mcp_id: mcp_middle
|
|
54
|
+
pin: 7
|
|
55
|
+
output_type: light
|
|
56
|
+
out_10:
|
|
57
|
+
kind: mcp
|
|
58
|
+
mcp_id: mcp_middle
|
|
59
|
+
pin: 6
|
|
60
|
+
output_type: light
|
|
61
|
+
out_11:
|
|
62
|
+
kind: mcp
|
|
63
|
+
mcp_id: mcp_middle
|
|
64
|
+
pin: 5
|
|
65
|
+
output_type: light
|
|
66
|
+
out_12:
|
|
67
|
+
kind: mcp
|
|
68
|
+
mcp_id: mcp_middle
|
|
69
|
+
pin: 4
|
|
70
|
+
output_type: light
|
|
71
|
+
out_13:
|
|
72
|
+
kind: mcp
|
|
73
|
+
mcp_id: mcp_middle
|
|
74
|
+
pin: 3
|
|
75
|
+
output_type: light
|
|
76
|
+
out_14:
|
|
77
|
+
kind: mcp
|
|
78
|
+
mcp_id: mcp_middle
|
|
79
|
+
pin: 2
|
|
80
|
+
output_type: light
|
|
81
|
+
out_15:
|
|
82
|
+
kind: mcp
|
|
83
|
+
mcp_id: mcp_middle
|
|
84
|
+
pin: 1
|
|
85
|
+
output_type: light
|
|
86
|
+
out_16:
|
|
87
|
+
kind: mcp
|
|
88
|
+
mcp_id: mcp_middle
|
|
89
|
+
pin: 0
|
|
90
|
+
output_type: light
|
|
91
|
+
out_17:
|
|
92
|
+
kind: mcp
|
|
93
|
+
mcp_id: mcp_right
|
|
94
|
+
pin: 7
|
|
95
|
+
output_type: light
|
|
96
|
+
out_18:
|
|
97
|
+
kind: mcp
|
|
98
|
+
mcp_id: mcp_right
|
|
99
|
+
pin: 6
|
|
100
|
+
output_type: light
|
|
101
|
+
out_19:
|
|
102
|
+
kind: mcp
|
|
103
|
+
mcp_id: mcp_right
|
|
104
|
+
pin: 5
|
|
105
|
+
output_type: light
|
|
106
|
+
out_20:
|
|
107
|
+
kind: mcp
|
|
108
|
+
mcp_id: mcp_right
|
|
109
|
+
pin: 4
|
|
110
|
+
output_type: light
|
|
111
|
+
out_21:
|
|
112
|
+
kind: mcp
|
|
113
|
+
mcp_id: mcp_right
|
|
114
|
+
pin: 3
|
|
115
|
+
output_type: light
|
|
116
|
+
out_22:
|
|
117
|
+
kind: mcp
|
|
118
|
+
mcp_id: mcp_right
|
|
119
|
+
pin: 2
|
|
120
|
+
output_type: light
|
|
121
|
+
out_23:
|
|
122
|
+
kind: mcp
|
|
123
|
+
mcp_id: mcp_right
|
|
124
|
+
pin: 1
|
|
125
|
+
output_type: light
|
|
126
|
+
out_24:
|
|
127
|
+
kind: mcp
|
|
128
|
+
mcp_id: mcp_right
|
|
129
|
+
pin: 0
|
|
130
|
+
output_type: light
|
|
131
|
+
out_25:
|
|
132
|
+
kind: mcp
|
|
133
|
+
mcp_id: mcp_left
|
|
134
|
+
pin: 8
|
|
135
|
+
output_type: light
|
|
136
|
+
out_26:
|
|
137
|
+
kind: mcp
|
|
138
|
+
mcp_id: mcp_left
|
|
139
|
+
pin: 9
|
|
140
|
+
output_type: light
|
|
141
|
+
out_27:
|
|
142
|
+
kind: mcp
|
|
143
|
+
mcp_id: mcp_left
|
|
144
|
+
pin: 10
|
|
145
|
+
output_type: light
|
|
146
|
+
out_28:
|
|
147
|
+
kind: mcp
|
|
148
|
+
mcp_id: mcp_left
|
|
149
|
+
pin: 11
|
|
150
|
+
output_type: light
|
|
151
|
+
out_29:
|
|
152
|
+
kind: mcp
|
|
153
|
+
mcp_id: mcp_left
|
|
154
|
+
pin: 12
|
|
155
|
+
output_type: light
|
|
156
|
+
out_30:
|
|
157
|
+
kind: mcp
|
|
158
|
+
mcp_id: mcp_left
|
|
159
|
+
pin: 13
|
|
160
|
+
output_type: light
|
|
161
|
+
out_31:
|
|
162
|
+
kind: mcp
|
|
163
|
+
mcp_id: mcp_left
|
|
164
|
+
pin: 14
|
|
165
|
+
output_type: light
|
|
166
|
+
out_32:
|
|
167
|
+
kind: mcp
|
|
168
|
+
mcp_id: mcp_left
|
|
169
|
+
pin: 15
|
|
170
|
+
output_type: light
|
|
171
|
+
out_33:
|
|
172
|
+
kind: mcp
|
|
173
|
+
mcp_id: mcp_middle
|
|
174
|
+
pin: 8
|
|
175
|
+
output_type: light
|
|
176
|
+
out_34:
|
|
177
|
+
kind: mcp
|
|
178
|
+
mcp_id: mcp_middle
|
|
179
|
+
pin: 9
|
|
180
|
+
output_type: light
|
|
181
|
+
out_35:
|
|
182
|
+
kind: mcp
|
|
183
|
+
mcp_id: mcp_middle
|
|
184
|
+
pin: 10
|
|
185
|
+
output_type: light
|
|
186
|
+
out_36:
|
|
187
|
+
kind: mcp
|
|
188
|
+
mcp_id: mcp_middle
|
|
189
|
+
pin: 11
|
|
190
|
+
output_type: light
|
|
191
|
+
out_37:
|
|
192
|
+
kind: mcp
|
|
193
|
+
mcp_id: mcp_middle
|
|
194
|
+
pin: 12
|
|
195
|
+
output_type: light
|
|
196
|
+
out_38:
|
|
197
|
+
kind: mcp
|
|
198
|
+
mcp_id: mcp_middle
|
|
199
|
+
pin: 13
|
|
200
|
+
output_type: light
|
|
201
|
+
out_39:
|
|
202
|
+
kind: mcp
|
|
203
|
+
mcp_id: mcp_middle
|
|
204
|
+
pin: 14
|
|
205
|
+
output_type: light
|
|
206
|
+
out_40:
|
|
207
|
+
kind: mcp
|
|
208
|
+
mcp_id: mcp_middle
|
|
209
|
+
pin: 15
|
|
210
|
+
output_type: light
|
|
211
|
+
out_41:
|
|
212
|
+
kind: mcp
|
|
213
|
+
mcp_id: mcp_right
|
|
214
|
+
pin: 8
|
|
215
|
+
output_type: light
|
|
216
|
+
out_42:
|
|
217
|
+
kind: mcp
|
|
218
|
+
mcp_id: mcp_right
|
|
219
|
+
pin: 9
|
|
220
|
+
output_type: light
|
|
221
|
+
out_43:
|
|
222
|
+
kind: mcp
|
|
223
|
+
mcp_id: mcp_right
|
|
224
|
+
pin: 10
|
|
225
|
+
output_type: light
|
|
226
|
+
out_44:
|
|
227
|
+
kind: mcp
|
|
228
|
+
mcp_id: mcp_right
|
|
229
|
+
pin: 11
|
|
230
|
+
output_type: light
|
|
231
|
+
out_45:
|
|
232
|
+
kind: mcp
|
|
233
|
+
mcp_id: mcp_right
|
|
234
|
+
pin: 12
|
|
235
|
+
output_type: light
|
|
236
|
+
out_46:
|
|
237
|
+
kind: mcp
|
|
238
|
+
mcp_id: mcp_right
|
|
239
|
+
pin: 13
|
|
240
|
+
output_type: light
|
|
241
|
+
out_47:
|
|
242
|
+
kind: mcp
|
|
243
|
+
mcp_id: mcp_right
|
|
244
|
+
pin: 14
|
|
245
|
+
output_type: light
|
|
246
|
+
out_48:
|
|
247
|
+
kind: mcp
|
|
248
|
+
mcp_id: mcp_right
|
|
249
|
+
pin: 15
|
|
250
|
+
output_type: light
|
boneio/bonecli.py
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
import time as _boot_time
|
|
6
|
+
_BOOT_T0 = _boot_time.monotonic()
|
|
7
|
+
|
|
5
8
|
import logging
|
|
6
9
|
import os
|
|
7
10
|
|
|
@@ -11,21 +14,13 @@ import argparse
|
|
|
11
14
|
import asyncio
|
|
12
15
|
import sys
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
print(f"[BOOT TIMING] stdlib imports: {_boot_time.monotonic() - _BOOT_T0:.2f}s", flush=True)
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
from boneio.core.utils.logger import configure_logger, setup_logging
|
|
20
|
-
from boneio.exceptions import (
|
|
21
|
-
ConfigurationException,
|
|
22
|
-
RestartRequestException,
|
|
23
|
-
)
|
|
24
|
-
# Lazy import modbus CLI to save ~0.35s on startup for 'run' command
|
|
25
|
-
# from boneio.modbus.cli import async_run_modbus_get, async_run_modbus_search, async_run_modbus_set
|
|
26
|
-
# from boneio.modbus.client import VALUE_TYPES
|
|
27
|
-
from boneio.runner import async_run
|
|
19
|
+
# All boneio imports are lazy (inside run/run_modbus_command) to minimize
|
|
20
|
+
# startup time. Only version is imported here for --version CLI flag.
|
|
21
|
+
_t_ver = _boot_time.monotonic()
|
|
28
22
|
from boneio.version import __version__
|
|
23
|
+
print(f"[BOOT TIMING] ALL imports: {_boot_time.monotonic() - _BOOT_T0:.2f}s", flush=True)
|
|
29
24
|
|
|
30
25
|
TASK_CANCELATION_TIMEOUT = 1
|
|
31
26
|
|
|
@@ -34,6 +29,7 @@ _LOGGER = logging.getLogger(__name__)
|
|
|
34
29
|
|
|
35
30
|
def get_arguments() -> argparse.Namespace:
|
|
36
31
|
"""Get parsed passed in arguments."""
|
|
32
|
+
from boneio.const import ACTION
|
|
37
33
|
|
|
38
34
|
parser = argparse.ArgumentParser(
|
|
39
35
|
description="boneIO app for BeagleBone Black.",
|
|
@@ -208,14 +204,44 @@ def run(
|
|
|
208
204
|
config: str, debug: int, mqttusername: str = "", mqttpassword: str = ""
|
|
209
205
|
) -> int:
|
|
210
206
|
"""Run BoneIO."""
|
|
207
|
+
import time as _time
|
|
208
|
+
from yaml import MarkedYAMLError
|
|
209
|
+
from boneio.core.config import load_config_from_file
|
|
210
|
+
from boneio.core.events import GracefulExit
|
|
211
|
+
from boneio.core.utils.logger import configure_logger, setup_logging
|
|
212
|
+
from boneio.exceptions import ConfigurationException
|
|
213
|
+
_t0 = _time.monotonic()
|
|
211
214
|
setup_logging(debug_level=debug)
|
|
212
215
|
_LOGGER.info("BoneIO %s starting.", __version__)
|
|
216
|
+
_LOGGER.debug("[STARTUP TIMING] after setup_logging: %.2fs", _time.monotonic() - _t0)
|
|
213
217
|
try:
|
|
218
|
+
_t1 = _time.monotonic()
|
|
214
219
|
_config = load_config_from_file(config_file=config)
|
|
220
|
+
_LOGGER.debug("[STARTUP TIMING] load_config_from_file: %.2fs", _time.monotonic() - _t1)
|
|
215
221
|
if not _config:
|
|
216
222
|
_LOGGER.error("Config not loaded. Exiting.")
|
|
217
223
|
return 1
|
|
218
224
|
configure_logger(log_config=_config.get("logger") or {}, debug=debug)
|
|
225
|
+
# Granular timing of runner sub-imports to find the bottleneck
|
|
226
|
+
_t_a = _time.monotonic()
|
|
227
|
+
from boneio.const import ACTION
|
|
228
|
+
_LOGGER.debug("[RUNNER IMPORT] boneio.const: %.2fs", _time.monotonic() - _t_a)
|
|
229
|
+
_t_a = _time.monotonic()
|
|
230
|
+
from boneio.core.cloud import CloudRegistration
|
|
231
|
+
_LOGGER.debug("[RUNNER IMPORT] boneio.core.cloud: %.2fs", _time.monotonic() - _t_a)
|
|
232
|
+
_t_a = _time.monotonic()
|
|
233
|
+
from boneio.core.manager import Manager
|
|
234
|
+
_LOGGER.debug("[RUNNER IMPORT] boneio.core.manager: %.2fs", _time.monotonic() - _t_a)
|
|
235
|
+
_t_a = _time.monotonic()
|
|
236
|
+
from boneio.core.messaging import MQTTClient
|
|
237
|
+
_LOGGER.debug("[RUNNER IMPORT] boneio.core.messaging: %.2fs", _time.monotonic() - _t_a)
|
|
238
|
+
_t_a = _time.monotonic()
|
|
239
|
+
from boneio.hardware.gpio.input import get_gpio_manager
|
|
240
|
+
_LOGGER.debug("[RUNNER IMPORT] boneio.hardware.gpio.input: %.2fs", _time.monotonic() - _t_a)
|
|
241
|
+
_t_a = _time.monotonic()
|
|
242
|
+
from boneio.runner import async_run
|
|
243
|
+
_LOGGER.debug("[RUNNER IMPORT] boneio.runner (rest): %.2fs", _time.monotonic() - _t_a)
|
|
244
|
+
_LOGGER.debug("[STARTUP TIMING] total before async_run: %.2fs", _time.monotonic() - _t0)
|
|
219
245
|
ret = asyncio.run(
|
|
220
246
|
async_run(
|
|
221
247
|
config=_config,
|
|
@@ -241,13 +267,15 @@ def run_modbus_command(
|
|
|
241
267
|
args: argparse.Namespace,
|
|
242
268
|
) -> int:
|
|
243
269
|
"""Run BoneIO."""
|
|
244
|
-
|
|
270
|
+
from yaml import MarkedYAMLError
|
|
271
|
+
from boneio.core.events import GracefulExit
|
|
272
|
+
from boneio.core.utils.logger import configure_logger, setup_logging
|
|
273
|
+
from boneio.exceptions import ConfigurationException, RestartRequestException
|
|
245
274
|
from boneio.modbus.cli import (
|
|
246
275
|
async_run_modbus_get,
|
|
247
276
|
async_run_modbus_search,
|
|
248
277
|
async_run_modbus_set,
|
|
249
278
|
)
|
|
250
|
-
|
|
251
279
|
setup_logging(debug_level=args.debug)
|
|
252
280
|
_LOGGER.info("BoneIO %s starting.", __version__)
|
|
253
281
|
try:
|