@switchbot/homebridge-switchbot 3.5.1-beta.12 → 3.5.1-beta.3
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/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.d.ts.map +1 -1
- package/dist/device/ceilinglight.js +9 -6
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +3 -7
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/device.js +9 -9
- package/dist/device/device.js.map +1 -1
- package/dist/device/fan.js.map +1 -1
- package/dist/device/waterdetector.d.ts.map +1 -1
- package/dist/device/waterdetector.js +3 -5
- package/dist/device/waterdetector.js.map +1 -1
- package/dist/irdevice/airconditioner.d.ts +3 -1
- package/dist/irdevice/airconditioner.d.ts.map +1 -1
- package/dist/irdevice/airconditioner.js +103 -44
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.d.ts +1 -0
- package/dist/irdevice/airpurifier.d.ts.map +1 -1
- package/dist/irdevice/airpurifier.js +49 -18
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.d.ts.map +1 -1
- package/dist/irdevice/camera.js +9 -9
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.d.ts.map +1 -1
- package/dist/irdevice/fan.js +19 -19
- package/dist/irdevice/fan.js.map +1 -1
- package/dist/irdevice/irdevice.d.ts +10 -22
- package/dist/irdevice/irdevice.d.ts.map +1 -1
- package/dist/irdevice/irdevice.js +67 -89
- package/dist/irdevice/irdevice.js.map +1 -1
- package/dist/irdevice/light.d.ts.map +1 -1
- package/dist/irdevice/light.js +17 -15
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.d.ts.map +1 -1
- package/dist/irdevice/other.js +76 -76
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.d.ts.map +1 -1
- package/dist/irdevice/tv.js +35 -35
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +9 -9
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.d.ts.map +1 -1
- package/dist/irdevice/waterheater.js +9 -9
- package/dist/irdevice/waterheater.js.map +1 -1
- package/dist/platform.d.ts +12 -14
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +245 -245
- package/dist/platform.js.map +1 -1
- package/dist/types/devicewebhookstatus.d.ts +1 -1
- package/dist/types/devicewebhookstatus.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/device/blindtilt.ts +1 -1
- package/src/device/bot.ts +1 -1
- package/src/device/ceilinglight.ts +15 -7
- package/src/device/colorbulb.ts +11 -8
- package/src/device/curtain.ts +1 -1
- package/src/device/device.ts +9 -9
- package/src/device/fan.ts +1 -1
- package/src/device/waterdetector.ts +3 -5
- package/src/irdevice/airconditioner.ts +97 -53
- package/src/irdevice/airpurifier.ts +45 -23
- package/src/irdevice/camera.ts +9 -9
- package/src/irdevice/fan.ts +19 -19
- package/src/irdevice/irdevice.ts +68 -92
- package/src/irdevice/light.ts +17 -15
- package/src/irdevice/other.ts +76 -76
- package/src/irdevice/tv.ts +35 -35
- package/src/irdevice/vacuumcleaner.ts +9 -9
- package/src/irdevice/waterheater.ts +9 -9
- package/src/platform.ts +247 -247
- package/src/types/devicewebhookstatus.ts +1 -1
package/src/irdevice/light.ts
CHANGED
|
@@ -127,7 +127,7 @@ export class Light extends irdeviceBase {
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
async OnSet(value: CharacteristicValue): Promise<void> {
|
|
130
|
-
|
|
130
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} On: ${value}`);
|
|
131
131
|
|
|
132
132
|
this.LightBulb!.On = value;
|
|
133
133
|
if (this.LightBulb?.On) {
|
|
@@ -144,7 +144,7 @@ export class Light extends irdeviceBase {
|
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
async ProgrammableSwitchOutputStateSetOn(value: CharacteristicValue): Promise<void> {
|
|
147
|
-
|
|
147
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} On: ${value}`);
|
|
148
148
|
|
|
149
149
|
this.ProgrammableSwitchOn!.ProgrammableSwitchOutputState = value;
|
|
150
150
|
if (this.ProgrammableSwitchOn?.ProgrammableSwitchOutputState === 1) {
|
|
@@ -158,7 +158,7 @@ export class Light extends irdeviceBase {
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
async ProgrammableSwitchOutputStateSetOff(value: CharacteristicValue): Promise<void> {
|
|
161
|
-
|
|
161
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} On: ${value}`);
|
|
162
162
|
|
|
163
163
|
this.ProgrammableSwitchOff!.ProgrammableSwitchOutputState = value;
|
|
164
164
|
if (this.ProgrammableSwitchOff?.ProgrammableSwitchOutputState === 1) {
|
|
@@ -184,7 +184,7 @@ export class Light extends irdeviceBase {
|
|
|
184
184
|
* Light - "command" "channelSub" "default" = previous channel
|
|
185
185
|
*/
|
|
186
186
|
async pushLightOnChanges(On: boolean): Promise<void> {
|
|
187
|
-
|
|
187
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushLightOnChanges On: ${On}, disablePushOn: ${this.disablePushOn}`);
|
|
188
188
|
if (On === true && this.disablePushOn === false) {
|
|
189
189
|
const commandType: string = await this.commandType();
|
|
190
190
|
const command: string = await this.commandOn();
|
|
@@ -198,7 +198,7 @@ export class Light extends irdeviceBase {
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
async pushLightOffChanges(On: boolean): Promise<void> {
|
|
201
|
-
|
|
201
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushLightOffChanges On: ${On}, disablePushOff: ${this.disablePushOff}`);
|
|
202
202
|
if (On === false && this.disablePushOff === false) {
|
|
203
203
|
const commandType: string = await this.commandType();
|
|
204
204
|
const command: string = await this.commandOff();
|
|
@@ -212,9 +212,9 @@ export class Light extends irdeviceBase {
|
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
async pushChanges(bodyChange: any, On: boolean): Promise<void> {
|
|
215
|
-
this.debugLog(
|
|
215
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushChanges`);
|
|
216
216
|
if (this.device.connectionType === 'OpenAPI') {
|
|
217
|
-
this.infoLog(
|
|
217
|
+
this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
218
218
|
try {
|
|
219
219
|
const { body, statusCode } = await this.pushChangeRequest(bodyChange);
|
|
220
220
|
const deviceStatus: any = await body.json();
|
|
@@ -232,41 +232,43 @@ export class Light extends irdeviceBase {
|
|
|
232
232
|
await this.pushChangeError(e);
|
|
233
233
|
}
|
|
234
234
|
} else {
|
|
235
|
-
this.warnLog(
|
|
235
|
+
this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName} Connection Type: `
|
|
236
236
|
+ `${this.device.connectionType}, commands will not be sent to OpenAPI`);
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
async updateHomeKitCharacteristics(): Promise<void> {
|
|
241
|
-
await this.debugLog('updateHomeKitCharacteristics');
|
|
242
241
|
if (!this.device.irlight?.stateless) {
|
|
243
242
|
// On
|
|
244
243
|
if (this.LightBulb?.On === undefined) {
|
|
245
|
-
|
|
244
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} On: ${this.LightBulb?.On}`);
|
|
246
245
|
} else {
|
|
247
246
|
this.accessory.context.On = this.LightBulb.On;
|
|
248
247
|
this.LightBulb?.Service.updateCharacteristic(this.hap.Characteristic.On, this.LightBulb.On);
|
|
249
|
-
|
|
248
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic On: ${this.LightBulb.On}`);
|
|
250
249
|
}
|
|
251
250
|
} else {
|
|
252
251
|
// On Stateful Programmable Switch
|
|
253
252
|
if (this.ProgrammableSwitchOn?.ProgrammableSwitchOutputState === undefined) {
|
|
254
|
-
|
|
253
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName}`
|
|
254
|
+
+ ` ProgrammableSwitchOutputStateOn: ${this.ProgrammableSwitchOn?.ProgrammableSwitchOutputState}`);
|
|
255
255
|
} else {
|
|
256
256
|
this.accessory.context.ProgrammableSwitchOutputStateOn = this.ProgrammableSwitchOn.ProgrammableSwitchOutputState;
|
|
257
257
|
this.ProgrammableSwitchOn?.Service.updateCharacteristic(this.hap.Characteristic.ProgrammableSwitchOutputState,
|
|
258
258
|
this.ProgrammableSwitchOn.ProgrammableSwitchOutputState);
|
|
259
|
-
this.debugLog(
|
|
259
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic`
|
|
260
260
|
+ ` ProgrammableSwitchOutputStateOn: ${this.ProgrammableSwitchOn.ProgrammableSwitchOutputState}`);
|
|
261
261
|
}
|
|
262
262
|
// Off Stateful Programmable Switch
|
|
263
263
|
if (this.ProgrammableSwitchOff?.ProgrammableSwitchOutputState === undefined) {
|
|
264
|
-
|
|
264
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName}`
|
|
265
|
+
+ ` ProgrammableSwitchOutputStateOff: ${this.ProgrammableSwitchOff?.ProgrammableSwitchOutputState}`);
|
|
265
266
|
} else {
|
|
266
267
|
this.accessory.context.ProgrammableSwitchOutputStateOff = this.ProgrammableSwitchOff.ProgrammableSwitchOutputState;
|
|
267
268
|
this.ProgrammableSwitchOff.Service.updateCharacteristic(this.hap.Characteristic.ProgrammableSwitchOutputState,
|
|
268
269
|
this.ProgrammableSwitchOff.ProgrammableSwitchOutputState);
|
|
269
|
-
|
|
270
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic`
|
|
271
|
+
+ ` ProgrammableSwitchOutputStateOff: ${this.ProgrammableSwitchOff?.ProgrammableSwitchOutputState}`);
|
|
270
272
|
}
|
|
271
273
|
}
|
|
272
274
|
}
|
package/src/irdevice/other.ts
CHANGED
|
@@ -99,7 +99,7 @@ export class Others extends irdeviceBase {
|
|
|
99
99
|
On: accessory.context.On ?? false,
|
|
100
100
|
};
|
|
101
101
|
accessory.context.Switch = this.Switch as object;
|
|
102
|
-
this.debugWarnLog(
|
|
102
|
+
this.debugWarnLog(`${this.device.remoteType}: ${accessory.displayName} Displaying as Switch`);
|
|
103
103
|
|
|
104
104
|
this.Switch.Service
|
|
105
105
|
.setCharacteristic(this.hap.Characteristic.Name, accessory.displayName)
|
|
@@ -128,7 +128,7 @@ export class Others extends irdeviceBase {
|
|
|
128
128
|
On: accessory.context.On ?? false,
|
|
129
129
|
};
|
|
130
130
|
accessory.context.GarageDoor = this.GarageDoor as object;
|
|
131
|
-
this.debugWarnLog(
|
|
131
|
+
this.debugWarnLog(`${this.device.remoteType}: ${accessory.displayName} Displaying as Garage Door Opener`);
|
|
132
132
|
|
|
133
133
|
this.GarageDoor.Service
|
|
134
134
|
.setCharacteristic(this.hap.Characteristic.Name, accessory.displayName)
|
|
@@ -158,7 +158,7 @@ export class Others extends irdeviceBase {
|
|
|
158
158
|
On: accessory.context.On ?? false,
|
|
159
159
|
};
|
|
160
160
|
accessory.context.Door = this.Door as object;
|
|
161
|
-
this.debugWarnLog(
|
|
161
|
+
this.debugWarnLog(`${this.device.remoteType}: ${accessory.displayName} Displaying as Door`);
|
|
162
162
|
|
|
163
163
|
this.Door!.Service
|
|
164
164
|
.setCharacteristic(this.hap.Characteristic.Name, accessory.displayName)
|
|
@@ -194,7 +194,7 @@ export class Others extends irdeviceBase {
|
|
|
194
194
|
On: accessory.context.On ?? false,
|
|
195
195
|
};
|
|
196
196
|
accessory.context.Window = this.Window as object;
|
|
197
|
-
this.debugWarnLog(
|
|
197
|
+
this.debugWarnLog(`${this.device.remoteType}: ${accessory.displayName} Displaying as Window`);
|
|
198
198
|
|
|
199
199
|
this.Window!.Service.setCharacteristic(this.hap.Characteristic.Name, accessory.displayName)
|
|
200
200
|
.setCharacteristic(this.hap.Characteristic.PositionState, this.hap.Characteristic.PositionState.STOPPED)
|
|
@@ -229,7 +229,7 @@ export class Others extends irdeviceBase {
|
|
|
229
229
|
On: accessory.context.On ?? false,
|
|
230
230
|
};
|
|
231
231
|
accessory.context.WindowCovering = this.WindowCovering as object;
|
|
232
|
-
this.debugWarnLog(
|
|
232
|
+
this.debugWarnLog(`${this.device.remoteType}: ${accessory.displayName} Displaying as Window Covering`);
|
|
233
233
|
|
|
234
234
|
this.WindowCovering.Service
|
|
235
235
|
.setCharacteristic(this.hap.Characteristic.Name, accessory.displayName)
|
|
@@ -265,7 +265,7 @@ export class Others extends irdeviceBase {
|
|
|
265
265
|
On: accessory.context.On ?? false,
|
|
266
266
|
};
|
|
267
267
|
accessory.context.LockMechanism = this.LockMechanism as object;
|
|
268
|
-
this.debugWarnLog(
|
|
268
|
+
this.debugWarnLog(`${this.device.remoteType}: ${accessory.displayName} Displaying as Lock`);
|
|
269
269
|
|
|
270
270
|
this.LockMechanism.Service
|
|
271
271
|
.setCharacteristic(this.hap.Characteristic.Name, accessory.displayName)
|
|
@@ -294,7 +294,7 @@ export class Others extends irdeviceBase {
|
|
|
294
294
|
On: accessory.context.On ?? false,
|
|
295
295
|
};
|
|
296
296
|
accessory.context.Faucet = this.Faucet as object;
|
|
297
|
-
this.debugWarnLog(
|
|
297
|
+
this.debugWarnLog(`${this.device.remoteType}: ${accessory.displayName} Displaying as Faucet`);
|
|
298
298
|
|
|
299
299
|
this.Faucet.Service
|
|
300
300
|
.setCharacteristic(this.hap.Characteristic.Name, accessory.displayName)
|
|
@@ -323,7 +323,7 @@ export class Others extends irdeviceBase {
|
|
|
323
323
|
On: accessory.context.On ?? false,
|
|
324
324
|
};
|
|
325
325
|
accessory.context.Fan = this.Fan as object;
|
|
326
|
-
this.debugWarnLog(
|
|
326
|
+
this.debugWarnLog(`${this.device.remoteType}: ${accessory.displayName} Displaying as Fan`);
|
|
327
327
|
|
|
328
328
|
this.Fan.Service
|
|
329
329
|
.setCharacteristic(this.hap.Characteristic.Name, accessory.displayName)
|
|
@@ -353,7 +353,7 @@ export class Others extends irdeviceBase {
|
|
|
353
353
|
On: accessory.context.On ?? false,
|
|
354
354
|
};
|
|
355
355
|
accessory.context.StatefulProgrammableSwitch = this.StatefulProgrammableSwitch as object;
|
|
356
|
-
this.debugWarnLog(
|
|
356
|
+
this.debugWarnLog(`${this.device.remoteType}: ${accessory.displayName} Displaying as Stateful Programmable Switch`);
|
|
357
357
|
|
|
358
358
|
this.StatefulProgrammableSwitch.Service
|
|
359
359
|
.setCharacteristic(this.hap.Characteristic.Name, accessory.displayName)
|
|
@@ -382,7 +382,7 @@ export class Others extends irdeviceBase {
|
|
|
382
382
|
On: accessory.context.On ?? false,
|
|
383
383
|
};
|
|
384
384
|
accessory.context.Outlet = this.Outlet as object;
|
|
385
|
-
this.debugWarnLog(
|
|
385
|
+
this.debugWarnLog(`${this.device.remoteType}: ${accessory.displayName} Displaying as Outlet`);
|
|
386
386
|
|
|
387
387
|
this.Outlet.Service
|
|
388
388
|
.setCharacteristic(this.hap.Characteristic.Name, accessory.displayName)
|
|
@@ -411,7 +411,7 @@ export class Others extends irdeviceBase {
|
|
|
411
411
|
async OnSet(value: CharacteristicValue): Promise<void> {
|
|
412
412
|
let On: boolean;
|
|
413
413
|
if (this.otherDeviceType === 'garagedoor') {
|
|
414
|
-
this.infoLog(
|
|
414
|
+
this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Set TargetDoorState: ${value}`);
|
|
415
415
|
if (value === this.hap.Characteristic.TargetDoorState.CLOSED) {
|
|
416
416
|
this.GarageDoor!.On = false;
|
|
417
417
|
} else {
|
|
@@ -419,7 +419,7 @@ export class Others extends irdeviceBase {
|
|
|
419
419
|
}
|
|
420
420
|
On = this.GarageDoor!.On;
|
|
421
421
|
} else if (this.otherDeviceType === 'door') {
|
|
422
|
-
this.infoLog(
|
|
422
|
+
this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Set TargetPosition: ${value}`);
|
|
423
423
|
if (value === 0) {
|
|
424
424
|
this.Door!.On = false;
|
|
425
425
|
} else {
|
|
@@ -427,7 +427,7 @@ export class Others extends irdeviceBase {
|
|
|
427
427
|
}
|
|
428
428
|
On = this.Door!.On;
|
|
429
429
|
} else if (this.otherDeviceType === 'window') {
|
|
430
|
-
this.infoLog(
|
|
430
|
+
this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Set TargetPosition: ${value}`);
|
|
431
431
|
if (value === 0) {
|
|
432
432
|
this.Window!.On = false;
|
|
433
433
|
} else {
|
|
@@ -435,7 +435,7 @@ export class Others extends irdeviceBase {
|
|
|
435
435
|
}
|
|
436
436
|
On = this.Window!.On;
|
|
437
437
|
} else if (this.otherDeviceType === 'windowcovering') {
|
|
438
|
-
this.infoLog(
|
|
438
|
+
this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Set TargetPosition: ${value}`);
|
|
439
439
|
if (value === 0) {
|
|
440
440
|
this.WindowCovering!.On = false;
|
|
441
441
|
} else {
|
|
@@ -443,7 +443,7 @@ export class Others extends irdeviceBase {
|
|
|
443
443
|
}
|
|
444
444
|
On = this.WindowCovering!.On;
|
|
445
445
|
} else if (this.otherDeviceType === 'lock') {
|
|
446
|
-
this.infoLog(
|
|
446
|
+
this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Set LockTargetState: ${value}`);
|
|
447
447
|
if (value === this.hap.Characteristic.LockTargetState.SECURED) {
|
|
448
448
|
this.LockMechanism!.On = false;
|
|
449
449
|
} else {
|
|
@@ -451,7 +451,7 @@ export class Others extends irdeviceBase {
|
|
|
451
451
|
}
|
|
452
452
|
On = this.LockMechanism!.On;
|
|
453
453
|
} else if (this.otherDeviceType === 'faucet') {
|
|
454
|
-
this.infoLog(
|
|
454
|
+
this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Set Active: ${value}`);
|
|
455
455
|
if (value === this.hap.Characteristic.Active.INACTIVE) {
|
|
456
456
|
this.Faucet!.On = false;
|
|
457
457
|
} else {
|
|
@@ -459,7 +459,7 @@ export class Others extends irdeviceBase {
|
|
|
459
459
|
}
|
|
460
460
|
On = this.Faucet!.On;
|
|
461
461
|
} else if (this.otherDeviceType === 'stateful') {
|
|
462
|
-
this.infoLog(
|
|
462
|
+
this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Set ProgrammableSwitchOutputState: ${value}`);
|
|
463
463
|
if (value === 0) {
|
|
464
464
|
this.StatefulProgrammableSwitch!.On = false;
|
|
465
465
|
} else {
|
|
@@ -468,7 +468,7 @@ export class Others extends irdeviceBase {
|
|
|
468
468
|
|
|
469
469
|
On = this.StatefulProgrammableSwitch!.On;
|
|
470
470
|
} else {
|
|
471
|
-
this.infoLog(
|
|
471
|
+
this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Set On: ${value}`);
|
|
472
472
|
this.Outlet!.On = value;
|
|
473
473
|
On = this.Outlet!.On ? true : false;
|
|
474
474
|
}
|
|
@@ -492,7 +492,7 @@ export class Others extends irdeviceBase {
|
|
|
492
492
|
* Other - "command" "channelSub" "default" = previous channel
|
|
493
493
|
*/
|
|
494
494
|
async pushOnChanges(On: boolean): Promise<void> {
|
|
495
|
-
|
|
495
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushOnChanges On: ${On},`
|
|
496
496
|
+ ` disablePushOn: ${this.disablePushOn}, customize: ${this.device.customize}, customOn: ${this.device.customOn}`);
|
|
497
497
|
if (this.device.customize) {
|
|
498
498
|
if (On === true && !this.disablePushOn) {
|
|
@@ -506,12 +506,12 @@ export class Others extends irdeviceBase {
|
|
|
506
506
|
await this.pushChanges(bodyChange);
|
|
507
507
|
}
|
|
508
508
|
} else {
|
|
509
|
-
this.errorLog(
|
|
509
|
+
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} On Command not set`);
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
512
|
|
|
513
513
|
async pushOffChanges(On: boolean): Promise<void> {
|
|
514
|
-
|
|
514
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushOffChanges On: ${On},`
|
|
515
515
|
+ ` disablePushOff: ${this.disablePushOff}, customize: ${this.device.customize}, customOff: ${this.device.customOff}`);
|
|
516
516
|
if (this.device.customize) {
|
|
517
517
|
if (On === false && !this.disablePushOff) {
|
|
@@ -525,14 +525,14 @@ export class Others extends irdeviceBase {
|
|
|
525
525
|
await this.pushChanges(bodyChange);
|
|
526
526
|
}
|
|
527
527
|
} else {
|
|
528
|
-
this.errorLog(
|
|
528
|
+
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Off Command not set.`);
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
531
|
|
|
532
532
|
async pushChanges(bodyChange: any): Promise<void> {
|
|
533
|
-
|
|
533
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushChanges`);
|
|
534
534
|
if (this.device.connectionType === 'OpenAPI') {
|
|
535
|
-
this.infoLog(
|
|
535
|
+
this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
536
536
|
try {
|
|
537
537
|
const { body, statusCode } = await this.pushChangeRequest(bodyChange);
|
|
538
538
|
const deviceStatus: any = await body.json();
|
|
@@ -549,165 +549,165 @@ export class Others extends irdeviceBase {
|
|
|
549
549
|
await this.pushChangeError(e);
|
|
550
550
|
}
|
|
551
551
|
} else {
|
|
552
|
-
|
|
552
|
+
this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName}`
|
|
553
|
+
+ ` Connection Type: ${this.device.connectionType}, commands will not be sent to OpenAPI`);
|
|
553
554
|
}
|
|
554
555
|
}
|
|
555
556
|
|
|
556
557
|
async updateHomeKitCharacteristics(): Promise<void> {
|
|
557
|
-
await this.debugLog('updateHomeKitCharacteristics');
|
|
558
558
|
if (this.otherDeviceType === 'garagedoor') {
|
|
559
559
|
if (this.GarageDoor!.On === undefined) {
|
|
560
|
-
|
|
560
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} On: ${this.GarageDoor!.On}`);
|
|
561
561
|
} else {
|
|
562
562
|
if (this.GarageDoor!.On) {
|
|
563
563
|
this.GarageDoor!.Service.updateCharacteristic(this.hap.Characteristic.TargetDoorState, this.hap.Characteristic.TargetDoorState.OPEN);
|
|
564
564
|
this.GarageDoor!.Service.updateCharacteristic(this.hap.Characteristic.CurrentDoorState, this.hap.Characteristic.CurrentDoorState.OPEN);
|
|
565
|
-
|
|
565
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic`
|
|
566
566
|
+ ` TargetDoorState: Open, CurrentDoorState: Open (${this.GarageDoor!.On})`);
|
|
567
567
|
} else {
|
|
568
568
|
this.GarageDoor!.Service.updateCharacteristic(this.hap.Characteristic.TargetDoorState, this.hap.Characteristic.TargetDoorState.CLOSED);
|
|
569
569
|
this.GarageDoor!.Service.updateCharacteristic(this.hap.Characteristic.CurrentDoorState, this.hap.Characteristic.CurrentDoorState.CLOSED);
|
|
570
|
-
|
|
570
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic`
|
|
571
571
|
+ ` TargetDoorState: Closed, CurrentDoorState: Closed (${this.GarageDoor!.On})`);
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
|
-
|
|
574
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Garage Door On: ${this.GarageDoor!.On}`);
|
|
575
575
|
} else if (this.otherDeviceType === 'door') {
|
|
576
576
|
if (this.Door!.On === undefined) {
|
|
577
|
-
|
|
577
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} On: ${this.Door!.On}`);
|
|
578
578
|
} else {
|
|
579
579
|
if (this.Door!.On) {
|
|
580
580
|
this.Door!.Service.updateCharacteristic(this.hap.Characteristic.TargetPosition, 100);
|
|
581
581
|
this.Door!.Service.updateCharacteristic(this.hap.Characteristic.CurrentPosition, 100);
|
|
582
582
|
this.Door!.Service.updateCharacteristic(this.hap.Characteristic.PositionState, this.hap.Characteristic.PositionState.STOPPED);
|
|
583
|
-
|
|
583
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic`
|
|
584
584
|
+ ` TargetPosition: 100, CurrentPosition: 100 (${this.Door!.On})`);
|
|
585
585
|
} else {
|
|
586
586
|
this.Door!.Service.updateCharacteristic(this.hap.Characteristic.TargetPosition, 0);
|
|
587
587
|
this.Door!.Service.updateCharacteristic(this.hap.Characteristic.CurrentPosition, 0);
|
|
588
588
|
this.Door!.Service.updateCharacteristic(this.hap.Characteristic.PositionState, this.hap.Characteristic.PositionState.STOPPED);
|
|
589
|
-
|
|
589
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic`
|
|
590
590
|
+ ` TargetPosition: 0, CurrentPosition: 0 (${this.Door!.On})`);
|
|
591
591
|
}
|
|
592
592
|
}
|
|
593
|
-
|
|
593
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Door On: ${this.Door!.On}`);
|
|
594
594
|
} else if (this.otherDeviceType === 'window') {
|
|
595
595
|
if (this.Window!.On === undefined) {
|
|
596
|
-
|
|
596
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} On: ${this.Window!.On}`);
|
|
597
597
|
} else {
|
|
598
598
|
if (this.Window!.On) {
|
|
599
599
|
this.Window!.Service.updateCharacteristic(this.hap.Characteristic.TargetPosition, 100);
|
|
600
600
|
this.Window!.Service.updateCharacteristic(this.hap.Characteristic.CurrentPosition, 100);
|
|
601
601
|
this.Window!.Service.updateCharacteristic(this.hap.Characteristic.PositionState, this.hap.Characteristic.PositionState.STOPPED);
|
|
602
|
-
|
|
602
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic`
|
|
603
603
|
+ ` TargetPosition: 100, CurrentPosition: 100 (${this.Window!.On})`);
|
|
604
604
|
} else {
|
|
605
605
|
this.Window!.Service.updateCharacteristic(this.hap.Characteristic.TargetPosition, 0);
|
|
606
606
|
this.Window!.Service.updateCharacteristic(this.hap.Characteristic.CurrentPosition, 0);
|
|
607
607
|
this.Window!.Service.updateCharacteristic(this.hap.Characteristic.PositionState, this.hap.Characteristic.PositionState.STOPPED);
|
|
608
|
-
|
|
608
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic`
|
|
609
609
|
+ ` TargetPosition: 0, CurrentPosition: 0 (${this.Window!.On})`);
|
|
610
610
|
}
|
|
611
611
|
}
|
|
612
|
-
|
|
612
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Window On: ${this.Window!.On}`);
|
|
613
613
|
} else if (this.otherDeviceType === 'windowcovering') {
|
|
614
614
|
if (this.WindowCovering!.On === undefined) {
|
|
615
|
-
|
|
615
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} On: ${this.WindowCovering!.On}`);
|
|
616
616
|
} else {
|
|
617
617
|
if (this.WindowCovering!.On) {
|
|
618
618
|
this.WindowCovering!.Service.updateCharacteristic(this.hap.Characteristic.TargetPosition, 100);
|
|
619
619
|
this.WindowCovering!.Service.updateCharacteristic(this.hap.Characteristic.CurrentPosition, 100);
|
|
620
620
|
this.WindowCovering!.Service.updateCharacteristic(this.hap.Characteristic.PositionState, this.hap.Characteristic.PositionState.STOPPED);
|
|
621
|
-
|
|
621
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic`
|
|
622
622
|
+ ` TargetPosition: 100, CurrentPosition: 100 (${this.WindowCovering!.On})`);
|
|
623
623
|
} else {
|
|
624
624
|
this.WindowCovering!.Service.updateCharacteristic(this.hap.Characteristic.TargetPosition, 0);
|
|
625
625
|
this.WindowCovering!.Service.updateCharacteristic(this.hap.Characteristic.CurrentPosition, 0);
|
|
626
626
|
this.WindowCovering!.Service.updateCharacteristic(this.hap.Characteristic.PositionState, this.hap.Characteristic.PositionState.STOPPED);
|
|
627
|
-
|
|
627
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic`
|
|
628
628
|
+ ` TargetPosition: 0, CurrentPosition: 0 (${this.WindowCovering!.On})`);
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
|
-
|
|
631
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Window Covering On: ${this.WindowCovering!.On}`);
|
|
632
632
|
} else if (this.otherDeviceType === 'lock') {
|
|
633
633
|
if (this.LockMechanism?.On === undefined) {
|
|
634
|
-
|
|
634
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} On: ${this.LockMechanism?.On}`);
|
|
635
635
|
} else {
|
|
636
636
|
if (this.LockMechanism.On) {
|
|
637
637
|
this.LockMechanism.Service.updateCharacteristic(this.hap.Characteristic.LockTargetState,
|
|
638
638
|
this.hap.Characteristic.LockTargetState.UNSECURED);
|
|
639
639
|
this.LockMechanism.Service.updateCharacteristic(this.hap.Characteristic.LockCurrentState,
|
|
640
640
|
this.hap.Characteristic.LockCurrentState.UNSECURED);
|
|
641
|
-
|
|
641
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic`
|
|
642
642
|
+ ` LockTargetState: UNSECURED, LockCurrentState: UNSECURE (${this.LockMechanism.On})`);
|
|
643
643
|
} else {
|
|
644
644
|
this.LockMechanism.Service.updateCharacteristic(this.hap.Characteristic.LockTargetState,
|
|
645
645
|
this.hap.Characteristic.LockTargetState.SECURED);
|
|
646
646
|
this.LockMechanism.Service.updateCharacteristic(this.hap.Characteristic.LockCurrentState,
|
|
647
647
|
this.hap.Characteristic.LockCurrentState.SECURED);
|
|
648
|
-
|
|
648
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic`
|
|
649
649
|
+ ` LockTargetState: SECURED, LockCurrentState: SECURED (${this.LockMechanism.On})`);
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
|
-
|
|
652
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Lock On: ${this.LockMechanism?.On}`);
|
|
653
653
|
} else if (this.otherDeviceType === 'faucet') {
|
|
654
654
|
if (this.Faucet!.On === undefined) {
|
|
655
|
-
|
|
655
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} On: ${this.Faucet!.On}`);
|
|
656
656
|
} else {
|
|
657
657
|
if (this.Faucet!.On) {
|
|
658
658
|
this.Faucet!.Service.updateCharacteristic(this.hap.Characteristic.Active, this.hap.Characteristic.Active.ACTIVE);
|
|
659
|
-
|
|
659
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic Active: ${this.Faucet!.On}`);
|
|
660
660
|
} else {
|
|
661
661
|
this.Faucet!.Service.updateCharacteristic(this.hap.Characteristic.Active, this.hap.Characteristic.Active.INACTIVE);
|
|
662
|
-
|
|
662
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic Active: ${this.Faucet!.On}`);
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
|
-
|
|
665
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Faucet On: ${this.Faucet!.On}`);
|
|
666
666
|
} else if (this.otherDeviceType === 'fan') {
|
|
667
667
|
if (this.Fan!.On === undefined) {
|
|
668
|
-
|
|
668
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} On: ${this.Fan!.On}`);
|
|
669
669
|
} else {
|
|
670
670
|
if (this.Fan!.On) {
|
|
671
671
|
this.Fan!.Service.updateCharacteristic(this.hap.Characteristic.On, this.Fan!.On);
|
|
672
|
-
|
|
672
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic On: ${this.Fan!.On}`);
|
|
673
673
|
} else {
|
|
674
674
|
this.Fan!.Service.updateCharacteristic(this.hap.Characteristic.On, this.Fan!.On);
|
|
675
|
-
|
|
675
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic On: ${this.Fan!.On}`);
|
|
676
676
|
}
|
|
677
677
|
}
|
|
678
|
-
|
|
678
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Fan On: ${this.Fan!.On}`);
|
|
679
679
|
} else if (this.otherDeviceType === 'stateful') {
|
|
680
680
|
if (this.StatefulProgrammableSwitch!.On === undefined) {
|
|
681
|
-
|
|
681
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} On: ${this.StatefulProgrammableSwitch!.On}`);
|
|
682
682
|
} else {
|
|
683
683
|
if (this.StatefulProgrammableSwitch!.On) {
|
|
684
684
|
this.StatefulProgrammableSwitch!.Service.updateCharacteristic(this.hap.Characteristic.ProgrammableSwitchEvent,
|
|
685
685
|
this.hap.Characteristic.ProgrammableSwitchEvent.SINGLE_PRESS);
|
|
686
686
|
this.StatefulProgrammableSwitch!.Service.updateCharacteristic(this.hap.Characteristic.ProgrammableSwitchOutputState, 1);
|
|
687
|
-
|
|
687
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic`
|
|
688
688
|
+ ` ProgrammableSwitchEvent: SINGLE, ProgrammableSwitchOutputState: 1 (${this.StatefulProgrammableSwitch!.On})`);
|
|
689
689
|
} else {
|
|
690
690
|
this.StatefulProgrammableSwitch!.Service.updateCharacteristic(this.hap.Characteristic.ProgrammableSwitchEvent,
|
|
691
691
|
this.hap.Characteristic.ProgrammableSwitchEvent.SINGLE_PRESS);
|
|
692
692
|
this.StatefulProgrammableSwitch!.Service.updateCharacteristic(this.hap.Characteristic.ProgrammableSwitchOutputState, 0);
|
|
693
|
-
|
|
693
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic`
|
|
694
694
|
+ ` ProgrammableSwitchEvent: SINGLE, ProgrammableSwitchOutputState: 0 (${this.StatefulProgrammableSwitch!.On})`);
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
|
-
|
|
697
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} StatefulProgrammableSwitch On: ${this.StatefulProgrammableSwitch!.On}`);
|
|
698
698
|
} else if (this.otherDeviceType === 'switch') {
|
|
699
699
|
if (this.Switch!.On === undefined) {
|
|
700
|
-
|
|
700
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} On: ${this.Switch!.On}`);
|
|
701
701
|
} else {
|
|
702
702
|
this.Switch!.Service.updateCharacteristic(this.hap.Characteristic.On, this.Switch!.On);
|
|
703
|
-
|
|
703
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic On: ${this.Switch!.On}`);
|
|
704
704
|
}
|
|
705
705
|
} else {
|
|
706
706
|
if (this.Outlet!.On === undefined) {
|
|
707
|
-
|
|
707
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} On: ${this.Outlet!.On}`);
|
|
708
708
|
} else {
|
|
709
709
|
this.Outlet!.Service.updateCharacteristic(this.hap.Characteristic.On, this.Outlet!.On);
|
|
710
|
-
|
|
710
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic On: ${this.Outlet!.On}`);
|
|
711
711
|
}
|
|
712
712
|
}
|
|
713
713
|
}
|
|
@@ -770,7 +770,7 @@ export class Others extends irdeviceBase {
|
|
|
770
770
|
// If Outlet.Service still present, then remove first
|
|
771
771
|
if (this.Outlet?.Service) {
|
|
772
772
|
this.Outlet.Service = this.accessory.getService(this.hap.Service.Outlet) as Service;
|
|
773
|
-
this.warnLog(
|
|
773
|
+
this.warnLog(`${this.device.remoteType}: ${accessory.displayName} Removing Leftover Outlet Service`);
|
|
774
774
|
accessory.removeService(this.Outlet.Service);
|
|
775
775
|
}
|
|
776
776
|
}
|
|
@@ -779,7 +779,7 @@ export class Others extends irdeviceBase {
|
|
|
779
779
|
// If GarageDoor.Service still present, then remove first
|
|
780
780
|
if (this.GarageDoor?.Service) {
|
|
781
781
|
this.GarageDoor.Service = this.accessory.getService(this.hap.Service.GarageDoorOpener) as Service;
|
|
782
|
-
this.warnLog(
|
|
782
|
+
this.warnLog(`${this.device.remoteType}: ${accessory.displayName} Removing Leftover Garage Door Service`);
|
|
783
783
|
accessory.removeService(this.GarageDoor.Service);
|
|
784
784
|
}
|
|
785
785
|
}
|
|
@@ -788,7 +788,7 @@ export class Others extends irdeviceBase {
|
|
|
788
788
|
// If Door.Service still present, then remove first
|
|
789
789
|
if (this.Door?.Service) {
|
|
790
790
|
this.Door.Service = this.accessory.getService(this.hap.Service.Door) as Service;
|
|
791
|
-
this.warnLog(
|
|
791
|
+
this.warnLog(`${this.device.remoteType}: ${accessory.displayName} Removing Leftover Door Service`);
|
|
792
792
|
accessory.removeService(this.Door.Service);
|
|
793
793
|
}
|
|
794
794
|
}
|
|
@@ -797,7 +797,7 @@ export class Others extends irdeviceBase {
|
|
|
797
797
|
// If Lock.Service still present, then remove first
|
|
798
798
|
if (this.LockMechanism?.Service) {
|
|
799
799
|
this.LockMechanism.Service = this.accessory.getService(this.hap.Service.LockMechanism) as Service;
|
|
800
|
-
this.warnLog(
|
|
800
|
+
this.warnLog(`${this.device.remoteType}: ${accessory.displayName} Removing Leftover Lock Service`);
|
|
801
801
|
accessory.removeService(this.LockMechanism.Service);
|
|
802
802
|
}
|
|
803
803
|
}
|
|
@@ -806,7 +806,7 @@ export class Others extends irdeviceBase {
|
|
|
806
806
|
// If Faucet.Service still present, then remove first
|
|
807
807
|
if (this.Faucet?.Service) {
|
|
808
808
|
this.Faucet.Service = this.accessory.getService(this.hap.Service.Faucet) as Service;
|
|
809
|
-
this.warnLog(
|
|
809
|
+
this.warnLog(`${this.device.remoteType}: ${accessory.displayName} Removing Leftover Faucet Service`);
|
|
810
810
|
accessory.removeService(this.Faucet.Service);
|
|
811
811
|
}
|
|
812
812
|
}
|
|
@@ -815,7 +815,7 @@ export class Others extends irdeviceBase {
|
|
|
815
815
|
// If Fan Service still present, then remove first
|
|
816
816
|
if (this.Fan?.Service) {
|
|
817
817
|
this.Fan.Service = this.accessory.getService(this.hap.Service.Fan) as Service;
|
|
818
|
-
this.warnLog(
|
|
818
|
+
this.warnLog(`${this.device.remoteType}: ${accessory.displayName} Removing Leftover Fan Service`);
|
|
819
819
|
accessory.removeService(this.Fan.Service);
|
|
820
820
|
}
|
|
821
821
|
}
|
|
@@ -824,7 +824,7 @@ export class Others extends irdeviceBase {
|
|
|
824
824
|
// If Window.Service still present, then remove first
|
|
825
825
|
if (this.Window?.Service) {
|
|
826
826
|
this.Window.Service = this.accessory.getService(this.hap.Service.Window) as Service;
|
|
827
|
-
this.warnLog(
|
|
827
|
+
this.warnLog(`${this.device.remoteType}: ${accessory.displayName} Removing Leftover Window Service`);
|
|
828
828
|
accessory.removeService(this.Window.Service);
|
|
829
829
|
}
|
|
830
830
|
}
|
|
@@ -833,7 +833,7 @@ export class Others extends irdeviceBase {
|
|
|
833
833
|
// If WindowCovering.Service still present, then remove first
|
|
834
834
|
if (this.WindowCovering?.Service) {
|
|
835
835
|
this.WindowCovering.Service = this.accessory.getService(this.hap.Service.WindowCovering) as Service;
|
|
836
|
-
this.warnLog(
|
|
836
|
+
this.warnLog(`${this.device.remoteType}: ${accessory.displayName} Removing Leftover Window Covering Service`);
|
|
837
837
|
accessory.removeService(this.WindowCovering.Service);
|
|
838
838
|
}
|
|
839
839
|
}
|
|
@@ -842,7 +842,7 @@ export class Others extends irdeviceBase {
|
|
|
842
842
|
// If StatefulProgrammableSwitch.Service still present, then remove first
|
|
843
843
|
if (this.StatefulProgrammableSwitch?.Service) {
|
|
844
844
|
this.StatefulProgrammableSwitch.Service = this.accessory.getService(this.hap.Service.StatefulProgrammableSwitch) as Service;
|
|
845
|
-
this.warnLog(
|
|
845
|
+
this.warnLog(`${this.device.remoteType}: ${accessory.displayName} Removing Leftover Stateful Programmable Switch Service`);
|
|
846
846
|
accessory.removeService(this.StatefulProgrammableSwitch.Service);
|
|
847
847
|
}
|
|
848
848
|
}
|
|
@@ -851,7 +851,7 @@ export class Others extends irdeviceBase {
|
|
|
851
851
|
// If Switch.Service still present, then remove first
|
|
852
852
|
if (this.Switch?.Service) {
|
|
853
853
|
this.Switch.Service = this.accessory.getService(this.hap.Service.Switch) as Service;
|
|
854
|
-
this.warnLog(
|
|
854
|
+
this.warnLog(`${this.device.remoteType}: ${accessory.displayName} Removing Leftover Switch Service`);
|
|
855
855
|
accessory.removeService(this.Switch.Service);
|
|
856
856
|
}
|
|
857
857
|
}
|
|
@@ -859,15 +859,15 @@ export class Others extends irdeviceBase {
|
|
|
859
859
|
async getOtherConfigSettings(device: irdevice & irDevicesConfig): Promise<void> {
|
|
860
860
|
if (!device.other?.deviceType && this.accessory.context.deviceType) {
|
|
861
861
|
this.otherDeviceType = this.accessory.context.deviceType;
|
|
862
|
-
|
|
862
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Device Type: ${this.otherDeviceType}, from Accessory Cache.`);
|
|
863
863
|
} else if (device.other?.deviceType) {
|
|
864
864
|
this.accessory.context.deviceType = device.other.deviceType;
|
|
865
|
-
|
|
865
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} Accessory Cache: ${this.accessory.context.deviceType}`);
|
|
866
866
|
this.otherDeviceType = this.accessory.context.deviceType;
|
|
867
|
-
|
|
867
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Device Type: ${this.otherDeviceType}`);
|
|
868
868
|
} else {
|
|
869
869
|
this.otherDeviceType = 'outlet';
|
|
870
|
-
this.warnLog(
|
|
870
|
+
this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName} no deviceType set, using default deviceType: ${this.otherDeviceType}`);
|
|
871
871
|
}
|
|
872
872
|
}
|
|
873
873
|
}
|