@switchbot/homebridge-switchbot 2.8.1-beta.17 → 2.8.1-beta.19
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.d.ts.map +1 -1
- package/dist/device/blindtilt.js +37 -16
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.js +10 -10
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.d.ts.map +1 -1
- package/dist/device/ceilinglight.js +78 -24
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +36 -5
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +22 -12
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +36 -15
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/hub.d.ts.map +1 -1
- package/dist/device/hub.js +21 -11
- package/dist/device/hub.js.map +1 -1
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +66 -23
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/iosensor.d.ts.map +1 -1
- package/dist/device/iosensor.js +21 -11
- package/dist/device/iosensor.js.map +1 -1
- package/dist/device/lightstrip.d.ts.map +1 -1
- package/dist/device/lightstrip.js +63 -20
- package/dist/device/lightstrip.js.map +1 -1
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +35 -14
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +21 -11
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +21 -11
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +21 -11
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +32 -11
- package/dist/device/plug.js.map +1 -1
- package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
- package/dist/device/robotvacuumcleaner.js +48 -16
- package/dist/device/robotvacuumcleaner.js.map +1 -1
- package/dist/irdevice/airconditioner.d.ts.map +1 -1
- package/dist/irdevice/airconditioner.js +15 -4
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.d.ts.map +1 -1
- package/dist/irdevice/airpurifier.js +15 -4
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.d.ts.map +1 -1
- package/dist/irdevice/camera.js +15 -4
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.d.ts.map +1 -1
- package/dist/irdevice/fan.js +15 -4
- package/dist/irdevice/fan.js.map +1 -1
- package/dist/irdevice/light.d.ts.map +1 -1
- package/dist/irdevice/light.js +16 -5
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.d.ts.map +1 -1
- package/dist/irdevice/other.js +15 -4
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.d.ts.map +1 -1
- package/dist/irdevice/tv.js +15 -4
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +15 -4
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.d.ts.map +1 -1
- package/dist/irdevice/waterheater.js +15 -4
- package/dist/irdevice/waterheater.js.map +1 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +18 -3
- package/dist/platform.js.map +1 -1
- package/package.json +1 -1
- package/src/device/blindtilt.ts +35 -16
- package/src/device/bot.ts +11 -11
- package/src/device/ceilinglight.ts +73 -24
- package/src/device/colorbulb.ts +32 -5
- package/src/device/contact.ts +21 -12
- package/src/device/curtain.ts +34 -15
- package/src/device/hub.ts +20 -11
- package/src/device/humidifier.ts +62 -23
- package/src/device/iosensor.ts +20 -11
- package/src/device/lightstrip.ts +59 -20
- package/src/device/lock.ts +33 -14
- package/src/device/meter.ts +20 -11
- package/src/device/meterplus.ts +20 -11
- package/src/device/motion.ts +20 -11
- package/src/device/plug.ts +30 -11
- package/src/device/robotvacuumcleaner.ts +45 -16
- package/src/irdevice/airconditioner.ts +14 -4
- package/src/irdevice/airpurifier.ts +14 -4
- package/src/irdevice/camera.ts +14 -4
- package/src/irdevice/fan.ts +14 -4
- package/src/irdevice/light.ts +15 -5
- package/src/irdevice/other.ts +14 -4
- package/src/irdevice/tv.ts +14 -4
- package/src/irdevice/vacuumcleaner.ts +14 -4
- package/src/irdevice/waterheater.ts +14 -4
- package/src/platform.ts +15 -3
|
@@ -293,16 +293,25 @@ export class RobotVacuumCleaner {
|
|
|
293
293
|
const { body, statusCode, headers } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
294
294
|
headers: this.platform.generateHeaders(),
|
|
295
295
|
});
|
|
296
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
297
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
298
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
296
299
|
const deviceStatus: any = await body.json();
|
|
297
|
-
this.
|
|
298
|
-
this.
|
|
299
|
-
this.
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
300
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
301
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
302
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
303
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
304
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
305
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
306
|
+
this.OpenAPI_On = deviceStatus.body.power;
|
|
307
|
+
this.OpenAPI_BatteryLevel = deviceStatus.body.battery;
|
|
308
|
+
this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
|
|
309
|
+
this.openAPIparseStatus();
|
|
310
|
+
this.updateHomeKitCharacteristics();
|
|
311
|
+
} else {
|
|
312
|
+
this.statusCode(statusCode);
|
|
313
|
+
this.statusCode(deviceStatus.statusCode);
|
|
314
|
+
}
|
|
306
315
|
} catch (e: any) {
|
|
307
316
|
this.apiError(e);
|
|
308
317
|
this.errorLog(
|
|
@@ -412,10 +421,20 @@ export class RobotVacuumCleaner {
|
|
|
412
421
|
method: 'POST',
|
|
413
422
|
headers: this.platform.generateHeaders(),
|
|
414
423
|
});
|
|
424
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
425
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
426
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
415
427
|
const deviceStatus: any = await body.json();
|
|
416
|
-
this.
|
|
417
|
-
this.
|
|
418
|
-
this.
|
|
428
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
429
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
430
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
431
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
432
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
433
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
434
|
+
} else {
|
|
435
|
+
this.statusCode(statusCode);
|
|
436
|
+
this.statusCode(deviceStatus.statusCode);
|
|
437
|
+
}
|
|
419
438
|
} catch (e: any) {
|
|
420
439
|
this.apiError(e);
|
|
421
440
|
this.errorLog(
|
|
@@ -441,10 +460,20 @@ export class RobotVacuumCleaner {
|
|
|
441
460
|
method: 'POST',
|
|
442
461
|
headers: this.platform.generateHeaders(),
|
|
443
462
|
});
|
|
463
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
464
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
465
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
444
466
|
const deviceStatus: any = await body.json();
|
|
445
|
-
this.
|
|
446
|
-
this.
|
|
447
|
-
this.
|
|
467
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
468
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
469
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
470
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
471
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
472
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
473
|
+
} else {
|
|
474
|
+
this.statusCode(statusCode);
|
|
475
|
+
this.statusCode(deviceStatus.statusCode);
|
|
476
|
+
}
|
|
448
477
|
} catch (e: any) {
|
|
449
478
|
this.apiError(e);
|
|
450
479
|
this.errorLog(
|
|
@@ -566,7 +595,7 @@ export class RobotVacuumCleaner {
|
|
|
566
595
|
this.accessory.getService(this.platform.Service.AccessoryInformation)!
|
|
567
596
|
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.OpenAPI_FirmwareRevision);
|
|
568
597
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
569
|
-
+ `updateCharacteristic
|
|
598
|
+
+ `updateCharacteristic FirmwareRevision: ${this.OpenAPI_FirmwareRevision}`);
|
|
570
599
|
}
|
|
571
600
|
}
|
|
572
601
|
|
|
@@ -262,11 +262,21 @@ export class AirConditioner {
|
|
|
262
262
|
method: 'POST',
|
|
263
263
|
headers: this.platform.generateHeaders(),
|
|
264
264
|
});
|
|
265
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
266
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
267
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
265
268
|
const deviceStatus: any = await body.json();
|
|
266
|
-
this.
|
|
267
|
-
this.
|
|
268
|
-
this.
|
|
269
|
-
|
|
269
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
270
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
271
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
272
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
273
|
+
this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
|
|
274
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
275
|
+
this.updateHomeKitCharacteristics();
|
|
276
|
+
} else {
|
|
277
|
+
this.statusCode(statusCode);
|
|
278
|
+
this.statusCode(deviceStatus.statusCode);
|
|
279
|
+
}
|
|
270
280
|
} catch (e: any) {
|
|
271
281
|
this.apiError(e);
|
|
272
282
|
this.errorLog(
|
|
@@ -218,11 +218,21 @@ export class AirPurifier {
|
|
|
218
218
|
method: 'POST',
|
|
219
219
|
headers: this.platform.generateHeaders(),
|
|
220
220
|
});
|
|
221
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
222
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
223
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
221
224
|
const deviceStatus: any = await body.json();
|
|
222
|
-
this.
|
|
223
|
-
this.
|
|
224
|
-
this.
|
|
225
|
-
|
|
225
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
226
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
227
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
228
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
229
|
+
this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
|
|
230
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
231
|
+
this.updateHomeKitCharacteristics();
|
|
232
|
+
} else {
|
|
233
|
+
this.statusCode(statusCode);
|
|
234
|
+
this.statusCode(deviceStatus.statusCode);
|
|
235
|
+
}
|
|
226
236
|
} catch (e: any) {
|
|
227
237
|
this.apiError(e);
|
|
228
238
|
this.errorLog(
|
package/src/irdevice/camera.ts
CHANGED
|
@@ -123,11 +123,21 @@ export class Camera {
|
|
|
123
123
|
method: 'POST',
|
|
124
124
|
headers: this.platform.generateHeaders(),
|
|
125
125
|
});
|
|
126
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
127
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
128
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
126
129
|
const deviceStatus: any = await body.json();
|
|
127
|
-
this.
|
|
128
|
-
this.
|
|
129
|
-
this.
|
|
130
|
-
|
|
130
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
131
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
132
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
133
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
134
|
+
this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
|
|
135
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
136
|
+
this.updateHomeKitCharacteristics();
|
|
137
|
+
} else {
|
|
138
|
+
this.statusCode(statusCode);
|
|
139
|
+
this.statusCode(deviceStatus.statusCode);
|
|
140
|
+
}
|
|
131
141
|
} catch (e: any) {
|
|
132
142
|
this.apiError(e);
|
|
133
143
|
this.errorLog(
|
package/src/irdevice/fan.ts
CHANGED
|
@@ -240,11 +240,21 @@ export class Fan {
|
|
|
240
240
|
method: 'POST',
|
|
241
241
|
headers: this.platform.generateHeaders(),
|
|
242
242
|
});
|
|
243
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
244
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
245
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
243
246
|
const deviceStatus: any = await body.json();
|
|
244
|
-
this.
|
|
245
|
-
this.
|
|
246
|
-
this.
|
|
247
|
-
|
|
247
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
248
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
249
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
250
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
251
|
+
this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
|
|
252
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
253
|
+
this.updateHomeKitCharacteristics();
|
|
254
|
+
} else {
|
|
255
|
+
this.statusCode(statusCode);
|
|
256
|
+
this.statusCode(deviceStatus.statusCode);
|
|
257
|
+
}
|
|
248
258
|
} catch (e: any) {
|
|
249
259
|
this.apiError(e);
|
|
250
260
|
this.errorLog(
|
package/src/irdevice/light.ts
CHANGED
|
@@ -147,12 +147,22 @@ export class Light {
|
|
|
147
147
|
method: 'POST',
|
|
148
148
|
headers: this.platform.generateHeaders(),
|
|
149
149
|
});
|
|
150
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
151
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
152
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
150
153
|
const deviceStatus: any = await body.json();
|
|
151
|
-
this.
|
|
152
|
-
this.
|
|
153
|
-
this.
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
155
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
156
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
157
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
158
|
+
this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
|
|
159
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
160
|
+
this.accessory.context.On = this.On;
|
|
161
|
+
this.updateHomeKitCharacteristics();
|
|
162
|
+
} else {
|
|
163
|
+
this.statusCode(statusCode);
|
|
164
|
+
this.statusCode(deviceStatus.statusCode);
|
|
165
|
+
}
|
|
156
166
|
} catch (e: any) {
|
|
157
167
|
this.apiError(e);
|
|
158
168
|
this.errorLog(
|
package/src/irdevice/other.ts
CHANGED
|
@@ -142,11 +142,21 @@ export class Others {
|
|
|
142
142
|
method: 'POST',
|
|
143
143
|
headers: this.platform.generateHeaders(),
|
|
144
144
|
});
|
|
145
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
146
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
147
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
145
148
|
const deviceStatus: any = await body.json();
|
|
146
|
-
this.
|
|
147
|
-
this.
|
|
148
|
-
this.
|
|
149
|
-
|
|
149
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
150
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
151
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
152
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
153
|
+
this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
|
|
154
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
155
|
+
this.updateHomeKitCharacteristics();
|
|
156
|
+
} else {
|
|
157
|
+
this.statusCode(statusCode);
|
|
158
|
+
this.statusCode(deviceStatus.statusCode);
|
|
159
|
+
}
|
|
150
160
|
} catch (e: any) {
|
|
151
161
|
this.apiError(e);
|
|
152
162
|
this.errorLog(
|
package/src/irdevice/tv.ts
CHANGED
|
@@ -372,11 +372,21 @@ export class TV {
|
|
|
372
372
|
method: 'POST',
|
|
373
373
|
headers: this.platform.generateHeaders(),
|
|
374
374
|
});
|
|
375
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
376
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
377
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
375
378
|
const deviceStatus: any = await body.json();
|
|
376
|
-
this.
|
|
377
|
-
this.
|
|
378
|
-
this.
|
|
379
|
-
|
|
379
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
380
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
381
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
382
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
383
|
+
this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
|
|
384
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
385
|
+
this.updateHomeKitCharacteristics();
|
|
386
|
+
} else {
|
|
387
|
+
this.statusCode(statusCode);
|
|
388
|
+
this.statusCode(deviceStatus.statusCode);
|
|
389
|
+
}
|
|
380
390
|
} catch (e: any) {
|
|
381
391
|
this.apiError(e);
|
|
382
392
|
this.errorLog(
|
|
@@ -119,11 +119,21 @@ export class VacuumCleaner {
|
|
|
119
119
|
method: 'POST',
|
|
120
120
|
headers: this.platform.generateHeaders(),
|
|
121
121
|
});
|
|
122
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
123
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
124
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
122
125
|
const deviceStatus: any = await body.json();
|
|
123
|
-
this.
|
|
124
|
-
this.
|
|
125
|
-
this.
|
|
126
|
-
|
|
126
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
127
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
128
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
129
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
130
|
+
this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
|
|
131
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
132
|
+
this.updateHomeKitCharacteristics();
|
|
133
|
+
} else {
|
|
134
|
+
this.statusCode(statusCode);
|
|
135
|
+
this.statusCode(deviceStatus.statusCode);
|
|
136
|
+
}
|
|
127
137
|
} catch (e: any) {
|
|
128
138
|
this.apiError(e);
|
|
129
139
|
this.errorLog(
|
|
@@ -128,11 +128,21 @@ export class WaterHeater {
|
|
|
128
128
|
method: 'POST',
|
|
129
129
|
headers: this.platform.generateHeaders(),
|
|
130
130
|
});
|
|
131
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
132
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
133
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
131
134
|
const deviceStatus: any = await body.json();
|
|
132
|
-
this.
|
|
133
|
-
this.
|
|
134
|
-
this.
|
|
135
|
-
|
|
135
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
136
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
137
|
+
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
138
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
139
|
+
this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
|
|
140
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
141
|
+
this.updateHomeKitCharacteristics();
|
|
142
|
+
} else {
|
|
143
|
+
this.statusCode(statusCode);
|
|
144
|
+
this.statusCode(deviceStatus.statusCode);
|
|
145
|
+
}
|
|
136
146
|
} catch (e: any) {
|
|
137
147
|
this.apiError(e);
|
|
138
148
|
this.errorLog(
|
package/src/platform.ts
CHANGED
|
@@ -2087,7 +2087,11 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
2087
2087
|
registerDevice = true;
|
|
2088
2088
|
this.debugWarnLog(`Device: ${device.deviceName} registerDevice: ${registerDevice}`);
|
|
2089
2089
|
}
|
|
2090
|
-
|
|
2090
|
+
if (registerDevice === true) {
|
|
2091
|
+
this.debugWarnLog(`Device: ${device.deviceName} connectionType: ${device.connectionType}, will display in HomeKit`);
|
|
2092
|
+
} else {
|
|
2093
|
+
this.debugErrorLog(`Device: ${device.deviceName} connectionType: ${device.connectionType}, will not display in HomeKit`);
|
|
2094
|
+
}
|
|
2091
2095
|
} else if (!device.hide_device && device.deviceId && device.configDeviceType && device.configDeviceName && device.connectionType === 'BLE') {
|
|
2092
2096
|
if (device.deviceType === 'Curtain' || device.deviceType === 'Blind Tilt') {
|
|
2093
2097
|
registerDevice = await this.registerCurtains(device);
|
|
@@ -2096,7 +2100,11 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
2096
2100
|
registerDevice = true;
|
|
2097
2101
|
this.debugWarnLog(`Device: ${device.deviceName} registerDevice: ${registerDevice}`);
|
|
2098
2102
|
}
|
|
2099
|
-
|
|
2103
|
+
if (registerDevice === true) {
|
|
2104
|
+
this.debugWarnLog(`Device: ${device.deviceName} connectionType: ${device.connectionType}, will display in HomeKit`);
|
|
2105
|
+
} else {
|
|
2106
|
+
this.debugErrorLog(`Device: ${device.deviceName} connectionType: ${device.connectionType}, will not display in HomeKit`);
|
|
2107
|
+
}
|
|
2100
2108
|
} else if (!device.hide_device && device.connectionType === 'OpenAPI') {
|
|
2101
2109
|
if (device.deviceType === 'Curtain' || device.deviceType === 'Blind Tilt') {
|
|
2102
2110
|
registerDevice = await this.registerCurtains(device);
|
|
@@ -2105,7 +2113,11 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
2105
2113
|
registerDevice = true;
|
|
2106
2114
|
this.debugWarnLog(`Device: ${device.deviceName} registerDevice: ${registerDevice}`);
|
|
2107
2115
|
}
|
|
2108
|
-
|
|
2116
|
+
if (registerDevice === true) {
|
|
2117
|
+
this.debugWarnLog(`Device: ${device.deviceName} connectionType: ${device.connectionType}, will display in HomeKit`);
|
|
2118
|
+
} else {
|
|
2119
|
+
this.debugErrorLog(`Device: ${device.deviceName} connectionType: ${device.connectionType}, will not display in HomeKit`);
|
|
2120
|
+
}
|
|
2109
2121
|
} else if (!device.hide_device && device.connectionType === 'Disabled') {
|
|
2110
2122
|
if (device.deviceType === 'Curtain' || device.deviceType === 'Blind Tilt') {
|
|
2111
2123
|
registerDevice = await this.registerCurtains(device);
|