@switchbot/homebridge-switchbot 4.1.1-beta.0 → 4.1.1-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 +14 -0
- package/config.schema.json +2 -2
- package/dist/device/blindtilt.js +104 -104
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.js +86 -86
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.js +98 -98
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.js +140 -140
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.js +47 -47
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts +1 -1
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +95 -93
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/device.d.ts +13 -13
- package/dist/device/device.d.ts.map +1 -1
- package/dist/device/device.js +46 -46
- package/dist/device/device.js.map +1 -1
- package/dist/device/fan.js +96 -96
- package/dist/device/fan.js.map +1 -1
- package/dist/device/hub.js +46 -46
- package/dist/device/hub.js.map +1 -1
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +85 -87
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/iosensor.js +44 -44
- package/dist/device/iosensor.js.map +1 -1
- package/dist/device/lightstrip.js +119 -119
- package/dist/device/lightstrip.js.map +1 -1
- package/dist/device/lock.js +75 -75
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.js +44 -44
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.js +42 -42
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/meterpro.js +42 -42
- package/dist/device/meterpro.js.map +1 -1
- package/dist/device/motion.js +44 -44
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +60 -60
- package/dist/device/plug.js.map +1 -1
- package/dist/device/robotvacuumcleaner.js +74 -74
- package/dist/device/robotvacuumcleaner.js.map +1 -1
- package/dist/device/waterdetector.d.ts.map +1 -1
- package/dist/device/waterdetector.js +54 -56
- package/dist/device/waterdetector.js.map +1 -1
- package/dist/irdevice/airconditioner.js +31 -31
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.js +10 -10
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.js +9 -9
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.js +11 -11
- package/dist/irdevice/fan.js.map +1 -1
- package/dist/irdevice/irdevice.js +11 -11
- package/dist/irdevice/irdevice.js.map +1 -1
- package/dist/irdevice/light.js +9 -9
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.js +93 -93
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.js +33 -33
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +9 -9
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.js +9 -9
- package/dist/irdevice/waterheater.js.map +1 -1
- package/dist/platform.js +228 -228
- package/dist/platform.js.map +1 -1
- package/docs/functions/default.html +1 -1
- package/package.json +9 -9
- package/src/device/blindtilt.ts +104 -104
- package/src/device/bot.ts +86 -86
- package/src/device/ceilinglight.ts +98 -98
- package/src/device/colorbulb.ts +140 -140
- package/src/device/contact.ts +47 -47
- package/src/device/curtain.ts +95 -93
- package/src/device/device.ts +46 -46
- package/src/device/fan.ts +96 -96
- package/src/device/hub.ts +46 -46
- package/src/device/humidifier.ts +85 -87
- package/src/device/iosensor.ts +44 -44
- package/src/device/lightstrip.ts +119 -119
- package/src/device/lock.ts +75 -75
- package/src/device/meter.ts +44 -44
- package/src/device/meterplus.ts +42 -42
- package/src/device/meterpro.ts +42 -42
- package/src/device/motion.ts +44 -44
- package/src/device/plug.ts +62 -62
- package/src/device/robotvacuumcleaner.ts +74 -74
- package/src/device/waterdetector.ts +54 -55
- package/src/irdevice/airconditioner.ts +31 -31
- package/src/irdevice/airpurifier.ts +10 -10
- package/src/irdevice/camera.ts +9 -9
- package/src/irdevice/fan.ts +11 -11
- package/src/irdevice/irdevice.ts +11 -11
- package/src/irdevice/light.ts +9 -9
- package/src/irdevice/other.ts +93 -93
- package/src/irdevice/tv.ts +33 -33
- package/src/irdevice/vacuumcleaner.ts +9 -9
- package/src/irdevice/waterheater.ts +9 -9
- package/src/platform.ts +228 -228
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"light.js","sourceRoot":"","sources":["../../src/irdevice/light.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAE5C;;;;GAIG;AACH,MAAM,OAAO,KAAM,SAAQ,YAAY;IAuB1B;IAtBX,WAAW;IACH,SAAS,CAIhB;IAEO,oBAAoB,CAK3B;IAEO,qBAAqB,CAK5B;IAED,YACW,QAA2B,EACpC,SAA4B,EAC5B,MAAkC;QAElC,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAA;QAJzB,aAAQ,GAAR,QAAQ,CAAmB;QAKpC,eAAe;QACf,SAAS,CAAC,QAAQ,wCAAgC,CAAA;QAElD,IAAI,CAAE,MAAwB,CAAC,SAAS,EAAE,CAAC;YACzC,+BAA+B;YAC/B,SAAS,CAAC,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,CAAA;YAC/D,IAAI,CAAC,SAAS,GAAG;gBACf,IAAI,EAAE,SAAS,CAAC,WAAW;gBAC3B,OAAO,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAY;gBACxH,EAAE,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,IAAI,KAAK;aAClC,CAAA;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G,CAAC,cAAc,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAAA;YAC3G,IAAI,CAAC,oBAAoB,EAAE,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,6BAA6B,EAAE,CAAC,CAAC,CAAA;YACjH,IAAI,CAAC,qBAAqB,EAAE,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAAA;YAC5G,IAAI,CAAC,qBAAqB,EAAE,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,6BAA6B,EAAE,CAAC,CAAC,CAAA;QACpH,CAAC;IACH,CAAC;CACF"}
|
package/dist/irdevice/other.js
CHANGED
|
@@ -26,7 +26,7 @@ export class Others extends irdeviceBase {
|
|
|
26
26
|
// default placeholders
|
|
27
27
|
this.getOtherConfigSettings(accessory, device);
|
|
28
28
|
// deviceType
|
|
29
|
-
if (this.otherDeviceType === '
|
|
29
|
+
if (this.otherDeviceType === 'Switch') {
|
|
30
30
|
// Set category
|
|
31
31
|
accessory.category = 8 /* this.hap.Categories.SWITCH */;
|
|
32
32
|
// Initialize Switch Service
|
|
@@ -50,7 +50,7 @@ export class Others extends irdeviceBase {
|
|
|
50
50
|
this.removeWindowCoveringService(accessory);
|
|
51
51
|
this.removeStatefulProgrammableSwitchService(accessory);
|
|
52
52
|
}
|
|
53
|
-
else if (this.otherDeviceType === '
|
|
53
|
+
else if (this.otherDeviceType === 'GarageDoor') {
|
|
54
54
|
// Set category
|
|
55
55
|
accessory.category = 4 /* this.hap.Categories.GARAGE_DOOR_OPENER */;
|
|
56
56
|
// Initialize GarageDoor Service
|
|
@@ -79,7 +79,7 @@ export class Others extends irdeviceBase {
|
|
|
79
79
|
this.removeWindowCoveringService(accessory);
|
|
80
80
|
this.removeStatefulProgrammableSwitchService(accessory);
|
|
81
81
|
}
|
|
82
|
-
else if (this.otherDeviceType === '
|
|
82
|
+
else if (this.otherDeviceType === 'Door') {
|
|
83
83
|
// Set category
|
|
84
84
|
accessory.category = 12 /* this.hap.Categories.DOOR */;
|
|
85
85
|
// Initialize Door Service
|
|
@@ -108,7 +108,7 @@ export class Others extends irdeviceBase {
|
|
|
108
108
|
this.removeWindowCoveringService(accessory);
|
|
109
109
|
this.removeStatefulProgrammableSwitchService(accessory);
|
|
110
110
|
}
|
|
111
|
-
else if (this.otherDeviceType === '
|
|
111
|
+
else if (this.otherDeviceType === 'Window') {
|
|
112
112
|
// Set category
|
|
113
113
|
accessory.category = 13 /* this.hap.Categories.WINDOW */;
|
|
114
114
|
// Initialize Window Service
|
|
@@ -137,7 +137,7 @@ export class Others extends irdeviceBase {
|
|
|
137
137
|
this.removeWindowCoveringService(accessory);
|
|
138
138
|
this.removeStatefulProgrammableSwitchService(accessory);
|
|
139
139
|
}
|
|
140
|
-
else if (this.otherDeviceType === '
|
|
140
|
+
else if (this.otherDeviceType === 'WindowCovering') {
|
|
141
141
|
// Set category
|
|
142
142
|
accessory.category = 14 /* this.hap.Categories.WINDOW_COVERING */;
|
|
143
143
|
// Initialize WindowCovering Service
|
|
@@ -166,7 +166,7 @@ export class Others extends irdeviceBase {
|
|
|
166
166
|
this.removeGarageDoorService(accessory);
|
|
167
167
|
this.removeStatefulProgrammableSwitchService(accessory);
|
|
168
168
|
}
|
|
169
|
-
else if (this.otherDeviceType === '
|
|
169
|
+
else if (this.otherDeviceType === 'Lock') {
|
|
170
170
|
// Set category
|
|
171
171
|
accessory.category = 6 /* this.hap.Categories.DOOR_LOCK */;
|
|
172
172
|
// Initialize Lock Service
|
|
@@ -190,7 +190,7 @@ export class Others extends irdeviceBase {
|
|
|
190
190
|
this.removeWindowCoveringService(accessory);
|
|
191
191
|
this.removeStatefulProgrammableSwitchService(accessory);
|
|
192
192
|
}
|
|
193
|
-
else if (this.otherDeviceType === '
|
|
193
|
+
else if (this.otherDeviceType === 'Faucet') {
|
|
194
194
|
// Set category
|
|
195
195
|
accessory.category = 29 /* this.hap.Categories.FAUCET */;
|
|
196
196
|
// Initialize Faucet Service
|
|
@@ -214,7 +214,7 @@ export class Others extends irdeviceBase {
|
|
|
214
214
|
this.removeWindowCoveringService(accessory);
|
|
215
215
|
this.removeStatefulProgrammableSwitchService(accessory);
|
|
216
216
|
}
|
|
217
|
-
else if (this.otherDeviceType === '
|
|
217
|
+
else if (this.otherDeviceType === 'Fan') {
|
|
218
218
|
// Set category
|
|
219
219
|
accessory.category = 3 /* this.hap.Categories.FAN */;
|
|
220
220
|
// Initialize Fan Service
|
|
@@ -238,7 +238,7 @@ export class Others extends irdeviceBase {
|
|
|
238
238
|
this.removeWindowCoveringService(accessory);
|
|
239
239
|
this.removeStatefulProgrammableSwitchService(accessory);
|
|
240
240
|
}
|
|
241
|
-
else if (this.otherDeviceType === '
|
|
241
|
+
else if (this.otherDeviceType === 'Stateful') {
|
|
242
242
|
// Set category
|
|
243
243
|
accessory.category = 15 /* this.hap.Categories.PROGRAMMABLE_SWITCH */;
|
|
244
244
|
// Initialize StatefulProgrammableSwitch Service
|
|
@@ -262,7 +262,7 @@ export class Others extends irdeviceBase {
|
|
|
262
262
|
this.removeGarageDoorService(accessory);
|
|
263
263
|
this.removeWindowCoveringService(accessory);
|
|
264
264
|
}
|
|
265
|
-
else if (this.otherDeviceType === '
|
|
265
|
+
else if (this.otherDeviceType === 'Outlet') {
|
|
266
266
|
// Set category
|
|
267
267
|
accessory.category = 7 /* this.hap.Categories.OUTLET */;
|
|
268
268
|
// Initialize Switch property
|
|
@@ -294,57 +294,57 @@ export class Others extends irdeviceBase {
|
|
|
294
294
|
* Handle requests to set the "On" characteristic
|
|
295
295
|
*/
|
|
296
296
|
async OnSet(value) {
|
|
297
|
-
if (this.otherDeviceType === '
|
|
297
|
+
if (this.otherDeviceType === 'Switch') {
|
|
298
298
|
if (this.Switch) {
|
|
299
|
-
|
|
299
|
+
this.debugLog(`Set On: ${value}`);
|
|
300
300
|
this.On = value !== false;
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
else if (this.otherDeviceType === '
|
|
303
|
+
else if (this.otherDeviceType === 'GarageDoor') {
|
|
304
304
|
if (this.GarageDoor) {
|
|
305
|
-
|
|
305
|
+
this.debugLog(`Set TargetDoorState: ${value}`);
|
|
306
306
|
this.On = value !== this.hap.Characteristic.TargetDoorState.CLOSED;
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
else if (this.otherDeviceType === '
|
|
309
|
+
else if (this.otherDeviceType === 'Door') {
|
|
310
310
|
if (this.Door) {
|
|
311
|
-
|
|
311
|
+
this.debugLog(`Set TargetPosition: ${value}`);
|
|
312
312
|
this.On = value !== 0;
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
|
-
else if (this.otherDeviceType === '
|
|
315
|
+
else if (this.otherDeviceType === 'Window') {
|
|
316
316
|
if (this.Window) {
|
|
317
|
-
|
|
317
|
+
this.debugLog(`Set TargetPosition: ${value}`);
|
|
318
318
|
this.On = value !== 0;
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
|
-
else if (this.otherDeviceType === '
|
|
321
|
+
else if (this.otherDeviceType === 'WindowCovering') {
|
|
322
322
|
if (this.WindowCovering) {
|
|
323
|
-
|
|
323
|
+
this.debugLog(`Set TargetPosition: ${value}`);
|
|
324
324
|
this.On = value !== 0;
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
|
-
else if (this.otherDeviceType === '
|
|
327
|
+
else if (this.otherDeviceType === 'Lock') {
|
|
328
328
|
if (this.LockMechanism) {
|
|
329
|
-
|
|
329
|
+
this.debugLog(`Set LockTargetState: ${value}`);
|
|
330
330
|
this.On = value !== this.hap.Characteristic.LockTargetState.SECURED;
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
|
-
else if (this.otherDeviceType === '
|
|
333
|
+
else if (this.otherDeviceType === 'Faucet') {
|
|
334
334
|
if (this.Faucet) {
|
|
335
|
-
|
|
335
|
+
this.debugLog(`Set Active: ${value}`);
|
|
336
336
|
this.On = value !== this.hap.Characteristic.Active.INACTIVE;
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
else if (this.otherDeviceType === '
|
|
339
|
+
else if (this.otherDeviceType === 'Stateful') {
|
|
340
340
|
if (this.StatefulProgrammableSwitch) {
|
|
341
|
-
|
|
341
|
+
this.debugLog(`Set ProgrammableSwitchOutputState: ${value}`);
|
|
342
342
|
this.On = value !== 0;
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
else {
|
|
346
346
|
if (this.Outlet) {
|
|
347
|
-
|
|
347
|
+
this.debugLog(`Set On: ${value}`);
|
|
348
348
|
this.On = value !== false;
|
|
349
349
|
}
|
|
350
350
|
}
|
|
@@ -367,7 +367,7 @@ export class Others extends irdeviceBase {
|
|
|
367
367
|
* Other - "command" "channelSub" "default" = previous channel
|
|
368
368
|
*/
|
|
369
369
|
async pushOnChanges(On) {
|
|
370
|
-
|
|
370
|
+
this.debugLog(`pushOnChanges On: ${On}, disablePushOn: ${this.disablePushOn}, customize: ${this.device.customize}, customOn: ${this.device.customOn}`);
|
|
371
371
|
if (this.device.customize) {
|
|
372
372
|
if (On === true && !this.disablePushOn) {
|
|
373
373
|
const commandType = await this.commandType();
|
|
@@ -385,7 +385,7 @@ export class Others extends irdeviceBase {
|
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
async pushOffChanges(On) {
|
|
388
|
-
|
|
388
|
+
this.debugLog(`pushOffChanges On: ${On}, disablePushOff: ${this.disablePushOff}, customize: ${this.device.customize}, customOff: ${this.device.customOff}`);
|
|
389
389
|
if (this.device.customize) {
|
|
390
390
|
if (On === false && !this.disablePushOff) {
|
|
391
391
|
const commandType = await this.commandType();
|
|
@@ -403,12 +403,12 @@ export class Others extends irdeviceBase {
|
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
405
|
async pushChanges(bodyChange) {
|
|
406
|
-
|
|
406
|
+
this.debugLog('pushChanges');
|
|
407
407
|
if (this.device.connectionType === 'OpenAPI') {
|
|
408
|
-
|
|
408
|
+
this.infoLog(`Sending request to SwitchBot API, body: ${JSON.stringify(bodyChange)}`);
|
|
409
409
|
try {
|
|
410
|
-
const
|
|
411
|
-
const deviceStatus =
|
|
410
|
+
const response = await this.pushChangeRequest(bodyChange);
|
|
411
|
+
const deviceStatus = response.body;
|
|
412
412
|
await this.pushStatusCodes(deviceStatus);
|
|
413
413
|
if (await this.successfulStatusCodes(deviceStatus)) {
|
|
414
414
|
await this.successfulPushChange(deviceStatus, bodyChange);
|
|
@@ -424,232 +424,232 @@ export class Others extends irdeviceBase {
|
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
426
|
else {
|
|
427
|
-
|
|
427
|
+
this.warnLog(`Connection Type: ${this.device.connectionType}, commands will not be sent to OpenAPI`);
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
async updateHomeKitCharacteristics() {
|
|
431
|
-
|
|
431
|
+
this.debugLog('updateHomeKitCharacteristics');
|
|
432
432
|
// State
|
|
433
|
-
if (this.otherDeviceType === '
|
|
433
|
+
if (this.otherDeviceType === 'Switch' && this.Switch) {
|
|
434
434
|
if (this.On === undefined) {
|
|
435
|
-
|
|
435
|
+
this.debugLog(`On: ${this.On}`);
|
|
436
436
|
}
|
|
437
437
|
else {
|
|
438
438
|
this.Switch.Service.updateCharacteristic(this.hap.Characteristic.On, this.On);
|
|
439
|
-
|
|
439
|
+
this.debugLog(`updateCharacteristic On: ${this.On}`);
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
|
-
else if (this.otherDeviceType === '
|
|
442
|
+
else if (this.otherDeviceType === 'GarageDoor' && this.GarageDoor) {
|
|
443
443
|
if (this.On === undefined) {
|
|
444
|
-
|
|
444
|
+
this.debugLog(`On: ${this.On}`);
|
|
445
445
|
}
|
|
446
446
|
else {
|
|
447
447
|
if (this.On) {
|
|
448
448
|
this.GarageDoor.Service.updateCharacteristic(this.hap.Characteristic.TargetDoorState, this.hap.Characteristic.TargetDoorState.OPEN);
|
|
449
449
|
this.GarageDoor.Service.updateCharacteristic(this.hap.Characteristic.CurrentDoorState, this.hap.Characteristic.CurrentDoorState.OPEN);
|
|
450
|
-
|
|
450
|
+
this.debugLog(`updateCharacteristic TargetDoorState: Open, CurrentDoorState: Open (${this.On})`);
|
|
451
451
|
}
|
|
452
452
|
else {
|
|
453
453
|
this.GarageDoor.Service.updateCharacteristic(this.hap.Characteristic.TargetDoorState, this.hap.Characteristic.TargetDoorState.CLOSED);
|
|
454
454
|
this.GarageDoor.Service.updateCharacteristic(this.hap.Characteristic.CurrentDoorState, this.hap.Characteristic.CurrentDoorState.CLOSED);
|
|
455
|
-
|
|
455
|
+
this.debugLog(`updateCharacteristicc TargetDoorState: Closed, CurrentDoorState: Closed (${this.On})`);
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
|
-
|
|
458
|
+
this.debugLog(`Garage Door On: ${this.On}`);
|
|
459
459
|
}
|
|
460
|
-
else if (this.otherDeviceType === '
|
|
460
|
+
else if (this.otherDeviceType === 'Door' && this.Door) {
|
|
461
461
|
if (this.On === undefined) {
|
|
462
|
-
|
|
462
|
+
this.debugLog(`On: ${this.On}`);
|
|
463
463
|
}
|
|
464
464
|
else {
|
|
465
465
|
if (this.On) {
|
|
466
466
|
this.Door.Service.updateCharacteristic(this.hap.Characteristic.TargetPosition, 100);
|
|
467
467
|
this.Door.Service.updateCharacteristic(this.hap.Characteristic.CurrentPosition, 100);
|
|
468
468
|
this.Door.Service.updateCharacteristic(this.hap.Characteristic.PositionState, this.hap.Characteristic.PositionState.STOPPED);
|
|
469
|
-
|
|
469
|
+
this.debugLog(`updateCharacteristicc TargetPosition: 100, CurrentPosition: 100 (${this.On})`);
|
|
470
470
|
}
|
|
471
471
|
else {
|
|
472
472
|
this.Door.Service.updateCharacteristic(this.hap.Characteristic.TargetPosition, 0);
|
|
473
473
|
this.Door.Service.updateCharacteristic(this.hap.Characteristic.CurrentPosition, 0);
|
|
474
474
|
this.Door.Service.updateCharacteristic(this.hap.Characteristic.PositionState, this.hap.Characteristic.PositionState.STOPPED);
|
|
475
|
-
|
|
475
|
+
this.debugLog(`updateCharacteristicc TargetPosition: 0, CurrentPosition: 0 (${this.On})`);
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
|
-
|
|
478
|
+
this.debugLog(`Door On: ${this.On}`);
|
|
479
479
|
}
|
|
480
|
-
else if (this.otherDeviceType === '
|
|
480
|
+
else if (this.otherDeviceType === 'Window' && this.Window) {
|
|
481
481
|
if (this.On === undefined) {
|
|
482
|
-
|
|
482
|
+
this.debugLog(`On: ${this.On}`);
|
|
483
483
|
}
|
|
484
484
|
else {
|
|
485
485
|
if (this.On) {
|
|
486
486
|
this.Window.Service.updateCharacteristic(this.hap.Characteristic.TargetPosition, 100);
|
|
487
487
|
this.Window.Service.updateCharacteristic(this.hap.Characteristic.CurrentPosition, 100);
|
|
488
488
|
this.Window.Service.updateCharacteristic(this.hap.Characteristic.PositionState, this.hap.Characteristic.PositionState.STOPPED);
|
|
489
|
-
|
|
489
|
+
this.debugLog(`updateCharacteristicc TargetPosition: 100, CurrentPosition: 100 (${this.On})`);
|
|
490
490
|
}
|
|
491
491
|
else {
|
|
492
492
|
this.Window.Service.updateCharacteristic(this.hap.Characteristic.TargetPosition, 0);
|
|
493
493
|
this.Window.Service.updateCharacteristic(this.hap.Characteristic.CurrentPosition, 0);
|
|
494
494
|
this.Window.Service.updateCharacteristic(this.hap.Characteristic.PositionState, this.hap.Characteristic.PositionState.STOPPED);
|
|
495
|
-
|
|
495
|
+
this.debugLog(`updateCharacteristicc TargetPosition: 0, CurrentPosition: 0 (${this.On})`);
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
-
|
|
498
|
+
this.debugLog(`Window On: ${this.On}`);
|
|
499
499
|
}
|
|
500
|
-
else if (this.otherDeviceType === '
|
|
500
|
+
else if (this.otherDeviceType === 'WindowCovering' && this.WindowCovering) {
|
|
501
501
|
if (this.On === undefined) {
|
|
502
|
-
|
|
502
|
+
this.debugLog(`On: ${this.On}`);
|
|
503
503
|
}
|
|
504
504
|
else {
|
|
505
505
|
if (this.On) {
|
|
506
506
|
this.WindowCovering.Service.updateCharacteristic(this.hap.Characteristic.TargetPosition, 100);
|
|
507
507
|
this.WindowCovering.Service.updateCharacteristic(this.hap.Characteristic.CurrentPosition, 100);
|
|
508
508
|
this.WindowCovering.Service.updateCharacteristic(this.hap.Characteristic.PositionState, this.hap.Characteristic.PositionState.STOPPED);
|
|
509
|
-
|
|
509
|
+
this.debugLog(`updateCharacteristicc TargetPosition: 100, CurrentPosition: 100 (${this.On})`);
|
|
510
510
|
}
|
|
511
511
|
else {
|
|
512
512
|
this.WindowCovering.Service.updateCharacteristic(this.hap.Characteristic.TargetPosition, 0);
|
|
513
513
|
this.WindowCovering.Service.updateCharacteristic(this.hap.Characteristic.CurrentPosition, 0);
|
|
514
514
|
this.WindowCovering.Service.updateCharacteristic(this.hap.Characteristic.PositionState, this.hap.Characteristic.PositionState.STOPPED);
|
|
515
|
-
|
|
515
|
+
this.debugLog(`updateCharacteristicc TargetPosition: 0, CurrentPosition: 0 (${this.On})`);
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
|
|
518
|
+
this.debugLog(`Window Covering On: ${this.On}`);
|
|
519
519
|
}
|
|
520
|
-
else if (this.otherDeviceType === '
|
|
520
|
+
else if (this.otherDeviceType === 'Lock' && this.LockMechanism) {
|
|
521
521
|
if (this.On === undefined) {
|
|
522
|
-
|
|
522
|
+
this.debugLog(`On: ${this.On}`);
|
|
523
523
|
}
|
|
524
524
|
else {
|
|
525
525
|
if (this.On) {
|
|
526
526
|
this.LockMechanism.Service.updateCharacteristic(this.hap.Characteristic.LockTargetState, this.hap.Characteristic.LockTargetState.UNSECURED);
|
|
527
527
|
this.LockMechanism.Service.updateCharacteristic(this.hap.Characteristic.LockCurrentState, this.hap.Characteristic.LockCurrentState.UNSECURED);
|
|
528
|
-
|
|
528
|
+
this.debugLog(`updateCharacteristicc LockTargetState: UNSECURED, LockCurrentState: UNSECURED (${this.On})`);
|
|
529
529
|
}
|
|
530
530
|
else {
|
|
531
531
|
this.LockMechanism.Service.updateCharacteristic(this.hap.Characteristic.LockTargetState, this.hap.Characteristic.LockTargetState.SECURED);
|
|
532
532
|
this.LockMechanism.Service.updateCharacteristic(this.hap.Characteristic.LockCurrentState, this.hap.Characteristic.LockCurrentState.SECURED);
|
|
533
|
-
|
|
533
|
+
this.debugLog(`updateCharacteristic LockTargetState: SECURED, LockCurrentState: SECURED (${this.On})`);
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
|
-
|
|
536
|
+
this.debugLog(`Lock On: ${this.On}`);
|
|
537
537
|
}
|
|
538
|
-
else if (this.otherDeviceType === '
|
|
538
|
+
else if (this.otherDeviceType === 'Faucet' && this.Faucet) {
|
|
539
539
|
if (this.On === undefined) {
|
|
540
|
-
|
|
540
|
+
this.debugLog(`On: ${this.On}`);
|
|
541
541
|
}
|
|
542
542
|
else {
|
|
543
543
|
if (this.On) {
|
|
544
544
|
this.Faucet.Service.updateCharacteristic(this.hap.Characteristic.Active, this.hap.Characteristic.Active.ACTIVE);
|
|
545
|
-
|
|
545
|
+
this.debugLog(`updateCharacteristic Active: ${this.On}`);
|
|
546
546
|
}
|
|
547
547
|
else {
|
|
548
548
|
this.Faucet.Service.updateCharacteristic(this.hap.Characteristic.Active, this.hap.Characteristic.Active.INACTIVE);
|
|
549
|
-
|
|
549
|
+
this.debugLog(`updateCharacteristic Active: ${this.On}`);
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
|
-
|
|
552
|
+
this.debugLog(`Faucet On: ${this.On}`);
|
|
553
553
|
}
|
|
554
|
-
else if (this.otherDeviceType === '
|
|
554
|
+
else if (this.otherDeviceType === 'Fan' && this.Fan) {
|
|
555
555
|
if (this.On === undefined) {
|
|
556
|
-
|
|
556
|
+
this.debugLog(`On: ${this.On}`);
|
|
557
557
|
}
|
|
558
558
|
else {
|
|
559
559
|
if (this.On) {
|
|
560
560
|
this.Fan.Service.updateCharacteristic(this.hap.Characteristic.Active, this.hap.Characteristic.Active.ACTIVE);
|
|
561
|
-
|
|
561
|
+
this.debugLog(`updateCharacteristic Active: ${this.On}`);
|
|
562
562
|
}
|
|
563
563
|
else {
|
|
564
564
|
this.Fan.Service.updateCharacteristic(this.hap.Characteristic.Active, this.hap.Characteristic.Active.INACTIVE);
|
|
565
|
-
|
|
565
|
+
this.debugLog(`updateCharacteristic Active: ${this.On}`);
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
|
-
|
|
568
|
+
this.debugLog(`Fan On: ${this.On}`);
|
|
569
569
|
}
|
|
570
|
-
else if (this.otherDeviceType === '
|
|
570
|
+
else if (this.otherDeviceType === 'Stateful' && this.StatefulProgrammableSwitch) {
|
|
571
571
|
if (this.On === undefined) {
|
|
572
|
-
|
|
572
|
+
this.debugLog(`On: ${this.On}`);
|
|
573
573
|
}
|
|
574
574
|
else {
|
|
575
575
|
if (this.On) {
|
|
576
576
|
this.StatefulProgrammableSwitch.Service.updateCharacteristic(this.hap.Characteristic.ProgrammableSwitchEvent, this.hap.Characteristic.ProgrammableSwitchEvent.SINGLE_PRESS);
|
|
577
577
|
this.StatefulProgrammableSwitch.Service.updateCharacteristic(this.hap.Characteristic.ProgrammableSwitchOutputState, 1);
|
|
578
|
-
|
|
578
|
+
this.debugLog(`updateCharacteristic ProgrammableSwitchEvent: ProgrammableSwitchOutputState: (${this.On})`);
|
|
579
579
|
}
|
|
580
580
|
else {
|
|
581
581
|
this.StatefulProgrammableSwitch.Service.updateCharacteristic(this.hap.Characteristic.ProgrammableSwitchEvent, this.hap.Characteristic.ProgrammableSwitchEvent.SINGLE_PRESS);
|
|
582
582
|
this.StatefulProgrammableSwitch.Service.updateCharacteristic(this.hap.Characteristic.ProgrammableSwitchOutputState, 0);
|
|
583
|
-
|
|
583
|
+
this.debugLog(`updateCharacteristic ProgrammableSwitchEvent: ProgrammableSwitchOutputState: (${this.On})`);
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
|
-
|
|
586
|
+
this.debugLog(`StatefulProgrammableSwitch On: ${this.On}`);
|
|
587
587
|
}
|
|
588
|
-
else if (this.otherDeviceType === '
|
|
588
|
+
else if (this.otherDeviceType === 'Outlet' && this.Outlet) {
|
|
589
589
|
if (this.On === undefined) {
|
|
590
|
-
|
|
590
|
+
this.debugLog(`On: ${this.On}`);
|
|
591
591
|
}
|
|
592
592
|
else {
|
|
593
593
|
this.Outlet.Service.updateCharacteristic(this.hap.Characteristic.On, this.On);
|
|
594
|
-
|
|
594
|
+
this.debugLog(`updateCharacteristic On: ${this.On}`);
|
|
595
595
|
}
|
|
596
596
|
}
|
|
597
597
|
else {
|
|
598
|
-
|
|
598
|
+
this.errorLog(`otherDeviceType: ${this.otherDeviceType}, On: ${this.On}`);
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
601
|
async apiError(e) {
|
|
602
|
-
if (this.otherDeviceType === '
|
|
602
|
+
if (this.otherDeviceType === 'GarageDoor') {
|
|
603
603
|
if (this.GarageDoor) {
|
|
604
604
|
this.GarageDoor.Service.updateCharacteristic(this.hap.Characteristic.TargetDoorState, e);
|
|
605
605
|
this.GarageDoor.Service.updateCharacteristic(this.hap.Characteristic.CurrentDoorState, e);
|
|
606
606
|
this.GarageDoor.Service.updateCharacteristic(this.hap.Characteristic.ObstructionDetected, e);
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
|
-
else if (this.otherDeviceType === '
|
|
609
|
+
else if (this.otherDeviceType === 'Door') {
|
|
610
610
|
if (this.Door) {
|
|
611
611
|
this.Door.Service.updateCharacteristic(this.hap.Characteristic.TargetPosition, e);
|
|
612
612
|
this.Door.Service.updateCharacteristic(this.hap.Characteristic.CurrentPosition, e);
|
|
613
613
|
this.Door.Service.updateCharacteristic(this.hap.Characteristic.PositionState, e);
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
|
-
else if (this.otherDeviceType === '
|
|
616
|
+
else if (this.otherDeviceType === 'Window') {
|
|
617
617
|
if (this.Window) {
|
|
618
618
|
this.Window.Service.updateCharacteristic(this.hap.Characteristic.TargetPosition, e);
|
|
619
619
|
this.Window.Service.updateCharacteristic(this.hap.Characteristic.CurrentPosition, e);
|
|
620
620
|
this.Window.Service.updateCharacteristic(this.hap.Characteristic.PositionState, e);
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
|
-
else if (this.otherDeviceType === '
|
|
623
|
+
else if (this.otherDeviceType === 'WindowCovering') {
|
|
624
624
|
if (this.WindowCovering) {
|
|
625
625
|
this.WindowCovering.Service.updateCharacteristic(this.hap.Characteristic.TargetPosition, e);
|
|
626
626
|
this.WindowCovering.Service.updateCharacteristic(this.hap.Characteristic.CurrentPosition, e);
|
|
627
627
|
this.WindowCovering.Service.updateCharacteristic(this.hap.Characteristic.PositionState, e);
|
|
628
628
|
}
|
|
629
629
|
}
|
|
630
|
-
else if (this.otherDeviceType === '
|
|
630
|
+
else if (this.otherDeviceType === 'Lock') {
|
|
631
631
|
if (this.LockMechanism) {
|
|
632
632
|
this.LockMechanism.Service.updateCharacteristic(this.hap.Characteristic.LockTargetState, e);
|
|
633
633
|
this.LockMechanism.Service.updateCharacteristic(this.hap.Characteristic.LockCurrentState, e);
|
|
634
634
|
}
|
|
635
635
|
}
|
|
636
|
-
else if (this.otherDeviceType === '
|
|
636
|
+
else if (this.otherDeviceType === 'Faucet') {
|
|
637
637
|
if (this.Faucet) {
|
|
638
638
|
this.Faucet.Service.updateCharacteristic(this.hap.Characteristic.Active, e);
|
|
639
639
|
}
|
|
640
640
|
}
|
|
641
|
-
else if (this.otherDeviceType === '
|
|
641
|
+
else if (this.otherDeviceType === 'Fan') {
|
|
642
642
|
if (this.Fan) {
|
|
643
643
|
this.Fan.Service.updateCharacteristic(this.hap.Characteristic.On, e);
|
|
644
644
|
}
|
|
645
645
|
}
|
|
646
|
-
else if (this.otherDeviceType === '
|
|
646
|
+
else if (this.otherDeviceType === 'Stateful') {
|
|
647
647
|
if (this.StatefulProgrammableSwitch) {
|
|
648
648
|
this.StatefulProgrammableSwitch.Service.updateCharacteristic(this.hap.Characteristic.ProgrammableSwitchEvent, e);
|
|
649
649
|
this.StatefulProgrammableSwitch.Service.updateCharacteristic(this.hap.Characteristic.ProgrammableSwitchOutputState, e);
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
|
-
else if (this.otherDeviceType === '
|
|
652
|
+
else if (this.otherDeviceType === 'Switch') {
|
|
653
653
|
if (this.Switch) {
|
|
654
654
|
this.Switch.Service.updateCharacteristic(this.hap.Characteristic.On, e);
|
|
655
655
|
}
|
|
@@ -771,9 +771,9 @@ export class Others extends irdeviceBase {
|
|
|
771
771
|
accessory.removeService(this.Switch.Service);
|
|
772
772
|
}
|
|
773
773
|
async getOtherConfigSettings(accessory, device) {
|
|
774
|
-
this.otherDeviceType = device.type ?? '
|
|
774
|
+
this.otherDeviceType = device.type ?? 'Outlet';
|
|
775
775
|
const deviceType = device.type ? 'Device Config' : 'Default';
|
|
776
|
-
|
|
776
|
+
this.debugLog(`Use ${deviceType} Device Type: ${this.otherDeviceType}`);
|
|
777
777
|
}
|
|
778
778
|
}
|
|
779
779
|
//# sourceMappingURL=other.js.map
|