homebridge-easy-mqtt 1.2.0-beta.3 → 1.2.0-beta.4
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 +3 -0
- package/config.schema.json +230 -114
- package/dist/accessory/abstract/base.d.ts +12 -33
- package/dist/accessory/abstract/base.js +54 -132
- package/dist/accessory/abstract/base.js.map +1 -1
- package/dist/accessory/abstract/mqtt.d.ts +36 -0
- package/dist/accessory/abstract/mqtt.js +154 -0
- package/dist/accessory/abstract/mqtt.js.map +1 -0
- package/dist/accessory/lock.d.ts +2 -2
- package/dist/accessory/lock.js +11 -9
- package/dist/accessory/lock.js.map +1 -1
- package/dist/accessory/onoff/lightbulb.js +1 -1
- package/dist/accessory/onoff/lightbulb.js.map +1 -1
- package/dist/accessory/onoff/onoff.d.ts +3 -3
- package/dist/accessory/onoff/onoff.js +7 -7
- package/dist/accessory/onoff/onoff.js.map +1 -1
- package/dist/accessory/onoff/outlet.js +1 -1
- package/dist/accessory/onoff/outlet.js.map +1 -1
- package/dist/accessory/onoff/switch.js +1 -1
- package/dist/accessory/onoff/switch.js.map +1 -1
- package/dist/accessory/security.d.ts +2 -2
- package/dist/accessory/security.js +7 -6
- package/dist/accessory/security.js.map +1 -1
- package/dist/accessory/temperatureSensor.d.ts +2 -2
- package/dist/accessory/temperatureSensor.js +3 -3
- package/dist/accessory/temperatureSensor.js.map +1 -1
- package/dist/homebridge/platform.d.ts +2 -2
- package/dist/homebridge/platform.js +20 -20
- package/dist/homebridge/platform.js.map +1 -1
- package/dist/homebridge-ui/public/index.html +1 -1
- package/dist/homebridge-ui/public/ui.js +1 -1
- package/dist/i18n/en.d.ts +10 -10
- package/dist/i18n/en.js +11 -11
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/i18n.d.ts +10 -10
- package/dist/i18n/template.d.ts +10 -10
- package/dist/model/enums.d.ts +2 -0
- package/dist/model/enums.js +2 -0
- package/dist/model/enums.js.map +1 -1
- package/dist/model/types.d.ts +11 -12
- package/dist/tools/validation.d.ts +2 -2
- package/dist/tools/validation.js +1 -2
- package/dist/tools/validation.js.map +1 -1
- package/package.json +1 -1
- package/dist/accessory/abstract/statusActive.d.ts +0 -10
- package/dist/accessory/abstract/statusActive.js +0 -29
- package/dist/accessory/abstract/statusActive.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,7 @@ Would you like to see Homebridge Easy MQTT in your language? Please consider [ge
|
|
|
10
10
|
|
|
11
11
|
### Added
|
|
12
12
|
- Security System accessory type
|
|
13
|
+
- Support for battery and status
|
|
13
14
|
|
|
14
15
|
### Fixed
|
|
15
16
|
- Allow raw strings in mqtt messages
|
|
@@ -19,6 +20,8 @@ Would you like to see Homebridge Easy MQTT in your language? Please consider [ge
|
|
|
19
20
|
- Updated dev dependencies
|
|
20
21
|
- Significant under-the-hood refactoring to speed future development
|
|
21
22
|
- Removed in-use setter topic for outlet since it is not user modifyable
|
|
23
|
+
- Condensed and cleaned up config UI
|
|
24
|
+
- Removed optional accessory info fields as they were messy and provided little value
|
|
22
25
|
- Deprecated inconsistent LockMechanism topic names
|
|
23
26
|
- topicGetLockCurrentState -> topicGetCurrentLockState
|
|
24
27
|
- topicGetLockTargetState -> topicGetTargetLockState
|
package/config.schema.json
CHANGED
|
@@ -24,22 +24,6 @@
|
|
|
24
24
|
"enum": [ "Lightbulb", "LockMechanism", "Outlet", "SecuritySystem", "Switch", "TemperatureSensor"],
|
|
25
25
|
"enumNames": ["${config.enumNames.lightbulb}", "${config.enumNames.lockMechanism}", "${config.enumNames.outlet}", "${config.enumNames.securitySystem}", "${config.enumNames.switch}", "${config.enumNames.temperatureSensor}"],
|
|
26
26
|
"required": true
|
|
27
|
-
},
|
|
28
|
-
"manufacturer": {
|
|
29
|
-
"type": "string",
|
|
30
|
-
"title": "${config.title.manufacturer}"
|
|
31
|
-
},
|
|
32
|
-
"model": {
|
|
33
|
-
"type": "string",
|
|
34
|
-
"title": "${config.title.model}"
|
|
35
|
-
},
|
|
36
|
-
"serialNumber": {
|
|
37
|
-
"type": "string",
|
|
38
|
-
"title": "${config.title.serialNumber}"
|
|
39
|
-
},
|
|
40
|
-
"version": {
|
|
41
|
-
"type": "string",
|
|
42
|
-
"title": "${config.title.version}"
|
|
43
27
|
}
|
|
44
28
|
}
|
|
45
29
|
},
|
|
@@ -86,6 +70,14 @@
|
|
|
86
70
|
"enum": ["C", "F"],
|
|
87
71
|
"enumNames": ["${config.enumNames.celsius}", "${config.enumNames.fahrenheit}"]
|
|
88
72
|
},
|
|
73
|
+
"topicGetBatteryLevel": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"title": "${config.title.topicGetBatteryLevel}"
|
|
76
|
+
},
|
|
77
|
+
"topicGetBatteryLow": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"title": "${config.title.topicGetBatteryLow}"
|
|
80
|
+
},
|
|
89
81
|
"topicGetStatusActive": {
|
|
90
82
|
"type": "string",
|
|
91
83
|
"title": "${config.title.topicGetStatusActive}"
|
|
@@ -170,6 +162,10 @@
|
|
|
170
162
|
"type": "string",
|
|
171
163
|
"title": "${config.title.topicGetStatusFault}"
|
|
172
164
|
},
|
|
165
|
+
"valueBatteryLow": {
|
|
166
|
+
"type": "string",
|
|
167
|
+
"title": "${config.title.valueBatteryLow}"
|
|
168
|
+
},
|
|
173
169
|
"valueStatusActive": {
|
|
174
170
|
"type": "string",
|
|
175
171
|
"title": "${config.title.valueStatusActive}"
|
|
@@ -228,8 +224,7 @@
|
|
|
228
224
|
},
|
|
229
225
|
"disableLogging": {
|
|
230
226
|
"type": "boolean",
|
|
231
|
-
"title": "${config.title.disableLogging}"
|
|
232
|
-
"description": "${config.description.disableLogging}"
|
|
227
|
+
"title": "${config.title.disableLogging}"
|
|
233
228
|
}
|
|
234
229
|
}
|
|
235
230
|
},
|
|
@@ -255,145 +250,237 @@
|
|
|
255
250
|
"items": [
|
|
256
251
|
{
|
|
257
252
|
"key": "accessories[].info.name",
|
|
258
|
-
"flex": "
|
|
253
|
+
"flex": "0 0 50%"
|
|
259
254
|
},
|
|
260
255
|
{
|
|
261
256
|
"key": "accessories[].info.type",
|
|
262
|
-
"flex": "
|
|
257
|
+
"flex": "0 0 50%"
|
|
263
258
|
}
|
|
264
259
|
]
|
|
265
260
|
},
|
|
261
|
+
"accessories[].mqtt.broker",
|
|
266
262
|
{
|
|
267
|
-
"type": "
|
|
268
|
-
"
|
|
269
|
-
"
|
|
263
|
+
"type": "div",
|
|
264
|
+
"displayFlex": true,
|
|
265
|
+
"flex-direction": "row",
|
|
270
266
|
"items": [
|
|
271
267
|
{
|
|
272
|
-
"
|
|
273
|
-
"
|
|
274
|
-
"flex-direction": "row",
|
|
275
|
-
"items": [
|
|
276
|
-
{
|
|
277
|
-
"key": "accessories[].info.manufacturer",
|
|
278
|
-
"flex": "1 1 0"
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
"key": "accessories[].info.model",
|
|
282
|
-
"flex": "1 1 0"
|
|
283
|
-
}
|
|
284
|
-
]
|
|
268
|
+
"key": "accessories[].mqtt.username",
|
|
269
|
+
"flex": "0 0 50%"
|
|
285
270
|
},
|
|
286
271
|
{
|
|
287
|
-
"
|
|
288
|
-
"
|
|
289
|
-
"flex-direction": "row",
|
|
290
|
-
"items": [
|
|
291
|
-
{
|
|
292
|
-
"key": "accessories[].info.serialNumber",
|
|
293
|
-
"flex": "1 1 0"
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
"key": "accessories[].info.version",
|
|
297
|
-
"flex": "1 1 0"
|
|
298
|
-
}
|
|
299
|
-
]
|
|
272
|
+
"key": "accessories[].mqtt.password",
|
|
273
|
+
"flex": "0 0 50%"
|
|
300
274
|
}
|
|
301
275
|
]
|
|
302
276
|
},
|
|
303
|
-
|
|
304
|
-
"type": "fieldset",
|
|
305
|
-
"title": "${config.title.mqtt}",
|
|
306
|
-
"items": [
|
|
307
|
-
"accessories[].mqtt.broker",
|
|
308
|
-
{
|
|
309
|
-
"type": "div",
|
|
310
|
-
"displayFlex": true,
|
|
311
|
-
"flex-direction": "row",
|
|
312
|
-
"items": [
|
|
313
|
-
{
|
|
314
|
-
"key": "accessories[].mqtt.username",
|
|
315
|
-
"flex": "1 1 0"
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
"key": "accessories[].mqtt.password",
|
|
319
|
-
"flex": "1 1 0"
|
|
320
|
-
}
|
|
321
|
-
]
|
|
322
|
-
},
|
|
323
|
-
"accessories[].mqtt.options"
|
|
324
|
-
]
|
|
325
|
-
},
|
|
277
|
+
"accessories[].mqtt.options",
|
|
326
278
|
"accessories[].disableLogging",
|
|
327
279
|
{
|
|
328
280
|
"type": "fieldset",
|
|
329
281
|
"title": "${config.title.topics}",
|
|
282
|
+
"description": "${config.description.topics}",
|
|
330
283
|
"condition": {
|
|
331
284
|
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type !== undefined;"
|
|
332
285
|
},
|
|
333
286
|
"items": [
|
|
334
287
|
{
|
|
335
288
|
"type": "fieldset",
|
|
336
|
-
"notitle":
|
|
337
|
-
"items": [
|
|
338
|
-
"accessories[].topicGetCurrentLockState",
|
|
339
|
-
"accessories[].topicGetTargetLockState",
|
|
340
|
-
"accessories[].topicSetTargetLockState"
|
|
341
|
-
],
|
|
289
|
+
"notitle": true,
|
|
342
290
|
"condition": {
|
|
343
291
|
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'LockMechanism';"
|
|
344
|
-
}
|
|
292
|
+
},
|
|
293
|
+
"items": [
|
|
294
|
+
{
|
|
295
|
+
"type": "div",
|
|
296
|
+
"displayFlex": true,
|
|
297
|
+
"flex-direction": "row",
|
|
298
|
+
"items": [
|
|
299
|
+
{
|
|
300
|
+
"key": "accessories[].topicGetCurrentLockState",
|
|
301
|
+
"flex": "0 0 50%"
|
|
302
|
+
}
|
|
303
|
+
]
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"type": "div",
|
|
307
|
+
"displayFlex": true,
|
|
308
|
+
"flex-direction": "row",
|
|
309
|
+
"items": [
|
|
310
|
+
{
|
|
311
|
+
"key": "accessories[].topicGetTargetLockState",
|
|
312
|
+
"flex": "0 0 50%"
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"key": "accessories[].topicSetTargetLockState",
|
|
316
|
+
"flex": "0 0 50%"
|
|
317
|
+
}
|
|
318
|
+
]
|
|
319
|
+
}
|
|
320
|
+
]
|
|
345
321
|
},
|
|
346
322
|
{
|
|
347
323
|
"type": "fieldset",
|
|
348
|
-
"notitle":
|
|
349
|
-
"items": [
|
|
350
|
-
"accessories[].topicGetOn",
|
|
351
|
-
"accessories[].topicSetOn"
|
|
352
|
-
],
|
|
324
|
+
"notitle": true,
|
|
353
325
|
"condition": {
|
|
354
326
|
"functionBody": "return ['Lightbulb', 'Outlet', 'Switch'].includes(model.accessories?.[arguments[1]]?.info?.type);"
|
|
355
|
-
}
|
|
327
|
+
},
|
|
328
|
+
"items": [
|
|
329
|
+
{
|
|
330
|
+
"type": "div",
|
|
331
|
+
"displayFlex": true,
|
|
332
|
+
"flex-direction": "row",
|
|
333
|
+
"items": [
|
|
334
|
+
{
|
|
335
|
+
"key": "accessories[].topicGetOn",
|
|
336
|
+
"flex": "0 0 50%"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"key": "accessories[].topicSetOn",
|
|
340
|
+
"flex": "0 0 50%"
|
|
341
|
+
}
|
|
342
|
+
]
|
|
343
|
+
}
|
|
344
|
+
]
|
|
356
345
|
},
|
|
357
346
|
{
|
|
358
347
|
"type": "fieldset",
|
|
359
|
-
"notitle":
|
|
360
|
-
"items": [
|
|
361
|
-
"accessories[].topicGetBrightness",
|
|
362
|
-
"accessories[].topicSetBrightness",
|
|
363
|
-
"accessories[].topicGetHue",
|
|
364
|
-
"accessories[].topicSetHue",
|
|
365
|
-
"accessories[].topicGetColorTemperature",
|
|
366
|
-
"accessories[].topicSetColorTemperature",
|
|
367
|
-
"accessories[].topicGetSaturation",
|
|
368
|
-
"accessories[].topicSetSaturation"
|
|
369
|
-
],
|
|
348
|
+
"notitle": true,
|
|
370
349
|
"condition": {
|
|
371
350
|
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'Lightbulb';"
|
|
372
|
-
}
|
|
351
|
+
},
|
|
352
|
+
"items": [
|
|
353
|
+
{
|
|
354
|
+
"type": "div",
|
|
355
|
+
"displayFlex": true,
|
|
356
|
+
"flex-direction": "row",
|
|
357
|
+
"items": [
|
|
358
|
+
{
|
|
359
|
+
"key": "accessories[].topicGetBrightness",
|
|
360
|
+
"flex": "0 0 50%"
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"key": "accessories[].topicSetBrightness",
|
|
364
|
+
"flex": "0 0 50%"
|
|
365
|
+
}
|
|
366
|
+
]
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"type": "div",
|
|
370
|
+
"displayFlex": true,
|
|
371
|
+
"flex-direction": "row",
|
|
372
|
+
"items": [
|
|
373
|
+
{
|
|
374
|
+
"key": "accessories[].topicGetHue",
|
|
375
|
+
"flex": "0 0 50%"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"key": "accessories[].topicSetHue",
|
|
379
|
+
"flex": "0 0 50%"
|
|
380
|
+
}
|
|
381
|
+
]
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
"type": "div",
|
|
385
|
+
"displayFlex": true,
|
|
386
|
+
"flex-direction": "row",
|
|
387
|
+
"items": [
|
|
388
|
+
{
|
|
389
|
+
"key": "accessories[].topicGetColorTemperature",
|
|
390
|
+
"flex": "0 0 50%"
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
"key": "accessories[].topicSetColorTemperature",
|
|
394
|
+
"flex": "0 0 50%"
|
|
395
|
+
}
|
|
396
|
+
]
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"type": "div",
|
|
400
|
+
"displayFlex": true,
|
|
401
|
+
"flex-direction": "row",
|
|
402
|
+
"items": [
|
|
403
|
+
{
|
|
404
|
+
"key": "accessories[].topicGetSaturation",
|
|
405
|
+
"flex": "0 0 50%"
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
"key": "accessories[].topicSetSaturation",
|
|
409
|
+
"flex": "0 0 50%"
|
|
410
|
+
}
|
|
411
|
+
]
|
|
412
|
+
}
|
|
413
|
+
]
|
|
373
414
|
},
|
|
374
415
|
{
|
|
375
416
|
"type": "fieldset",
|
|
376
|
-
"notitle":
|
|
377
|
-
"items": [
|
|
378
|
-
"accessories[].topicGetOutletInUse"
|
|
379
|
-
],
|
|
417
|
+
"notitle": true,
|
|
380
418
|
"condition": {
|
|
381
419
|
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'Outlet';"
|
|
382
|
-
}
|
|
420
|
+
},
|
|
421
|
+
"items": [
|
|
422
|
+
{
|
|
423
|
+
"type": "div",
|
|
424
|
+
"displayFlex": true,
|
|
425
|
+
"flex-direction": "row",
|
|
426
|
+
"items": [
|
|
427
|
+
{
|
|
428
|
+
"key": "accessories[].topicGetOutletInUse",
|
|
429
|
+
"flex": "0 0 50%"
|
|
430
|
+
}
|
|
431
|
+
]
|
|
432
|
+
}
|
|
433
|
+
]
|
|
383
434
|
},
|
|
384
435
|
{
|
|
385
436
|
"type": "fieldset",
|
|
386
|
-
"notitle":
|
|
387
|
-
"items": [
|
|
388
|
-
"accessories[].topicGetCurrentSecurityState",
|
|
389
|
-
"accessories[].topicGetTargetSecurityState",
|
|
390
|
-
"accessories[].topicSetTargetSecurityState",
|
|
391
|
-
"accessories[].topicGetStatusTampered",
|
|
392
|
-
"accessories[].topicGetStatusFault"
|
|
393
|
-
],
|
|
437
|
+
"notitle": true,
|
|
394
438
|
"condition": {
|
|
395
439
|
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'SecuritySystem';"
|
|
396
|
-
}
|
|
440
|
+
},
|
|
441
|
+
"items": [
|
|
442
|
+
{
|
|
443
|
+
"type": "div",
|
|
444
|
+
"displayFlex": true,
|
|
445
|
+
"flex-direction": "row",
|
|
446
|
+
"items": [
|
|
447
|
+
{
|
|
448
|
+
"key": "accessories[].topicGetCurrentSecurityState",
|
|
449
|
+
"flex": "0 0 50%"
|
|
450
|
+
}
|
|
451
|
+
]
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"type": "div",
|
|
455
|
+
"displayFlex": true,
|
|
456
|
+
"flex-direction": "row",
|
|
457
|
+
"items": [
|
|
458
|
+
{
|
|
459
|
+
"key": "accessories[].topicGetTargetSecurityState",
|
|
460
|
+
"flex": "0 0 50%"
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
"key": "accessories[].topicSetTargetSecurityState",
|
|
464
|
+
"flex": "0 0 50%"
|
|
465
|
+
}
|
|
466
|
+
]
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
"type": "div",
|
|
470
|
+
"displayFlex": true,
|
|
471
|
+
"flex-direction": "row",
|
|
472
|
+
"items": [
|
|
473
|
+
{
|
|
474
|
+
"key": "accessories[].topicGetStatusTampered",
|
|
475
|
+
"flex": "0 0 50%"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"key": "accessories[].topicGetStatusFault",
|
|
479
|
+
"flex": "0 0 50%"
|
|
480
|
+
}
|
|
481
|
+
]
|
|
482
|
+
}
|
|
483
|
+
]
|
|
397
484
|
},
|
|
398
485
|
{
|
|
399
486
|
"type": "div",
|
|
@@ -405,16 +492,41 @@
|
|
|
405
492
|
"items": [
|
|
406
493
|
{
|
|
407
494
|
"key": "accessories[].topicGetCurrentTemperature",
|
|
408
|
-
"flex": "
|
|
495
|
+
"flex": "0 0 67%"
|
|
409
496
|
},
|
|
410
497
|
{
|
|
411
498
|
"key": "accessories[].temperatureUnits",
|
|
412
499
|
"title": "${config.title.sourceUnits}",
|
|
413
|
-
"flex": "
|
|
500
|
+
"flex": "0 0 33%"
|
|
501
|
+
}
|
|
502
|
+
]
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
"type": "div",
|
|
506
|
+
"displayFlex": true,
|
|
507
|
+
"flex-direction": "row",
|
|
508
|
+
"items": [
|
|
509
|
+
{
|
|
510
|
+
"key": "accessories[].topicGetBatteryLevel",
|
|
511
|
+
"flex": "0 0 50%"
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"key": "accessories[].topicGetBatteryLow",
|
|
515
|
+
"flex": "0 0 50%"
|
|
414
516
|
}
|
|
415
517
|
]
|
|
416
518
|
},
|
|
417
|
-
|
|
519
|
+
{
|
|
520
|
+
"type": "div",
|
|
521
|
+
"displayFlex": true,
|
|
522
|
+
"flex-direction": "row",
|
|
523
|
+
"items": [
|
|
524
|
+
{
|
|
525
|
+
"key": "accessories[].topicGetStatusActive",
|
|
526
|
+
"flex": "0 0 50%"
|
|
527
|
+
}
|
|
528
|
+
]
|
|
529
|
+
}
|
|
418
530
|
]
|
|
419
531
|
},
|
|
420
532
|
{
|
|
@@ -534,6 +646,10 @@
|
|
|
534
646
|
"displayFlex": true,
|
|
535
647
|
"flex-direction": "row",
|
|
536
648
|
"items": [
|
|
649
|
+
{
|
|
650
|
+
"key": "accessories[].valueBatteryLow",
|
|
651
|
+
"flex": "0 0 25%"
|
|
652
|
+
},
|
|
537
653
|
{
|
|
538
654
|
"key": "accessories[].valueStatusActive",
|
|
539
655
|
"flex": "0 0 25%"
|
|
@@ -1,35 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { PlatformAccessory } from 'homebridge';
|
|
2
|
+
import { MQTTAccessory } from './mqtt.js';
|
|
3
|
+
import { CharacteristicType, BaseAccessoryConfig, ServiceType } from '../../model/types.js';
|
|
4
4
|
import { Log } from '../../tools/log.js';
|
|
5
|
-
export declare abstract class
|
|
6
|
-
|
|
7
|
-
protected
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
private
|
|
12
|
-
private
|
|
13
|
-
private
|
|
14
|
-
protected readonly accessoryService: Service;
|
|
15
|
-
constructor(Service: ServiceType, Characteristic: CharacteristicType, accessory: PlatformAccessory, config: C, log: Log, caller: string);
|
|
16
|
-
private onMQTTConnect;
|
|
17
|
-
protected abstract getAccessoryService(): Service;
|
|
18
|
-
protected bind(constructor: WithUUID<{
|
|
19
|
-
new (): Characteristic;
|
|
20
|
-
}>, getTopic: keyof C, getHandler: CharacteristicGetHandler, setTopic?: keyof C | undefined, setHandler?: CharacteristicSetHandler | undefined): void;
|
|
21
|
-
protected abstract addTopicHandlers(): void;
|
|
22
|
-
protected addTopicHandler(topicKey: keyof C, handler: (topic: string, value: PrimitiveTypes) => Promise<void>, assert?: boolean): void;
|
|
23
|
-
protected get name(): string;
|
|
24
|
-
protected getRawValue(property: keyof C, assert?: boolean): string | undefined;
|
|
25
|
-
protected getPrimitiveValue(property: keyof C, assert?: boolean): PrimitiveTypes | undefined;
|
|
26
|
-
protected publish(topic: string, value: PrimitiveTypes): void;
|
|
27
|
-
teardown(): void;
|
|
28
|
-
protected get(key: CharacteristicKey): CharacteristicValue;
|
|
29
|
-
protected set(key: CharacteristicKey, value: CharacteristicValue): void;
|
|
30
|
-
protected assert(...keys: (keyof C)[]): boolean;
|
|
31
|
-
protected assertNumber(value: PrimitiveTypes, error: string): boolean;
|
|
32
|
-
protected onUpdate(key: CharacteristicKey, value: CharacteristicValue, logString?: string | undefined): boolean;
|
|
33
|
-
protected onSet(key: CharacteristicKey, value: CharacteristicValue, publish: PrimitiveTypes, topic: keyof C, logString: string | undefined): void;
|
|
34
|
-
protected logIfDesired(message: string, ...parameters: string[]): void;
|
|
5
|
+
export declare abstract class BaseAccessory<C extends BaseAccessoryConfig = BaseAccessoryConfig> extends MQTTAccessory<C> {
|
|
6
|
+
constructor(Service: ServiceType, Characteristic: CharacteristicType, accessory: PlatformAccessory, config: C, log: Log);
|
|
7
|
+
protected addTopicHandlers(): void;
|
|
8
|
+
private getBatteryLevel;
|
|
9
|
+
private getBatteryLow;
|
|
10
|
+
private getStatusActive;
|
|
11
|
+
private onBatteryLevelUpdate;
|
|
12
|
+
private onBatteryLowUpdate;
|
|
13
|
+
private onStatusActiveUpdate;
|
|
35
14
|
}
|