homebridge-dummy 1.1.0-beta.1 → 1.1.0-beta.10
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.
- package/CHANGELOG.md +15 -5
- package/README.md +59 -27
- package/config.schema.json +178 -93
- package/dist/accessory/base.d.ts +6 -3
- package/dist/accessory/base.js +22 -10
- package/dist/accessory/base.js.map +1 -1
- package/dist/accessory/helpers.js +3 -0
- package/dist/accessory/helpers.js.map +1 -1
- package/dist/accessory/lock.d.ts +1 -1
- package/dist/accessory/lock.js +12 -1
- package/dist/accessory/lock.js.map +1 -1
- package/dist/accessory/onoff/lightbulb.d.ts +2 -2
- package/dist/accessory/onoff/lightbulb.js +5 -0
- package/dist/accessory/onoff/lightbulb.js.map +1 -1
- package/dist/accessory/onoff/onoff.d.ts +3 -4
- package/dist/accessory/onoff/onoff.js +15 -6
- package/dist/accessory/onoff/onoff.js.map +1 -1
- package/dist/accessory/position/position.d.ts +1 -1
- package/dist/accessory/position/position.js +12 -1
- package/dist/accessory/position/position.js.map +1 -1
- package/dist/accessory/sensor.d.ts +11 -11
- package/dist/accessory/sensor.js +44 -30
- package/dist/accessory/sensor.js.map +1 -1
- package/dist/accessory/thermostat.d.ts +28 -0
- package/dist/accessory/thermostat.js +151 -0
- package/dist/accessory/thermostat.js.map +1 -0
- package/dist/homebridge-ui/public/index.html +2 -2
- package/dist/homebridge-ui/public/ui.js +1 -1
- package/dist/i18n/en.d.ts +26 -4
- package/dist/i18n/en.js +34 -12
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/i18n.d.ts +26 -4
- package/dist/i18n/template.d.ts +26 -4
- package/dist/i18n/zz.d.ts +26 -4
- package/dist/model/types.d.ts +33 -9
- package/dist/model/types.js +19 -5
- package/dist/model/types.js.map +1 -1
- package/dist/timeout/schedule.d.ts +14 -0
- package/dist/timeout/schedule.js +68 -0
- package/dist/timeout/schedule.js.map +1 -0
- package/dist/timeout/timeout.d.ts +23 -0
- package/dist/timeout/timeout.js +91 -0
- package/dist/timeout/timeout.js.map +1 -0
- package/dist/timeout/timer.d.ts +10 -0
- package/dist/timeout/timer.js +29 -0
- package/dist/timeout/timer.js.map +1 -0
- package/dist/tools/configMigration.js +2 -2
- package/dist/tools/configMigration.js.map +1 -1
- package/dist/tools/storage.d.ts +1 -0
- package/dist/tools/storage.js +1 -0
- package/dist/tools/storage.js.map +1 -1
- package/dist/tools/temperature.d.ts +3 -0
- package/dist/tools/temperature.js +14 -0
- package/dist/tools/temperature.js.map +1 -0
- package/dist/tools/validation.d.ts +2 -0
- package/dist/tools/validation.js +7 -0
- package/dist/tools/validation.js.map +1 -1
- package/package.json +19 -3
- package/dist/model/timer.d.ts +0 -16
- package/dist/model/timer.js +0 -65
- package/dist/model/timer.js.map +0 -1
- package/dist/model/trigger.d.ts +0 -14
- package/dist/model/trigger.js +0 -73
- package/dist/model/trigger.js.map +0 -1
- package/dist/tools/time.d.ts +0 -5
- package/dist/tools/time.js +0 -15
- package/dist/tools/time.js.map +0 -1
package/config.schema.json
CHANGED
|
@@ -7,20 +7,37 @@
|
|
|
7
7
|
"schema": {
|
|
8
8
|
"type": "object",
|
|
9
9
|
"definitions": {
|
|
10
|
+
"units": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"title": "${config.title.units}",
|
|
13
|
+
"enum": [ "MILLISECONDS", "SECONDS", "MINUTES", "HOURS"],
|
|
14
|
+
"enumNames": ["${config.enumNames.milliseconds}", "${config.enumNames.seconds}", "${config.enumNames.minutes}", "${config.enumNames.hours}"]
|
|
15
|
+
},
|
|
16
|
+
"sensor": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"properties": {
|
|
19
|
+
"type": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"title": "${config.title.sensor}",
|
|
22
|
+
"enum": ["CarbonDioxideSensor", "CarbonMonoxideSensor", "ContactSensor", "LeakSensor", "MotionSensor", "OccupancySensor", "SmokeSensor"],
|
|
23
|
+
"enumNames": ["${config.enumNames.carbonDioxideSensor}", "${config.enumNames.carbonMonoxideSensor}", "${config.enumNames.contactSensor}", "${config.enumNames.leakSensor}", "${config.enumNames.motionSensor}", "${config.enumNames.occupancySensor}", "${config.enumNames.smokeSensor}"]
|
|
24
|
+
},
|
|
25
|
+
"timerControlled": {
|
|
26
|
+
"type": "boolean",
|
|
27
|
+
"title": "${config.title.timerControlled}",
|
|
28
|
+
"description": "${config.description.timerControlled}"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
10
32
|
"timer": {
|
|
11
33
|
"type": "object",
|
|
12
34
|
"properties": {
|
|
13
35
|
"delay": {
|
|
14
36
|
"type": "integer",
|
|
15
|
-
"title": "${config.title.delay}",
|
|
37
|
+
"title": "${config.title.delay}",
|
|
16
38
|
"minimum": 1
|
|
17
39
|
},
|
|
18
|
-
"units": {
|
|
19
|
-
"type": "string",
|
|
20
|
-
"title": "${config.title.units}",
|
|
21
|
-
"enum": [ "SECONDS", "MINUTES", "HOURS"],
|
|
22
|
-
"enumNames": ["${config.enumNames.seconds}", "${config.enumNames.minutes}", "${config.enumNames.hours}"]
|
|
23
|
-
},
|
|
40
|
+
"units": { "$ref": "#/definitions/units" },
|
|
24
41
|
"random": {
|
|
25
42
|
"type": "boolean",
|
|
26
43
|
"title": "${config.title.random}",
|
|
@@ -28,26 +45,21 @@
|
|
|
28
45
|
}
|
|
29
46
|
}
|
|
30
47
|
},
|
|
31
|
-
"
|
|
48
|
+
"schedule": {
|
|
32
49
|
"type": "object",
|
|
33
50
|
"properties": {
|
|
34
51
|
"type": {
|
|
35
52
|
"type": "string",
|
|
36
|
-
"title": "${config.title.type}",
|
|
53
|
+
"title": "${config.title.type}",
|
|
37
54
|
"enum": [ "INTERVAL", "CRON"],
|
|
38
55
|
"enumNames": ["${config.enumNames.interval}", "${config.enumNames.cron}"]
|
|
39
56
|
},
|
|
40
57
|
"interval": {
|
|
41
58
|
"type": "integer",
|
|
42
|
-
"title": "${config.title.interval}",
|
|
59
|
+
"title": "${config.title.interval}",
|
|
43
60
|
"minimum": 1
|
|
44
61
|
},
|
|
45
|
-
"units": {
|
|
46
|
-
"type": "string",
|
|
47
|
-
"title": "${config.title.units}",
|
|
48
|
-
"enum": [ "SECONDS", "MINUTES", "HOURS"],
|
|
49
|
-
"enumNames": ["${config.enumNames.seconds}", "${config.enumNames.minutes}", "${config.enumNames.hours}"]
|
|
50
|
-
},
|
|
62
|
+
"units": { "$ref": "#/definitions/units" },
|
|
51
63
|
"random": {
|
|
52
64
|
"type": "boolean",
|
|
53
65
|
"title": "${config.title.random}",
|
|
@@ -55,12 +67,12 @@
|
|
|
55
67
|
},
|
|
56
68
|
"cron": {
|
|
57
69
|
"type": "string",
|
|
58
|
-
"title": "${config.title.cron}",
|
|
59
|
-
"description": "${config.description.cron}",
|
|
70
|
+
"title": "${config.title.cron}",
|
|
71
|
+
"description": "${config.description.cron}",
|
|
60
72
|
"placeholder": "* * * * * *",
|
|
61
73
|
"minimum": 1
|
|
62
74
|
}
|
|
63
|
-
}
|
|
75
|
+
}
|
|
64
76
|
}
|
|
65
77
|
},
|
|
66
78
|
"properties": {
|
|
@@ -83,21 +95,22 @@
|
|
|
83
95
|
},
|
|
84
96
|
"type": {
|
|
85
97
|
"type": "string",
|
|
86
|
-
"title": "${config.title.type}",
|
|
87
|
-
"enum": ["Door", "Lightbulb", "LockMechanism", "Outlet", "Switch", "Window", "WindowCovering"],
|
|
88
|
-
"enumNames": ["${config.enumNames.door}", "${config.enumNames.lightbulb}", "${config.enumNames.lockMechanism}", "${config.enumNames.outlet}", "${config.enumNames.switch}", "${config.enumNames.window}", "${config.enumNames.windowCovering}"]
|
|
98
|
+
"title": "${config.title.type}",
|
|
99
|
+
"enum": ["Door", "Lightbulb", "LockMechanism", "Outlet", "Switch", "Thermostat", "Window", "WindowCovering"],
|
|
100
|
+
"enumNames": ["${config.enumNames.door}", "${config.enumNames.lightbulb}", "${config.enumNames.lockMechanism}", "${config.enumNames.outlet}", "${config.enumNames.switch}", "${config.enumNames.thermostat}", "${config.enumNames.window}", "${config.enumNames.windowCovering}"]
|
|
89
101
|
},
|
|
90
102
|
"groupName": {
|
|
91
103
|
"type": "string",
|
|
92
104
|
"title": "${config.title.groupName}"
|
|
93
105
|
},
|
|
106
|
+
"sensor": { "$ref": "#/definitions/sensor" },
|
|
94
107
|
"timer": { "$ref": "#/definitions/timer" },
|
|
95
|
-
"
|
|
96
|
-
"
|
|
108
|
+
"schedule": { "$ref": "#/definitions/schedule" },
|
|
109
|
+
"temperatureUnits": {
|
|
97
110
|
"type": "string",
|
|
98
|
-
"title": "${config.title.
|
|
99
|
-
"enum": ["
|
|
100
|
-
"enumNames": ["${config.enumNames.
|
|
111
|
+
"title": "${config.title.units}",
|
|
112
|
+
"enum": ["C", "F"],
|
|
113
|
+
"enumNames": ["${config.enumNames.celsius}", "${config.enumNames.fahrenheit}"]
|
|
101
114
|
},
|
|
102
115
|
"defaultBrightness": {
|
|
103
116
|
"type": "number",
|
|
@@ -123,6 +136,16 @@
|
|
|
123
136
|
"enum": ["open", "closed"],
|
|
124
137
|
"enumNames": ["${config.enumNames.open}", "${config.enumNames.closed}"]
|
|
125
138
|
},
|
|
139
|
+
"defaultThermostatState": {
|
|
140
|
+
"type": "string",
|
|
141
|
+
"title": "${config.title.defaultState}",
|
|
142
|
+
"enum": ["auto", "heat", "cool", "off"],
|
|
143
|
+
"enumNames": ["${config.enumNames.auto}", "${config.enumNames.heat}", "${config.enumNames.cool}", "${config.enumNames.off}"]
|
|
144
|
+
},
|
|
145
|
+
"defaultTemperature": {
|
|
146
|
+
"type": "number",
|
|
147
|
+
"title": "${config.title.defaultTemperature}"
|
|
148
|
+
},
|
|
126
149
|
"commandOn": {
|
|
127
150
|
"type": "string",
|
|
128
151
|
"title": "${config.title.commandOn}"
|
|
@@ -147,16 +170,20 @@
|
|
|
147
170
|
"type": "string",
|
|
148
171
|
"title": "${config.title.commandClose}"
|
|
149
172
|
},
|
|
173
|
+
"commandTemperature": {
|
|
174
|
+
"type": "string",
|
|
175
|
+
"title": "${config.title.commandTemperature}"
|
|
176
|
+
},
|
|
150
177
|
"resetOnRestart": {
|
|
151
178
|
"type": "boolean",
|
|
152
179
|
"title": "${config.title.resetOnRestart}"
|
|
153
180
|
},
|
|
154
181
|
"disableLogging": {
|
|
155
|
-
"
|
|
156
|
-
"
|
|
182
|
+
"type": "boolean",
|
|
183
|
+
"title": "${config.title.disableLogging}"
|
|
157
184
|
}
|
|
158
185
|
}
|
|
159
|
-
}
|
|
186
|
+
}
|
|
160
187
|
}
|
|
161
188
|
}
|
|
162
189
|
},
|
|
@@ -178,15 +205,15 @@
|
|
|
178
205
|
"items": [
|
|
179
206
|
{
|
|
180
207
|
"key": "accessories[].name",
|
|
181
|
-
"flex": "1 1
|
|
208
|
+
"flex": "1 1 33%"
|
|
182
209
|
},
|
|
183
210
|
{
|
|
184
211
|
"key": "accessories[].type",
|
|
185
|
-
"flex": "1 1
|
|
212
|
+
"flex": "1 1 33%"
|
|
186
213
|
},
|
|
187
214
|
{
|
|
188
215
|
"key": "accessories[].groupName",
|
|
189
|
-
"flex": "1 1
|
|
216
|
+
"flex": "1 1 33%"
|
|
190
217
|
}
|
|
191
218
|
]
|
|
192
219
|
},
|
|
@@ -207,15 +234,15 @@
|
|
|
207
234
|
"items": [
|
|
208
235
|
{
|
|
209
236
|
"key": "accessories[].defaultOn",
|
|
210
|
-
"flex": "0 0
|
|
237
|
+
"flex": "0 0 33%"
|
|
211
238
|
},
|
|
212
239
|
{
|
|
213
|
-
"key": "accessories[].sensor",
|
|
214
|
-
"flex": "0 0
|
|
240
|
+
"key": "accessories[].sensor.type",
|
|
241
|
+
"flex": "0 0 33%"
|
|
215
242
|
},
|
|
216
243
|
{
|
|
217
244
|
"key": "accessories[].defaultBrightness",
|
|
218
|
-
"flex": "0 0
|
|
245
|
+
"flex": "0 0 33%",
|
|
219
246
|
"condition": {
|
|
220
247
|
"functionBody": "return ['Lightbulb'].includes(model.accessories?.[arguments[1]]?.type);"
|
|
221
248
|
}
|
|
@@ -232,7 +259,11 @@
|
|
|
232
259
|
"items": [
|
|
233
260
|
{
|
|
234
261
|
"key": "accessories[].defaultLockState",
|
|
235
|
-
"flex": "0 0
|
|
262
|
+
"flex": "0 0 33%"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"key": "accessories[].sensor.type",
|
|
266
|
+
"flex": "0 0 33%"
|
|
236
267
|
}
|
|
237
268
|
]
|
|
238
269
|
},
|
|
@@ -246,10 +277,36 @@
|
|
|
246
277
|
"items": [
|
|
247
278
|
{
|
|
248
279
|
"key": "accessories[].defaultPosition",
|
|
249
|
-
"flex": "0 0
|
|
280
|
+
"flex": "0 0 33%"
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"key": "accessories[].sensor.type",
|
|
284
|
+
"flex": "0 0 33%"
|
|
250
285
|
}
|
|
251
286
|
]
|
|
252
|
-
},
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"type": "div",
|
|
290
|
+
"displayFlex": true,
|
|
291
|
+
"flex-direction": "row",
|
|
292
|
+
"condition": {
|
|
293
|
+
"functionBody": "return ['Thermostat'].includes(model.accessories?.[arguments[1]]?.type);"
|
|
294
|
+
},
|
|
295
|
+
"items": [
|
|
296
|
+
{
|
|
297
|
+
"key": "accessories[].temperatureUnits",
|
|
298
|
+
"flex": "0 0 33%"
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"key": "accessories[].defaultThermostatState",
|
|
302
|
+
"flex": "0 0 33%"
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"key": "accessories[].defaultTemperature",
|
|
306
|
+
"flex": "0 0 33%"
|
|
307
|
+
}
|
|
308
|
+
]
|
|
309
|
+
},
|
|
253
310
|
{
|
|
254
311
|
"type": "div",
|
|
255
312
|
"displayFlex": true,
|
|
@@ -257,13 +314,13 @@
|
|
|
257
314
|
"items": [
|
|
258
315
|
{
|
|
259
316
|
"key": "accessories[].disableLogging",
|
|
260
|
-
"flex": "0 1
|
|
317
|
+
"flex": "0 1 33%"
|
|
261
318
|
},
|
|
262
319
|
{
|
|
263
320
|
"key": "accessories[].resetOnRestart",
|
|
264
|
-
"flex": "0 1
|
|
321
|
+
"flex": "0 1 33%",
|
|
265
322
|
"condition": {
|
|
266
|
-
"functionBody": "return model.accessories?.[arguments[1]]?.timer?.delay === undefined;"
|
|
323
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.schedule?.type === undefined && model.accessories?.[arguments[1]]?.timer?.delay === undefined;"
|
|
267
324
|
}
|
|
268
325
|
}
|
|
269
326
|
]
|
|
@@ -272,10 +329,10 @@
|
|
|
272
329
|
},
|
|
273
330
|
{
|
|
274
331
|
"type": "fieldset",
|
|
275
|
-
"title": "${config.title.
|
|
276
|
-
"description": "${config.description.
|
|
332
|
+
"title": "${config.title.schedule}",
|
|
333
|
+
"description": "${config.description.schedule}",
|
|
277
334
|
"condition": {
|
|
278
|
-
"functionBody": "
|
|
335
|
+
"functionBody": "const type = model.accessories?.[arguments[1]]?.type; return type !== undefined && type !== 'Thermostat';"
|
|
279
336
|
},
|
|
280
337
|
"items": [
|
|
281
338
|
{
|
|
@@ -284,35 +341,35 @@
|
|
|
284
341
|
"flex-direction": "row",
|
|
285
342
|
"items": [
|
|
286
343
|
{
|
|
287
|
-
"key": "accessories[].
|
|
288
|
-
"flex": "1 1
|
|
344
|
+
"key": "accessories[].schedule.type",
|
|
345
|
+
"flex": "1 1 33%"
|
|
289
346
|
},
|
|
290
347
|
{
|
|
291
|
-
"key": "accessories[].
|
|
292
|
-
"flex": "1 1
|
|
348
|
+
"key": "accessories[].schedule.interval",
|
|
349
|
+
"flex": "1 1 33%",
|
|
293
350
|
"condition": {
|
|
294
|
-
"functionBody": "return model.accessories?.[arguments[1]]?.
|
|
351
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.schedule?.type === 'INTERVAL';"
|
|
295
352
|
}
|
|
296
353
|
},
|
|
297
354
|
{
|
|
298
|
-
"key": "accessories[].
|
|
299
|
-
"flex": "1 1
|
|
355
|
+
"key": "accessories[].schedule.units",
|
|
356
|
+
"flex": "1 1 33%",
|
|
300
357
|
"condition": {
|
|
301
|
-
"functionBody": "return model.accessories?.[arguments[1]]?.
|
|
358
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.schedule?.type === 'INTERVAL';"
|
|
302
359
|
}
|
|
303
360
|
}
|
|
304
361
|
]
|
|
305
362
|
},
|
|
306
363
|
{
|
|
307
|
-
"key": "accessories[].
|
|
364
|
+
"key": "accessories[].schedule.cron",
|
|
308
365
|
"condition": {
|
|
309
|
-
"functionBody": "return model.accessories?.[arguments[1]]?.
|
|
366
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.schedule?.type === 'CRON';"
|
|
310
367
|
}
|
|
311
368
|
},
|
|
312
369
|
{
|
|
313
|
-
"key": "accessories[].
|
|
370
|
+
"key": "accessories[].schedule.random",
|
|
314
371
|
"condition": {
|
|
315
|
-
"functionBody": "
|
|
372
|
+
"functionBody": "const schedule = model.accessories?.[arguments[1]]?.schedule; return schedule?.type === 'INTERVAL' && schedule?.interval !== undefined;"
|
|
316
373
|
}
|
|
317
374
|
}
|
|
318
375
|
]
|
|
@@ -322,7 +379,7 @@
|
|
|
322
379
|
"title": "${config.title.timer}",
|
|
323
380
|
"description": "${config.description.timer}",
|
|
324
381
|
"condition": {
|
|
325
|
-
"functionBody": "
|
|
382
|
+
"functionBody": "const type = model.accessories?.[arguments[1]]?.type; return type !== undefined && type !== 'Thermostat';"
|
|
326
383
|
},
|
|
327
384
|
"items": [
|
|
328
385
|
{
|
|
@@ -332,30 +389,30 @@
|
|
|
332
389
|
"items": [
|
|
333
390
|
{
|
|
334
391
|
"key": "accessories[].timer.delay",
|
|
335
|
-
"flex": "1 1
|
|
392
|
+
"flex": "1 1 33%"
|
|
336
393
|
},
|
|
337
394
|
{
|
|
338
395
|
"key": "accessories[].timer.units",
|
|
339
|
-
"flex": "1 1
|
|
340
|
-
},
|
|
341
|
-
{
|
|
342
|
-
"flex": "1 1 0"
|
|
396
|
+
"flex": "1 1 33%"
|
|
343
397
|
}
|
|
344
398
|
]
|
|
345
399
|
},
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
400
|
+
{
|
|
401
|
+
"type": "fieldset",
|
|
402
|
+
"notitle": true,
|
|
403
|
+
"condition": {
|
|
404
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.timer?.delay !== undefined;"
|
|
405
|
+
},
|
|
406
|
+
"items": [
|
|
407
|
+
"accessories[].timer.random",
|
|
408
|
+
{
|
|
409
|
+
"key": "accessories[].sensor.timerControlled",
|
|
410
|
+
"condition": {
|
|
411
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.sensor?.type !== undefined;"
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
]
|
|
415
|
+
}
|
|
359
416
|
]
|
|
360
417
|
},
|
|
361
418
|
{
|
|
@@ -363,25 +420,53 @@
|
|
|
363
420
|
"title": "${config.title.commands}",
|
|
364
421
|
"description": "${config.description.commands}",
|
|
365
422
|
"condition": {
|
|
366
|
-
"functionBody": "return
|
|
367
|
-
},
|
|
368
|
-
"items": [
|
|
369
|
-
"accessories[].commandLock",
|
|
370
|
-
"accessories[].commandUnlock"
|
|
371
|
-
]
|
|
372
|
-
},
|
|
373
|
-
{
|
|
374
|
-
"type": "fieldset",
|
|
375
|
-
"title": "${config.title.commands}",
|
|
376
|
-
"description": "${config.description.commands}",
|
|
377
|
-
"condition": {
|
|
378
|
-
"functionBody": "return ['Door', 'Window', 'WindowCovering'].includes(model.accessories?.[arguments[1]]?.type);"
|
|
423
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.type !== undefined;"
|
|
379
424
|
},
|
|
380
425
|
"items": [
|
|
381
|
-
|
|
382
|
-
|
|
426
|
+
{
|
|
427
|
+
"key": "accessories[].commandOn",
|
|
428
|
+
"condition": {
|
|
429
|
+
"functionBody": "return ['Lightbulb','Outlet','Switch','Thermostat'].includes(model.accessories?.[arguments[1]]?.type);"
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
"key": "accessories[].commandOff",
|
|
434
|
+
"condition": {
|
|
435
|
+
"functionBody": "return ['Lightbulb','Outlet','Switch','Thermostat'].includes(model.accessories?.[arguments[1]]?.type);"
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
"key": "accessories[].commandLock",
|
|
440
|
+
"condition": {
|
|
441
|
+
"functionBody": "return ['LockMechanism'].includes(model.accessories?.[arguments[1]]?.type);"
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"key": "accessories[].commandUnlock",
|
|
446
|
+
"condition": {
|
|
447
|
+
"functionBody": "return ['LockMechanism'].includes(model.accessories?.[arguments[1]]?.type);"
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
"key": "accessories[].commandOpen",
|
|
452
|
+
"condition": {
|
|
453
|
+
"functionBody": "return ['Door', 'Window', 'WindowCovering'].includes(model.accessories?.[arguments[1]]?.type);"
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
"key": "accessories[].commandClose",
|
|
458
|
+
"condition": {
|
|
459
|
+
"functionBody": "return ['Door', 'Window', 'WindowCovering'].includes(model.accessories?.[arguments[1]]?.type);"
|
|
460
|
+
}
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
"key": "accessories[].commandTemperature",
|
|
464
|
+
"condition": {
|
|
465
|
+
"functionBody": "return ['Thermostat'].includes(model.accessories?.[arguments[1]]?.type);"
|
|
466
|
+
}
|
|
467
|
+
}
|
|
383
468
|
]
|
|
384
|
-
}
|
|
469
|
+
}
|
|
385
470
|
]
|
|
386
471
|
}
|
|
387
472
|
]
|
package/dist/accessory/base.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PlatformAccessory, Service } from 'homebridge';
|
|
2
|
+
import { SensorAccessory } from './sensor.js';
|
|
2
3
|
import { AccessoryType, CharacteristicType, DummyConfig, ServiceType } from '../model/types.js';
|
|
3
4
|
import { Log } from '../tools/log.js';
|
|
4
5
|
export declare abstract class DummyAccessory<C extends DummyConfig> {
|
|
@@ -8,12 +9,14 @@ export declare abstract class DummyAccessory<C extends DummyConfig> {
|
|
|
8
9
|
protected readonly config: C;
|
|
9
10
|
protected readonly log: Log;
|
|
10
11
|
protected readonly persistPath: string;
|
|
12
|
+
protected sensor?: SensorAccessory;
|
|
11
13
|
static identifier(config: DummyConfig): string;
|
|
12
14
|
protected readonly accessoryService: Service;
|
|
13
|
-
private readonly
|
|
15
|
+
private readonly _schedule?;
|
|
16
|
+
private readonly _timer?;
|
|
14
17
|
constructor(Service: ServiceType, Characteristic: CharacteristicType, accessory: PlatformAccessory, config: C, log: Log, persistPath: string, isGrouped: boolean);
|
|
15
18
|
protected abstract getAccessoryType(): AccessoryType;
|
|
16
|
-
protected abstract
|
|
19
|
+
protected abstract schedule(): Promise<void>;
|
|
17
20
|
protected abstract reset(): Promise<void>;
|
|
18
21
|
get subtype(): string | undefined;
|
|
19
22
|
teardown(): void;
|
|
@@ -23,5 +26,5 @@ export declare abstract class DummyAccessory<C extends DummyConfig> {
|
|
|
23
26
|
protected startTimer(): void;
|
|
24
27
|
protected cancelTimer(): void;
|
|
25
28
|
protected executeCommand(command: string): void;
|
|
26
|
-
protected logIfDesired(message: string, ...parameters: string[]): void;
|
|
29
|
+
protected logIfDesired(message: string, ...parameters: (string | number)[]): void;
|
|
27
30
|
}
|
package/dist/accessory/base.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { exec } from 'child_process';
|
|
2
2
|
import { PLATFORM_NAME, PLUGIN_ALIAS } from '../homebridge/settings.js';
|
|
3
|
+
import { SensorAccessory } from './sensor.js';
|
|
3
4
|
import { strings } from '../i18n/i18n.js';
|
|
5
|
+
import { AccessoryType } from '../model/types.js';
|
|
6
|
+
import { Schedule } from '../timeout/schedule.js';
|
|
7
|
+
import { Timer } from '../timeout/timer.js';
|
|
4
8
|
import { STORAGE_KEY_SUFFIX_DEFAULT_STATE } from '../tools/storage.js';
|
|
5
|
-
import { Timer } from '../model/timer.js';
|
|
6
9
|
import getVersion from '../tools/version.js';
|
|
7
|
-
import { Trigger } from '../model/trigger.js';
|
|
8
10
|
export class DummyAccessory {
|
|
9
11
|
Service;
|
|
10
12
|
Characteristic;
|
|
@@ -12,11 +14,13 @@ export class DummyAccessory {
|
|
|
12
14
|
config;
|
|
13
15
|
log;
|
|
14
16
|
persistPath;
|
|
17
|
+
sensor;
|
|
15
18
|
static identifier(config) {
|
|
16
19
|
return config.id ?? `${PLATFORM_NAME}:${config.type}:${config.name.replace(/\s+/g, '')}`;
|
|
17
20
|
}
|
|
18
21
|
accessoryService;
|
|
19
|
-
|
|
22
|
+
_schedule;
|
|
23
|
+
_timer;
|
|
20
24
|
constructor(Service, Characteristic, accessory, config, log, persistPath, isGrouped) {
|
|
21
25
|
this.Service = Service;
|
|
22
26
|
this.Characteristic = Characteristic;
|
|
@@ -24,11 +28,12 @@ export class DummyAccessory {
|
|
|
24
28
|
this.config = config;
|
|
25
29
|
this.log = log;
|
|
26
30
|
this.persistPath = persistPath;
|
|
31
|
+
this.sensor = SensorAccessory.new(Service, Characteristic, accessory, this.config.name, log, this.config.disableLogging === true, config.sensor);
|
|
27
32
|
if (config.timer) {
|
|
28
|
-
this.
|
|
33
|
+
this._timer = Timer.new(config.timer, config.name, log, config.disableLogging === true);
|
|
29
34
|
}
|
|
30
|
-
if (config.
|
|
31
|
-
new
|
|
35
|
+
if (config.schedule) {
|
|
36
|
+
this._schedule = Schedule.new(config.schedule, config.name, log, config.disableLogging === true, this.schedule.bind(this));
|
|
32
37
|
}
|
|
33
38
|
const serviceInstance = Service[this.getAccessoryType()];
|
|
34
39
|
if (isGrouped) {
|
|
@@ -48,27 +53,34 @@ export class DummyAccessory {
|
|
|
48
53
|
.setCharacteristic(Characteristic.SerialNumber, this.identifier)
|
|
49
54
|
.setCharacteristic(Characteristic.FirmwareRevision, getVersion());
|
|
50
55
|
this.accessoryService = accessory.getService(serviceInstance) || accessory.addService(serviceInstance);
|
|
56
|
+
for (const type of Object.values(AccessoryType)) {
|
|
57
|
+
const existingService = accessory.getService(Service[type]);
|
|
58
|
+
if (existingService && type !== this.getAccessoryType()) {
|
|
59
|
+
accessory.removeService(existingService);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
51
62
|
}
|
|
52
63
|
get subtype() {
|
|
53
64
|
return this.accessoryService.subtype;
|
|
54
65
|
}
|
|
55
66
|
teardown() {
|
|
56
|
-
this.
|
|
67
|
+
this._timer?.teardown();
|
|
68
|
+
this._schedule?.teardown();
|
|
57
69
|
}
|
|
58
70
|
get identifier() {
|
|
59
71
|
return DummyAccessory.identifier(this.config);
|
|
60
72
|
}
|
|
61
73
|
get isStateful() {
|
|
62
|
-
return this.
|
|
74
|
+
return this._timer === undefined && this._schedule === undefined && !this.config.resetOnRestart;
|
|
63
75
|
}
|
|
64
76
|
get defaultStateStorageKey() {
|
|
65
77
|
return `${this.identifier}:${STORAGE_KEY_SUFFIX_DEFAULT_STATE}`;
|
|
66
78
|
}
|
|
67
79
|
startTimer() {
|
|
68
|
-
this.
|
|
80
|
+
this._timer?.start(this.reset.bind(this));
|
|
69
81
|
}
|
|
70
82
|
cancelTimer() {
|
|
71
|
-
this.
|
|
83
|
+
this._timer?.cancel();
|
|
72
84
|
}
|
|
73
85
|
executeCommand(command) {
|
|
74
86
|
exec(command, (_error, stdout, stderr) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/accessory/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAGrC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bulb.js';
|
|
|
4
4
|
import { LockAccessory } from './lock.js';
|
|
5
5
|
import { OutletAccessory } from './onoff/outlet.js';
|
|
6
6
|
import { SwitchAccessory } from './onoff/switch.js';
|
|
7
|
+
import { ThermostatAccessory } from './thermostat.js';
|
|
7
8
|
import { WindowAccessory } from './position/window.js';
|
|
8
9
|
import { strings } from '../i18n/i18n.js';
|
|
9
10
|
import * as Types from '../model/types.js';
|
|
@@ -19,6 +20,8 @@ export function createDummyAccessory(Service, Characteristic, accessory, config,
|
|
|
19
20
|
return new OutletAccessory(Service, Characteristic, accessory, config, log, persistPath, isGrouped);
|
|
20
21
|
case Types.AccessoryType.Switch:
|
|
21
22
|
return new SwitchAccessory(Service, Characteristic, accessory, config, log, persistPath, isGrouped);
|
|
23
|
+
case Types.AccessoryType.Thermostat:
|
|
24
|
+
return new ThermostatAccessory(Service, Characteristic, accessory, config, log, persistPath, isGrouped);
|
|
22
25
|
case Types.AccessoryType.Window:
|
|
23
26
|
return new WindowAccessory(Service, Characteristic, accessory, config, log, persistPath, isGrouped);
|
|
24
27
|
case Types.AccessoryType.WindowCovering:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/accessory/helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,KAAK,KAAK,MAAM,mB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ACd,CAAC;AACH,CAAC"}
|
package/dist/accessory/lock.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare class LockAccessory extends DummyAccessory<LockConfig> {
|
|
|
10
10
|
private get defaultLockState();
|
|
11
11
|
protected getState(): Promise<CharacteristicValue>;
|
|
12
12
|
protected setState(value: CharacteristicValue): Promise<void>;
|
|
13
|
-
|
|
13
|
+
schedule(): Promise<void>;
|
|
14
14
|
reset(): Promise<void>;
|
|
15
15
|
protected logLockState(value: CharacteristicValue): void;
|
|
16
16
|
}
|