@switchbot/homebridge-switchbot 0.1.2-beta.7 → 0.2.0-alpha.1

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 (106) hide show
  1. package/.github/ISSUE_TEMPLATE/feature-request.yml +1 -1
  2. package/.github/dependabot.yml +2 -0
  3. package/.github/workflows/codeql-analysis.yml +71 -0
  4. package/CHANGELOG.md +5 -1
  5. package/README.md +2 -1
  6. package/config.schema.json +420 -471
  7. package/dist/devices/bots.d.ts +19 -5
  8. package/dist/devices/bots.d.ts.map +1 -1
  9. package/dist/devices/bots.js +172 -148
  10. package/dist/devices/bots.js.map +1 -1
  11. package/dist/devices/bulb.d.ts +8 -6
  12. package/dist/devices/bulb.d.ts.map +1 -1
  13. package/dist/devices/bulb.js +45 -28
  14. package/dist/devices/bulb.js.map +1 -1
  15. package/dist/devices/contact.d.ts +10 -5
  16. package/dist/devices/contact.d.ts.map +1 -1
  17. package/dist/devices/contact.js +94 -63
  18. package/dist/devices/contact.js.map +1 -1
  19. package/dist/devices/curtains.d.ts +14 -5
  20. package/dist/devices/curtains.d.ts.map +1 -1
  21. package/dist/devices/curtains.js +174 -120
  22. package/dist/devices/curtains.js.map +1 -1
  23. package/dist/devices/humidifiers.d.ts +6 -6
  24. package/dist/devices/humidifiers.d.ts.map +1 -1
  25. package/dist/devices/humidifiers.js +78 -94
  26. package/dist/devices/humidifiers.js.map +1 -1
  27. package/dist/devices/indoorcam.d.ts +43 -0
  28. package/dist/devices/indoorcam.d.ts.map +1 -0
  29. package/dist/devices/indoorcam.js +241 -0
  30. package/dist/devices/indoorcam.js.map +1 -0
  31. package/dist/devices/meters.d.ts +8 -5
  32. package/dist/devices/meters.d.ts.map +1 -1
  33. package/dist/devices/meters.js +126 -92
  34. package/dist/devices/meters.js.map +1 -1
  35. package/dist/devices/motion.d.ts +9 -5
  36. package/dist/devices/motion.d.ts.map +1 -1
  37. package/dist/devices/motion.js +74 -59
  38. package/dist/devices/motion.js.map +1 -1
  39. package/dist/devices/plugs.d.ts +5 -4
  40. package/dist/devices/plugs.d.ts.map +1 -1
  41. package/dist/devices/plugs.js +65 -56
  42. package/dist/devices/plugs.js.map +1 -1
  43. package/dist/irdevices/airconditioners.d.ts +3 -3
  44. package/dist/irdevices/airconditioners.d.ts.map +1 -1
  45. package/dist/irdevices/airconditioners.js +12 -7
  46. package/dist/irdevices/airconditioners.js.map +1 -1
  47. package/dist/irdevices/airpurifiers.d.ts +3 -3
  48. package/dist/irdevices/airpurifiers.d.ts.map +1 -1
  49. package/dist/irdevices/airpurifiers.js +1 -1
  50. package/dist/irdevices/airpurifiers.js.map +1 -1
  51. package/dist/irdevices/cameras.d.ts +3 -3
  52. package/dist/irdevices/cameras.d.ts.map +1 -1
  53. package/dist/irdevices/cameras.js +1 -1
  54. package/dist/irdevices/cameras.js.map +1 -1
  55. package/dist/irdevices/fans.d.ts +3 -3
  56. package/dist/irdevices/fans.d.ts.map +1 -1
  57. package/dist/irdevices/fans.js +11 -12
  58. package/dist/irdevices/fans.js.map +1 -1
  59. package/dist/irdevices/lights.d.ts +3 -3
  60. package/dist/irdevices/lights.d.ts.map +1 -1
  61. package/dist/irdevices/lights.js +1 -1
  62. package/dist/irdevices/lights.js.map +1 -1
  63. package/dist/irdevices/others.d.ts +3 -3
  64. package/dist/irdevices/others.d.ts.map +1 -1
  65. package/dist/irdevices/others.js +8 -8
  66. package/dist/irdevices/others.js.map +1 -1
  67. package/dist/irdevices/tvs.d.ts +3 -3
  68. package/dist/irdevices/tvs.d.ts.map +1 -1
  69. package/dist/irdevices/tvs.js +16 -6
  70. package/dist/irdevices/tvs.js.map +1 -1
  71. package/dist/irdevices/vacuumcleaners.d.ts +3 -3
  72. package/dist/irdevices/vacuumcleaners.d.ts.map +1 -1
  73. package/dist/irdevices/vacuumcleaners.js +2 -3
  74. package/dist/irdevices/vacuumcleaners.js.map +1 -1
  75. package/dist/irdevices/waterheaters.d.ts +3 -3
  76. package/dist/irdevices/waterheaters.d.ts.map +1 -1
  77. package/dist/irdevices/waterheaters.js +2 -2
  78. package/dist/irdevices/waterheaters.js.map +1 -1
  79. package/dist/platform.d.ts +14 -5
  80. package/dist/platform.d.ts.map +1 -1
  81. package/dist/platform.js +420 -418
  82. package/dist/platform.js.map +1 -1
  83. package/dist/settings.d.ts +18 -15
  84. package/dist/settings.d.ts.map +1 -1
  85. package/package.json +65 -65
  86. package/src/devices/bots.ts +188 -165
  87. package/src/devices/bulb.ts +48 -40
  88. package/src/devices/contact.ts +100 -73
  89. package/src/devices/curtains.ts +192 -140
  90. package/src/devices/humidifiers.ts +82 -124
  91. package/src/devices/indoorcam.ts +303 -0
  92. package/src/devices/meters.ts +130 -110
  93. package/src/devices/motion.ts +80 -69
  94. package/src/devices/plugs.ts +67 -65
  95. package/src/irdevices/airconditioners.ts +14 -10
  96. package/src/irdevices/airpurifiers.ts +4 -4
  97. package/src/irdevices/cameras.ts +4 -4
  98. package/src/irdevices/fans.ts +14 -18
  99. package/src/irdevices/lights.ts +4 -4
  100. package/src/irdevices/others.ts +12 -14
  101. package/src/irdevices/tvs.ts +21 -10
  102. package/src/irdevices/vacuumcleaners.ts +5 -9
  103. package/src/irdevices/waterheaters.ts +5 -5
  104. package/src/platform.ts +455 -619
  105. package/src/settings.ts +19 -15
  106. package/.github/workflows/issue-validate.yml +0 -18
@@ -20,7 +20,10 @@
20
20
  "openToken": {
21
21
  "title": "Token",
22
22
  "type": "string",
23
- "required": true
23
+ "required": true,
24
+ "x-schema-form": {
25
+ "type": "password"
26
+ }
24
27
  },
25
28
  "notice": {
26
29
  "title": "Notice",
@@ -32,7 +35,354 @@
32
35
  },
33
36
  "options": {
34
37
  "type": "object",
38
+ "required": false,
35
39
  "properties": {
40
+ "devices": {
41
+ "type": "array",
42
+ "items": {
43
+ "title": "Devices",
44
+ "type": "object",
45
+ "properties": {
46
+ "type": {
47
+ "title": "Device Type",
48
+ "type": "string",
49
+ "required": true,
50
+ "oneOf": [
51
+ {
52
+ "title": "Bot",
53
+ "enum": [
54
+ "Bot"
55
+ ]
56
+ },
57
+ {
58
+ "title": "Meter",
59
+ "enum": [
60
+ "Meter"
61
+ ]
62
+ },
63
+ {
64
+ "title": "Humidifier",
65
+ "enum": [
66
+ "Humidifier"
67
+ ]
68
+ },
69
+ {
70
+ "title": "Curtain",
71
+ "enum": [
72
+ "Curtain"
73
+ ]
74
+ },
75
+ {
76
+ "title": "Bulb",
77
+ "enum": [
78
+ "Fan"
79
+ ]
80
+ },
81
+ {
82
+ "title": "IR Fan",
83
+ "enum": [
84
+ "Fan"
85
+ ]
86
+ },
87
+ {
88
+ "title": "DIY IR Fan",
89
+ "enum": [
90
+ "DIY Fan"
91
+ ]
92
+ },
93
+ {
94
+ "title": "IR Air Conditioner",
95
+ "enum": [
96
+ "Air Conditioner"
97
+ ]
98
+ },
99
+ {
100
+ "title": "DIY IR Air Conditioner",
101
+ "enum": [
102
+ "DIY Air Conditioner"
103
+ ]
104
+ },
105
+ {
106
+ "title": "Others",
107
+ "enum": [
108
+ "Others"
109
+ ]
110
+ }
111
+ ]
112
+ },
113
+ "deviceId": {
114
+ "title": "Device ID",
115
+ "type": "string",
116
+ "required": true,
117
+ "placeholder": "81F3UT59513F",
118
+ "condition": {
119
+ "functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].type);"
120
+ }
121
+ },
122
+ "hide_device": {
123
+ "title": "Hide Device",
124
+ "type": "boolean",
125
+ "condition": {
126
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].ble && model.options.devices[arrayIndices].type && model.options.devices[arrayIndices].deviceId);"
127
+ }
128
+ },
129
+ "ble": {
130
+ "title": "Enable BLE Connection",
131
+ "type": "boolean",
132
+ "required": true,
133
+ "condition": {
134
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].type && model.options.devices[arrayIndices].deviceId);"
135
+ }
136
+ },
137
+ "bot": {
138
+ "type": "object",
139
+ "properties": {
140
+ "mode": {
141
+ "title": "Mode",
142
+ "type": "string",
143
+ "oneOf": [
144
+ {
145
+ "title": "Press",
146
+ "enum": [
147
+ "press"
148
+ ]
149
+ },
150
+ {
151
+ "title": "Switch",
152
+ "enum": [
153
+ "switch"
154
+ ]
155
+ }
156
+ ],
157
+ "condition": {
158
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].type === 'Bot' && model.options.devices[arrayIndices].deviceId);"
159
+ }
160
+ },
161
+ "switch": {
162
+ "title": "Display as Switch",
163
+ "type": "boolean",
164
+ "description": "This allows you to display bot as a switch.",
165
+ "condition": {
166
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].type === 'Bot' && model.options.devices[arrayIndices].deviceId && model.options.devices[arrayIndices].bot && model.options.devices[arrayIndices].bot.mode);"
167
+ }
168
+ }
169
+ }
170
+ },
171
+ "meter": {
172
+ "type": "object",
173
+ "properties": {
174
+ "hide_temperature": {
175
+ "title": "Hide Meter's Temperature Sensor",
176
+ "type": "boolean",
177
+ "condition": {
178
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].type === 'Meter' && model.options.devices[arrayIndices].deviceId);"
179
+ }
180
+ },
181
+ "hide_humidity": {
182
+ "title": "Hide Meter's Humidity Sensor",
183
+ "type": "boolean",
184
+ "condition": {
185
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].type === 'Meter' && model.options.devices[arrayIndices].deviceId);"
186
+ }
187
+ },
188
+ "unit": {
189
+ "title": "Convert your Meter's Temperature to Celsius or Fahrenheit",
190
+ "type": "number",
191
+ "oneOf": [
192
+ {
193
+ "title": "Celsius",
194
+ "enum": [
195
+ 0
196
+ ]
197
+ },
198
+ {
199
+ "title": "Fahrenheit",
200
+ "enum": [
201
+ 1
202
+ ]
203
+ }
204
+ ],
205
+ "required": false,
206
+ "condition": {
207
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].type === 'Meter' && model.options.devices[arrayIndices].deviceId && model.options.devices[arrayIndices].meter && !model.options.devices[arrayIndices].meter.hide_temperature);"
208
+ }
209
+ }
210
+ }
211
+ },
212
+ "humidifier": {
213
+ "type": "object",
214
+ "properties": {
215
+ "hide_temperature": {
216
+ "title": "Hide Humidifier's Temperature Sensor",
217
+ "type": "boolean",
218
+ "condition": {
219
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].type === 'Humidifier' && model.options.devices[arrayIndices].deviceId);"
220
+ }
221
+ },
222
+ "set_minStep": {
223
+ "title": "Set Min Step",
224
+ "type": "number",
225
+ "placeholder": "1",
226
+ "condition": {
227
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].type === 'Humidifier' && model.options.devices[arrayIndices].deviceId);"
228
+ }
229
+ }
230
+ }
231
+ },
232
+ "curtain": {
233
+ "type": "object",
234
+ "properties": {
235
+ "disable_group": {
236
+ "title": "Disable Grouping",
237
+ "type": "boolean",
238
+ "condition": {
239
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].type === 'Curtain' && model.options.devices[arrayIndices].deviceId);"
240
+ }
241
+ },
242
+ "refreshRate": {
243
+ "title": "Refresh Rate",
244
+ "type": "number",
245
+ "minimum": 1,
246
+ "placeholder": 5,
247
+ "description": "Indicates the number of seconds between before refreshing Curtain status while updating slide progress.",
248
+ "condition": {
249
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].type === 'Curtain' && model.options.devices[arrayIndices].deviceId);"
250
+ }
251
+ },
252
+ "set_minStep": {
253
+ "title": "Set Min Step",
254
+ "type": "number",
255
+ "placeholder": "1",
256
+ "condition": {
257
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].type === 'Curtain' && model.options.devices[arrayIndices].deviceId);"
258
+ }
259
+ },
260
+ "set_min": {
261
+ "title": "Set Min",
262
+ "type": "number",
263
+ "placeholder": "0",
264
+ "condition": {
265
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].type === 'Curtain' && model.options.devices[arrayIndices].deviceId);"
266
+ }
267
+ },
268
+ "set_max": {
269
+ "title": "Set Max",
270
+ "type": "number",
271
+ "placeholder": "100",
272
+ "condition": {
273
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].type === 'Curtain' && model.options.devices[arrayIndices].deviceId);"
274
+ }
275
+ }
276
+ }
277
+ },
278
+ "bulb": {
279
+ "type": "object",
280
+ "properties": {
281
+ "set_minStep": {
282
+ "title": "Set Min Step",
283
+ "type": "number",
284
+ "placeholder": "1",
285
+ "condition": {
286
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].type === 'Bulb' && model.options.devices[arrayIndices].deviceId);"
287
+ }
288
+ }
289
+ }
290
+ },
291
+ "fan": {
292
+ "type": "object",
293
+ "properties": {
294
+ "swing_mode": {
295
+ "title": "Enable Swing Mode by Device ID",
296
+ "type": "boolean",
297
+ "condition": {
298
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].type === 'Fan' || model.options.devices[arrayIndices].type === 'DIY Fan') && model.options.devices[arrayIndices].deviceId);"
299
+ }
300
+ },
301
+ "rotation_speed": {
302
+ "title": "Enable Rotation Speed by Device ID",
303
+ "type": "boolean",
304
+ "condition": {
305
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].type === 'Fan' || model.options.devices[arrayIndices].type === 'DIY Fan') && model.options.devices[arrayIndices].deviceId);"
306
+ }
307
+ },
308
+ "set_minStep": {
309
+ "title": "Set Min Step",
310
+ "type": "number",
311
+ "placeholder": "1",
312
+ "condition": {
313
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].type === 'Fan' || model.options.devices[arrayIndices].type === 'DIY Fan') && model.options.devices[arrayIndices].deviceId && model.options.devices[arrayIndices].fan && !model.options.devices[arrayIndices].meter.rotation_speed);"
314
+ }
315
+ },
316
+ "set_min": {
317
+ "title": "Set Min",
318
+ "type": "number",
319
+ "placeholder": "0",
320
+ "condition": {
321
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].type === 'Fan' || model.options.devices[arrayIndices].type === 'DIY Fan') && model.options.devices[arrayIndices].deviceId && model.options.devices[arrayIndices].fan && !model.options.devices[arrayIndices].meter.rotation_speed);"
322
+ }
323
+ },
324
+ "set_max": {
325
+ "title": "Set Max",
326
+ "type": "number",
327
+ "placeholder": "100",
328
+ "condition": {
329
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].type === 'Fan' || model.options.devices[arrayIndices].type === 'DIY Fan') && model.options.devices[arrayIndices].deviceId && model.options.devices[arrayIndices].fan && !model.options.devices[arrayIndices].meter.rotation_speed);"
330
+ }
331
+ }
332
+ }
333
+ },
334
+ "irair": {
335
+ "type": "object",
336
+ "properties": {
337
+ "hide_automode": {
338
+ "title": "Hide Auto Mode on IR Air Conditioners",
339
+ "type": "boolean",
340
+ "condition": {
341
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].type === 'Air Conditioner' || model.options.devices[arrayIndices].type === 'DIY Air Conditioner') && model.options.devices[arrayIndices].deviceId);"
342
+ }
343
+ }
344
+ }
345
+ },
346
+ "other": {
347
+ "type": "object",
348
+ "properties": {
349
+ "deviceType": {
350
+ "title": "What Type of Device do you want to display in the Home App?",
351
+ "type": "string",
352
+ "oneOf": [
353
+ {
354
+ "title": "Fan",
355
+ "enum": [
356
+ "Fan"
357
+ ]
358
+ }
359
+ ],
360
+ "required": false,
361
+ "condition": {
362
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].type === 'Others' && model.options.devices[arrayIndices].deviceId);"
363
+ }
364
+ },
365
+ "commandOn": {
366
+ "title": "Command sent to turn On Device.",
367
+ "type": "string",
368
+ "placeholder": "On",
369
+ "condition": {
370
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].type === 'Others' && model.options.devices[arrayIndices].deviceId && model.options.devices[arrayIndices].other && model.options.devices[arrayIndices].other.deviceType);"
371
+ }
372
+ },
373
+ "commandOff": {
374
+ "title": "Command sent to turn Off Device.",
375
+ "type": "string",
376
+ "placeholder": "Off",
377
+ "condition": {
378
+ "functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].type === 'Others' && model.options.devices[arrayIndices].deviceId && model.options.devices[arrayIndices].other && !model.options.devices[arrayIndices].other.deviceType);"
379
+ }
380
+ }
381
+ }
382
+ }
383
+ }
384
+ }
385
+ },
36
386
  "refreshRate": {
37
387
  "title": "Refresh Rate",
38
388
  "type": "number",
@@ -47,211 +397,26 @@
47
397
  "description": "Indicates the number of seconds between pushes to SwitchBot API."
48
398
  },
49
399
  "debug": {
50
- "title": "Debug",
51
- "type": "boolean",
52
- "description": "Turn plugin's debug mode on."
53
- },
54
- "ble": {
55
- "title": "Enable BLE Device",
56
- "type": "array",
57
- "items": {
58
- "type": "string"
59
- }
60
- },
61
- "hide_device": {
62
- "title": "Hide Device",
63
- "type": "array",
64
- "items": {
65
- "type": "string"
66
- }
67
- },
68
- "bot": {
69
- "type": "object",
70
- "properties": {
71
- "device_switch": {
72
- "title": "Switch Mode Bots",
73
- "type": "array",
74
- "items": {
75
- "type": "string"
76
- }
77
- },
78
- "device_press": {
79
- "title": "Press Mode Bots",
80
- "type": "array",
81
- "items": {
82
- "type": "string"
83
- }
84
- },
85
- "switch": {
86
- "title": "Display as Switch",
87
- "type": "boolean",
88
- "description": "This allows you to display bot as a switch."
89
- }
90
- }
91
- },
92
- "meter": {
93
- "type": "object",
94
- "properties": {
95
- "hide_temperature": {
96
- "title": "Hide Meter's Temperature Sensor",
97
- "type": "boolean"
98
- },
99
- "hide_humidity": {
100
- "title": "Hide Meter's Humidity Sensor",
101
- "type": "boolean"
102
- },
103
- "unit": {
104
- "title": "Convert your Meter's Temperature to Celsius or Fahrenheit",
105
- "type": "number",
106
- "oneOf": [
107
- {
108
- "title": "Celsius",
109
- "enum": [
110
- 0
111
- ]
112
- },
113
- {
114
- "title": "Fahrenheit",
115
- "enum": [
116
- 1
117
- ]
118
- }
119
- ],
120
- "required": false
121
- }
122
- }
123
- },
124
- "humidifier": {
125
- "type": "object",
126
- "properties": {
127
- "hide_temperature": {
128
- "title": "Hide Humidifier's Temperature Sensor",
129
- "type": "boolean"
130
- },
131
- "set_minStep": {
132
- "title": "Set Min Step",
133
- "type": "number",
134
- "placeholder": "1"
135
- }
136
- }
137
- },
138
- "curtain": {
139
- "type": "object",
140
- "properties": {
141
- "disable_group": {
142
- "title": "Disable Grouping",
143
- "type": "boolean"
144
- },
145
- "refreshRate": {
146
- "title": "Refresh Rate",
147
- "type": "number",
148
- "minimum": 1,
149
- "placeholder": 5,
150
- "description": "Indicates the number of seconds between before refreshing Curtain status while updating slide progress."
151
- },
152
- "set_minStep": {
153
- "title": "Set Min Step",
154
- "type": "number",
155
- "placeholder": "1"
156
- },
157
- "set_min": {
158
- "title": "Set Min",
159
- "type": "number",
160
- "placeholder": "0"
161
- },
162
- "set_max": {
163
- "title": "Set Max",
164
- "type": "number",
165
- "placeholder": "100"
166
- }
167
- }
168
- },
169
- "bulb": {
170
- "type": "object",
171
- "properties": {
172
- "set_minStep": {
173
- "title": "Set Min Step",
174
- "type": "number",
175
- "placeholder": "1"
176
- }
177
- }
178
- },
179
- "fan": {
180
- "type": "object",
181
- "properties": {
182
- "swing_mode": {
183
- "title": "Enable Swing Mode by Device ID",
184
- "type": "array",
185
- "items": {
186
- "type": "string"
187
- }
188
- },
189
- "rotation_speed": {
190
- "title": "Enable Rotation Speed by Device ID",
191
- "type": "array",
192
- "items": {
193
- "type": "string"
194
- }
195
- },
196
- "set_minStep": {
197
- "title": "Set Min Step",
198
- "type": "number",
199
- "placeholder": "1"
200
- },
201
- "set_min": {
202
- "title": "Set Min",
203
- "type": "number",
204
- "placeholder": "0"
205
- },
206
- "set_max": {
207
- "title": "Set Max",
208
- "type": "number",
209
- "placeholder": "100"
210
- }
211
- }
212
- },
213
- "irair": {
214
- "type": "object",
215
- "properties": {
216
- "hide_automode": {
217
- "title": "Hide Auto Mode on IR Air Conditioners",
218
- "type": "boolean"
219
- }
220
- }
221
- },
222
- "other": {
223
- "type": "object",
224
- "properties": {
225
- "deviceType": {
226
- "title": "What Type of Device do you want to display in the Home App?",
227
- "type": "string",
228
- "oneOf": [
229
- {
230
- "title": "Fan",
231
- "enum": [
232
- "Fan"
233
- ]
234
- }
235
- ],
236
- "required": false
237
- },
238
- "commandOn": {
239
- "title": "Command sent to turn On Device.",
240
- "type": "string",
241
- "placeholder": "On"
400
+ "title": "Logging Setting",
401
+ "type": "string",
402
+ "description": "Enble 'Device' or 'Debug' logging.",
403
+ "oneOf": [
404
+ {
405
+ "title": "Enable Debug Logging",
406
+ "enum": [
407
+ "debug"
408
+ ]
242
409
  },
243
- "commandOff": {
244
- "title": "Command sent to turn Off Device.",
245
- "type": "string",
246
- "placeholder": "Off"
410
+ {
411
+ "title": "Enable Device Logging",
412
+ "enum": [
413
+ "device"
414
+ ]
247
415
  }
248
- }
416
+ ],
417
+ "required": false
249
418
  }
250
419
  }
251
- },
252
- "devicediscovery": {
253
- "name": "Device Discovery",
254
- "type": "boolean"
255
420
  }
256
421
  }
257
422
  },
@@ -262,7 +427,6 @@
262
427
  "expandable": true,
263
428
  "expanded": false,
264
429
  "items": [
265
- "name",
266
430
  "credentials.openToken"
267
431
  ]
268
432
  },
@@ -273,284 +437,69 @@
273
437
  "expanded": false,
274
438
  "items": [
275
439
  {
276
- "type": "help",
277
- "helpvalue": "<h5>Refresh Rate</h5><em class='primary-text'>Refresh Rate indicates the number of seconds between polls of SwitchBot API.</em>"
278
- },
279
- {
280
- "key": "options.refreshRate",
281
- "notitle": true
282
- },
283
- {
284
- "type": "help",
285
- "helpvalue": "<h5>Push Rate</h5><em class='primary-text'>Push Rate indicates the number of seconds between pushes to SwitchBot API, Currently only for Curtains.</em>"
286
- },
287
- {
288
- "key": "options.pushRate",
289
- "notitle": true
290
- },
291
- "options.debug",
292
- {
293
- "type": "fieldset",
294
- "title": "BLE Settings",
295
- "expandable": true,
296
- "expanded": false,
297
- "items": [
298
- {
299
- "type": "help",
300
- "helpvalue": "<h5>BLE Settings</h5><em class='primary-text'>Enables Bluetooth Connection, based off deviceID.</em>"
301
- },
302
- {
303
- "key": "options.ble",
304
- "notitle": true,
305
- "add": "Add Another Device",
306
- "type": "array",
307
- "items": [
308
- {
309
- "type": "div",
310
- "displayFlex": true,
311
- "flex-direction": "row",
312
- "items": [
313
- {
314
- "key": "options.ble[]",
315
- "placeholder": "81F3UT59513F"
316
- }
317
- ]
318
- }
319
- ]
320
- }
321
- ]
322
- },
323
- {
324
- "type": "fieldset",
325
- "title": "Hidden Devices",
326
- "expandable": true,
327
- "expanded": false,
328
- "items": [
329
- {
330
- "type": "help",
331
- "helpvalue": "<h5>Hide Device</h5><em class='primary-text'>Hide Device allows you to hide a device using it's deviceID.</em>"
332
- },
333
- {
334
- "key": "options.hide_device",
335
- "notitle": true,
336
- "add": "Add Another Device",
337
- "type": "array",
338
- "items": [
339
- {
340
- "type": "div",
341
- "displayFlex": true,
342
- "flex-direction": "row",
343
- "items": [
344
- {
345
- "key": "options.hide_device[]",
346
- "placeholder": "81F3UT59513F"
347
- }
348
- ]
349
- }
350
- ]
351
- }
352
- ]
353
- },
354
- {
355
- "type": "fieldset",
356
- "title": "SwitchBot Device Settings",
357
- "expandable": true,
358
- "expanded": false,
359
- "items": [
360
- {
361
- "type": "fieldset",
362
- "title": "Bot Settings",
363
- "expandable": true,
364
- "expanded": false,
365
- "items": [
366
- {
367
- "key": "options.bot.device_switch",
368
- "notitle": false,
369
- "add": "Add Another Bot in Switch Mode",
370
- "type": "array",
371
- "items": [
372
- {
373
- "type": "div",
374
- "displayFlex": true,
375
- "flex-direction": "row",
376
- "items": [
377
- {
378
- "key": "options.bot.device_switch[]",
379
- "placeholder": "81F3UT59513F"
380
- }
381
- ]
382
- }
383
- ]
384
- },
385
- {
386
- "key": "options.bot.device_press",
387
- "notitle": false,
388
- "add": "Add Another Bot in Press Mode",
389
- "type": "array",
390
- "items": [
391
- {
392
- "type": "div",
393
- "displayFlex": true,
394
- "flex-direction": "row",
395
- "items": [
396
- {
397
- "key": "options.bot.device_press[]",
398
- "placeholder": "81F3UT59513F"
399
- }
400
- ]
401
- }
402
- ]
403
- },
404
- "options.bot.switch"
405
- ]
406
- },
407
- {
408
- "type": "fieldset",
409
- "title": "Meter Settings",
410
- "expandable": true,
411
- "expanded": false,
412
- "items": [
413
- "options.meter.hide_temperature",
414
- "options.meter.hide_humidity",
415
- "options.meter.unit"
416
- ]
417
- },
418
- {
419
- "type": "fieldset",
420
- "title": "Humidifier Settings",
421
- "expandable": true,
422
- "expanded": false,
423
- "items": [
424
- "options.humidifier.set_minStep",
425
- "options.humidifier.hide_temperature"
426
- ]
427
- },
428
- {
429
- "type": "fieldset",
430
- "title": "Curtain Settings",
431
- "expandable": true,
432
- "expanded": false,
433
- "items": [
434
- "options.curtain.disable_group",
435
- "options.curtain.refreshRate",
436
- "options.curtain.set_minStep",
437
- "options.curtain.set_min",
438
- "options.curtain.set_max"
439
- ]
440
- },
441
- {
442
- "type": "fieldset",
443
- "title": "Bulb Settings",
444
- "expandable": true,
445
- "expanded": false,
446
- "items": [
447
- "options.bulb.set_minStep"
448
- ]
449
- }
450
- ]
451
- },
452
- {
440
+ "key": "options.devices",
441
+ "notitle": false,
442
+ "add": "Add Another Device",
453
443
  "type": "fieldset",
454
- "title": "IR Device Settings",
444
+ "title": "Optional Device Settings",
455
445
  "expandable": true,
456
446
  "expanded": false,
447
+ "orderable": false,
448
+ "buttonText": "Add Device",
457
449
  "items": [
458
450
  {
459
- "type": "fieldset",
460
- "title": "Fan Settings",
461
- "expandable": true,
462
- "expanded": false,
451
+ "type": "div",
452
+ "displayFlex": true,
453
+ "flex-direction": "column",
463
454
  "items": [
464
- {
465
- "type": "fieldset",
466
- "title": "Rotation Speed Settings",
467
- "expandable": true,
468
- "expanded": false,
469
- "items": [
470
- {
471
- "key": "options.fan.rotation_speed",
472
- "notitle": false,
473
- "add": "Add Another Fan Device ID to Enable Rotation Speed on Device",
474
- "type": "array",
475
- "items": [
476
- {
477
- "type": "div",
478
- "displayFlex": true,
479
- "flex-direction": "row",
480
- "items": [
481
- {
482
- "key": "options.fan.rotation_speed[]",
483
- "placeholder": "81F3UT59513F"
484
- }
485
- ]
486
- }
487
- ]
488
- },
489
- "options.fan.set_minStep",
490
- "options.fan.set_min",
491
- "options.fan.set_max"
492
- ]
493
- },
494
- {
495
- "type": "fieldset",
496
- "title": "Swing Mode Settings",
497
- "expandable": true,
498
- "expanded": false,
499
- "items": [
500
- {
501
- "key": "options.fan.swing_mode",
502
- "notitle": false,
503
- "add": "Add Another Fan Device ID to Enable Swing Mode on Device",
504
- "type": "array",
505
- "items": [
506
- {
507
- "type": "div",
508
- "displayFlex": true,
509
- "flex-direction": "row",
510
- "items": [
511
- {
512
- "key": "options.fan.swing_mode[]",
513
- "placeholder": "81F3UT59513F"
514
- }
515
- ]
516
- }
517
- ]
518
- }
519
- ]
520
- }
521
- ]
522
- },
523
- {
524
- "type": "fieldset",
525
- "title": "Air Conditioner Settings",
526
- "expandable": true,
527
- "expanded": false,
528
- "items": [
529
- "options.irair.hide_automode"
530
- ]
531
- },
532
- {
533
- "type": "fieldset",
534
- "title": "Others Settings",
535
- "expandable": true,
536
- "expanded": false,
537
- "items": [
538
- "options.other.deviceType",
539
- "options.other.commandOn",
540
- "options.other.commandOff"
455
+ "options.devices[].type",
456
+ "options.devices[].deviceId",
457
+ "options.devices[].hide_device",
458
+ "options.devices[].ble",
459
+ "options.devices[].bot.mode",
460
+ "options.devices[].bot.switch",
461
+ "options.devices[].meter.hide_temperature",
462
+ "options.devices[].meter.hide_humidity",
463
+ "options.devices[].meter.unit",
464
+ "options.devices[].humidifier.set_minStep",
465
+ "options.devices[].humidifier.hide_temperature",
466
+ "options.devices[].curtain.disable_group",
467
+ "options.devices[].curtain.refreshRate",
468
+ "options.devices[].curtain.set_minStep",
469
+ "options.devices[].curtain.set_min",
470
+ "options.devices[].curtain.set_max",
471
+ "options.devices[].bulb.set_minStep",
472
+ "options.devices[].fan.rotation_speed",
473
+ "options.devices[].fan.set_minStep",
474
+ "options.devices[].fan.set_min",
475
+ "options.devices[].fan.set_max",
476
+ "options.devices[].fan.swing_mode",
477
+ "options.devices[].irair.hide_automode",
478
+ "options.devices[].other.deviceType",
479
+ "options.devices[].other.commandOn",
480
+ "options.devices[].other.commandOff"
541
481
  ]
542
482
  }
543
483
  ]
544
- },
545
- {
546
- "type": "help",
547
- "helpvalue": "<h5>Device Discovery</h5><em class='primary-text'>Enables Device Info Logging.</em>"
548
- },
549
- {
550
- "key": "devicediscovery",
551
- "title": "Device Discovery"
552
484
  }
553
485
  ]
554
- }
486
+ },
487
+ {
488
+ "type": "help",
489
+ "helpvalue": "<h5>Refresh Rate</h5><em class='primary-text'>Refresh Rate indicates the number of seconds between polls of SwitchBot API.</em>"
490
+ },
491
+ {
492
+ "key": "options.refreshRate",
493
+ "notitle": true
494
+ },
495
+ {
496
+ "type": "help",
497
+ "helpvalue": "<h5>Push Rate</h5><em class='primary-text'>Push Rate indicates the number of seconds between pushes to SwitchBot API, Currently only for Curtains.</em>"
498
+ },
499
+ {
500
+ "key": "options.pushRate",
501
+ "notitle": true
502
+ },
503
+ "options.debug"
555
504
  ]
556
505
  }