@switchbot/homebridge-switchbot 1.2.1-beta.2 → 1.2.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.
Files changed (51) hide show
  1. package/config.schema.json +2 -2
  2. package/dist/devices/bots.d.ts.map +1 -1
  3. package/dist/devices/bots.js +4 -0
  4. package/dist/devices/bots.js.map +1 -1
  5. package/dist/devices/colorbulb.d.ts.map +1 -1
  6. package/dist/devices/colorbulb.js +1 -0
  7. package/dist/devices/colorbulb.js.map +1 -1
  8. package/dist/devices/contact.d.ts.map +1 -1
  9. package/dist/devices/contact.js +1 -0
  10. package/dist/devices/contact.js.map +1 -1
  11. package/dist/devices/curtains.d.ts.map +1 -1
  12. package/dist/devices/curtains.js +10 -8
  13. package/dist/devices/curtains.js.map +1 -1
  14. package/dist/devices/humidifiers.d.ts.map +1 -1
  15. package/dist/devices/humidifiers.js +3 -1
  16. package/dist/devices/humidifiers.js.map +1 -1
  17. package/dist/devices/meters.d.ts.map +1 -1
  18. package/dist/devices/meters.js +1 -0
  19. package/dist/devices/meters.js.map +1 -1
  20. package/dist/devices/motion.d.ts.map +1 -1
  21. package/dist/devices/motion.js +1 -0
  22. package/dist/devices/motion.js.map +1 -1
  23. package/dist/irdevices/airconditioners.js +2 -2
  24. package/dist/irdevices/airconditioners.js.map +1 -1
  25. package/dist/irdevices/airpurifiers.js +2 -2
  26. package/dist/irdevices/airpurifiers.js.map +1 -1
  27. package/dist/irdevices/cameras.js +2 -2
  28. package/dist/irdevices/cameras.js.map +1 -1
  29. package/dist/irdevices/fans.js +2 -2
  30. package/dist/irdevices/fans.js.map +1 -1
  31. package/dist/irdevices/lights.js +2 -2
  32. package/dist/irdevices/lights.js.map +1 -1
  33. package/dist/irdevices/others.js +2 -2
  34. package/dist/irdevices/others.js.map +1 -1
  35. package/dist/irdevices/waterheaters.js +2 -2
  36. package/dist/irdevices/waterheaters.js.map +1 -1
  37. package/package.json +2 -2
  38. package/src/devices/bots.ts +4 -0
  39. package/src/devices/colorbulb.ts +1 -0
  40. package/src/devices/contact.ts +1 -0
  41. package/src/devices/curtains.ts +10 -8
  42. package/src/devices/humidifiers.ts +3 -1
  43. package/src/devices/meters.ts +1 -0
  44. package/src/devices/motion.ts +1 -0
  45. package/src/irdevices/airconditioners.ts +2 -2
  46. package/src/irdevices/airpurifiers.ts +2 -2
  47. package/src/irdevices/cameras.ts +2 -2
  48. package/src/irdevices/fans.ts +2 -2
  49. package/src/irdevices/lights.ts +2 -2
  50. package/src/irdevices/others.ts +2 -2
  51. package/src/irdevices/waterheaters.ts +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"waterheaters.js","sourceRoot":"","sources":["../../src/irdevices/waterheaters.ts"],"names":[],"mappings":";;;AAGA,0CAA4E;AAE5E;;;;GAIG;AACH,MAAa,WAAW;IAWtB,YACmB,QAA2B,EACpC,SAA4B,EAC7B,MAAkC;QAFxB,aAAQ,GAAR,QAAQ,CAAmB;QACpC,cAAS,GAAT,SAAS,CAAmB;QAC7B,WAAM,GAAN,MAAM,CAA4B;QAP3C,SAAS;QACQ,gBAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;QAC1F,eAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,KAAK,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;QAOvG,4BAA4B;QAC5B,SAAS;aACN,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,oBAAoB,CAAE;aACvD,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,YAAY,EAAE,WAAW,CAAC;aACzE,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC;aACxE,iBAAi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AC,SAAS,CAAC,WAAW,8DAA8D;sBAC7H,6BAA6B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;gBAChF,MAAM;YACR,KAAK,GAAG;gBACN,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,iBAAiB,IAAI,CAAC,SAAS,CAAC,WAAW,6BAA6B,CAAC,CAAC;gBAC9F,MAAM;YACR;gBACE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,iBAAiB,IAAI,CAAC,SAAS,CAAC,WAAW,sBAAsB,CAAC,CAAC;SAC1F;IACH,CAAC;IAEM,QAAQ,CAAC,CAAM;QACpB,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC5E,CAAC;CACF;AAlKD,kCAkKC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Homebridge SwitchBot",
3
3
  "name": "@switchbot/homebridge-switchbot",
4
- "version": "1.2.1-beta.2",
4
+ "version": "1.2.1-beta.3",
5
5
  "description": "The [Homebridge](https://homebridge.io) SwitchBot plugin allows you to access your [SwitchBot](https://www.switch-bot.com) device(s) from HomeKit.",
6
6
  "author": "SwitchBot <support@wondertechlabs.com> (https://github.com/SwitchBot)",
7
7
  "license": "ISC",
@@ -49,7 +49,7 @@
49
49
  "dependencies": {
50
50
  "@homebridge/plugin-ui-utils": "^0.0.19",
51
51
  "axios": "^0.24.0",
52
- "node-switchbot": "^1.1.2",
52
+ "node-switchbot": "^1.1.3-beta.0",
53
53
  "rxjs": "^7.4.0"
54
54
  },
55
55
  "devDependencies": {
@@ -260,6 +260,7 @@ export class Bot {
260
260
  this.platform.log.warn(`Bot: ${this.accessory.displayName} Using OpenAPI Connection`);
261
261
  await this.openAPIRefreshStatus();
262
262
  }
263
+ this.apiError(e);
263
264
  });
264
265
  }
265
266
 
@@ -334,6 +335,7 @@ export class Bot {
334
335
  this.platform.log.warn(`Bot: ${this.accessory.displayName} Using OpenAPI Connection`);
335
336
  await this.openAPIpushChanges();
336
337
  }
338
+ this.apiError(e);
337
339
  });
338
340
  } else if (this.device.bot?.mode === 'switch') {
339
341
  this.platform.device(`Bot: ${this.accessory.displayName} Press Mode: ${this.device.bot?.mode}`);
@@ -356,6 +358,7 @@ export class Bot {
356
358
  this.platform.log.warn(`Bot: ${this.accessory.displayName} Using OpenAPI Connection`);
357
359
  await this.openAPIpushChanges();
358
360
  }
361
+ this.apiError(e);
359
362
  });
360
363
  } else {
361
364
  this.platform.log.error(`Bot: ${this.accessory.displayName} Mode Not Set, mode: ${this.device.bot?.mode}`);
@@ -412,6 +415,7 @@ export class Bot {
412
415
  this.platform.log.error(`Bot: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,`
413
416
  + ` Error: ${JSON.stringify(e)}`);
414
417
  }
418
+ this.apiError(e);
415
419
  }
416
420
  }
417
421
  }
@@ -344,6 +344,7 @@ export class ColorBulb {
344
344
  this.platform.log.error(`Color Bulb: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,`
345
345
  + ` Error: ${JSON.stringify(e)}`);
346
346
  }
347
+ this.apiError(e);
347
348
  }
348
349
  }
349
350
 
@@ -273,6 +273,7 @@ export class Contact {
273
273
  this.platform.log.warn(`Contact Sensor: ${this.accessory.displayName} Using OpenAPI Connection`);
274
274
  await this.openAPIRefreshStatus();
275
275
  }
276
+ this.apiError(e);
276
277
  });
277
278
  }
278
279
 
@@ -249,13 +249,13 @@ export class Curtain {
249
249
  this.platform.debug(`Curtain: ${this.accessory.displayName} BLE parseStatus`);
250
250
  this.setMinMax();
251
251
  this.CurrentPosition = 100 - Number(this.position);
252
- this.setMinMax();
253
252
  this.platform.debug(`Curtain: ${this.accessory.displayName} CurrentPosition ${this.CurrentPosition}`);
254
253
  if (this.setNewTarget) {
255
254
  this.platform.log.info(`Curtain: ${this.accessory.displayName} Checking Status ...`);
256
255
  }
257
256
 
258
257
  if (this.setNewTarget) {
258
+ this.setMinMax();
259
259
  if (this.TargetPosition > this.CurrentPosition) {
260
260
  this.platform.debug(`Curtain: ${this.accessory.displayName} Closing, CurrentPosition: ${this.CurrentPosition}`);
261
261
  this.PositionState = this.platform.Characteristic.PositionState.INCREASING;
@@ -345,13 +345,13 @@ export class Curtain {
345
345
  // CurrentPosition
346
346
  this.setMinMax();
347
347
  this.CurrentPosition = 100 - this.deviceStatus.body.slidePosition!;
348
- this.setMinMax();
349
348
  this.platform.debug(`Curtain ${this.accessory.displayName} CurrentPosition: ${this.CurrentPosition}`);
350
349
  if (this.setNewTarget) {
351
350
  this.platform.log.info(`Checking ${this.accessory.displayName} Status ...`);
352
351
  }
353
352
 
354
353
  if (this.deviceStatus.body.moving) {
354
+ this.setMinMax();
355
355
  if (this.TargetPosition > this.CurrentPosition) {
356
356
  this.platform.debug(`Curtain: ${this.accessory.displayName} Closing, CurrentPosition: ${this.CurrentPosition} `);
357
357
  this.PositionState = this.platform.Characteristic.PositionState.INCREASING;
@@ -421,7 +421,6 @@ export class Curtain {
421
421
  }).then(() => {
422
422
  // Stop to monitor
423
423
  switchbot.stopScan();
424
- this.setMinMax();
425
424
  this.parseStatus();
426
425
  this.updateHomeKitCharacteristics();
427
426
  }).catch(async (e: any) => {
@@ -437,8 +436,8 @@ export class Curtain {
437
436
  if (this.platform.config.credentials?.openToken) {
438
437
  this.platform.log.warn(`Curtain: ${this.accessory.displayName} Using OpenAPI Connection`);
439
438
  await this.openAPIRefreshStatus();
440
- this.apiError(e);
441
439
  }
440
+ this.apiError(e);
442
441
  });
443
442
  }
444
443
 
@@ -448,7 +447,6 @@ export class Curtain {
448
447
  try {
449
448
  this.deviceStatus = (await this.platform.axios.get(`${DeviceURL}/${this.device.deviceId}/status`)).data;
450
449
  this.platform.debug(`Curtain: ${this.accessory.displayName} refreshStatus: ${JSON.stringify(this.deviceStatus)}`);
451
- this.setMinMax();
452
450
  this.parseStatus();
453
451
  this.updateHomeKitCharacteristics();
454
452
  } catch (e: any) {
@@ -497,6 +495,7 @@ export class Curtain {
497
495
  this.platform.log.warn(`Curtain: ${this.accessory.displayName} Using OpenAPI Connection`);
498
496
  await this.OpenAPIpushChanges();
499
497
  }
498
+ this.apiError(e);
500
499
  });
501
500
  }
502
501
 
@@ -531,6 +530,7 @@ export class Curtain {
531
530
  this.platform.log.error(`Curtain: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,`
532
531
  + ` Error: ${JSON.stringify(e)}`);
533
532
  }
533
+ this.apiError(e);
534
534
  }
535
535
  }
536
536
  }
@@ -629,20 +629,22 @@ export class Curtain {
629
629
 
630
630
  this.TargetPosition = value;
631
631
 
632
+ this.setMinMax();
632
633
  if (value > this.CurrentPosition) {
633
634
  this.PositionState = this.platform.Characteristic.PositionState.INCREASING;
634
635
  this.setNewTarget = true;
635
- this.setMinMax();
636
+ this.platform.debug(`Curtain: ${this.accessory.displayName} value: ${value}, CurrentPosition: ${this.CurrentPosition}`);
636
637
  } else if (value < this.CurrentPosition) {
637
638
  this.PositionState = this.platform.Characteristic.PositionState.DECREASING;
638
639
  this.setNewTarget = true;
639
- this.setMinMax();
640
+ this.platform.debug(`Curtain: ${this.accessory.displayName} value: ${value}, CurrentPosition: ${this.CurrentPosition}`);
640
641
  } else {
641
642
  this.PositionState = this.platform.Characteristic.PositionState.STOPPED;
642
643
  this.setNewTarget = false;
643
- this.setMinMax();
644
+ this.platform.debug(`Curtain: ${this.accessory.displayName} value: ${value}, CurrentPosition: ${this.CurrentPosition}`);
644
645
  }
645
646
  this.service.setCharacteristic(this.platform.Characteristic.PositionState, this.PositionState);
647
+ this.service.getCharacteristic(this.platform.Characteristic.PositionState).updateValue(this.PositionState);
646
648
 
647
649
  /**
648
650
  * If Curtain movement time is short, the moving flag from backend is always false.
@@ -340,6 +340,7 @@ export class Humidifier {
340
340
  this.platform.log.warn(`Humidifier: ${this.accessory.displayName} Using OpenAPI Connection`);
341
341
  await this.openAPIRefreshStatus();
342
342
  }
343
+ this.apiError(e);
343
344
  });
344
345
  }
345
346
 
@@ -387,7 +388,7 @@ export class Humidifier {
387
388
  const switchbot = this.connectBLE();
388
389
  switchbot.discover({ model: 'e', quick: true, id: this.device.bleMac }).then((device_list) => {
389
390
  this.platform.log.info(`${this.accessory.displayName} Target Position: ${this.Active}`);
390
- return device_list[0].runToPos(100 - Number(this.Active));
391
+ return device_list[0].percentage(this.RelativeHumidityHumidifierThreshold);
391
392
  }).then(() => {
392
393
  this.platform.device(`Humidifier: ${this.accessory.displayName} Done.`);
393
394
  }).catch(async (e: any) => {
@@ -404,6 +405,7 @@ export class Humidifier {
404
405
  this.platform.log.warn(`Humidifier: ${this.accessory.displayName} Using OpenAPI Connection`);
405
406
  await this.OpenAPIpushChanges();
406
407
  }
408
+ this.apiError(e);
407
409
  });
408
410
  }
409
411
 
@@ -291,6 +291,7 @@ export class Meter {
291
291
  this.platform.log.warn(`Meter: ${this.accessory.displayName} Using OpenAPI Connection`);
292
292
  await this.openAPIRefreshStatus();
293
293
  }
294
+ this.apiError(e);
294
295
  });
295
296
  }
296
297
 
@@ -210,6 +210,7 @@ export class Motion {
210
210
  this.platform.log.warn(`Motion Sensor: ${this.accessory.displayName} Using OpenAPI Connection`);
211
211
  await this.openAPIRefreshStatus();
212
212
  }
213
+ this.apiError(e);
213
214
  });
214
215
  }
215
216
 
@@ -373,8 +373,8 @@ export class AirConditioner {
373
373
  this.platform.log.error(`Air Conditioner: ${this.accessory.displayName} Hub Device is offline.`);
374
374
  break;
375
375
  case 190:
376
- this.platform.log.error(`Air Conditioner: ${this.accessory.displayName} Device internal error due to device states not synchronized with server,`
377
- + ` Or command: ${JSON.stringify(push.data)} format is invalid`);
376
+ this.platform.log.error(`Air Conditioner: ${this.accessory.displayName} Device internal error due to device states not synchronized`
377
+ + ` with server, Or command: ${JSON.stringify(push.data)} format is invalid`);
378
378
  break;
379
379
  case 100:
380
380
  this.platform.debug(`Air Conditioner: ${this.accessory.displayName} Command successfully sent.`);
@@ -242,8 +242,8 @@ export class AirPurifier {
242
242
  this.platform.log.error(`Air Purifier: ${this.accessory.displayName} Hub Device is offline.`);
243
243
  break;
244
244
  case 190:
245
- this.platform.log.error(`Air Purifier: ${this.accessory.displayName} Device internal error due to device states not synchronized with server,`
246
- + ` Or command: ${JSON.stringify(push.data)} format is invalid`);
245
+ this.platform.log.error(`Air Purifier: ${this.accessory.displayName} Device internal error due to device states not synchronized`
246
+ + ` with server, Or command: ${JSON.stringify(push.data)} format is invalid`);
247
247
  break;
248
248
  case 100:
249
249
  this.platform.debug(`Air Purifier: ${this.accessory.displayName} Command successfully sent.`);
@@ -142,8 +142,8 @@ export class Camera {
142
142
  this.platform.log.error(`Camera: ${this.accessory.displayName} Hub Device is offline.`);
143
143
  break;
144
144
  case 190:
145
- this.platform.log.error(`Camera: ${this.accessory.displayName} Device internal error due to device states not synchronized with server,`
146
- + ` Or command: ${JSON.stringify(push.data)} format is invalid`);
145
+ this.platform.log.error(`Camera: ${this.accessory.displayName} Device internal error due to device states not synchronized`
146
+ + ` with server, Or command: ${JSON.stringify(push.data)} format is invalid`);
147
147
  break;
148
148
  case 100:
149
149
  this.platform.debug(`Camera: ${this.accessory.displayName} Command successfully sent.`);
@@ -264,8 +264,8 @@ export class Fan {
264
264
  this.platform.log.error(`Fan: ${this.accessory.displayName} Hub Device is offline.`);
265
265
  break;
266
266
  case 190:
267
- this.platform.log.error(`Fan: ${this.accessory.displayName} Device internal error due to device states not synchronized with server,`
268
- + ` Or command: ${JSON.stringify(push.data)} format is invalid`);
267
+ this.platform.log.error(`Fan: ${this.accessory.displayName} Device internal error due to device states not synchronized`
268
+ + ` with server, Or command: ${JSON.stringify(push.data)} format is invalid`);
269
269
  break;
270
270
  case 100:
271
271
  this.platform.debug(`Fan: ${this.accessory.displayName} Command successfully sent.`);
@@ -176,8 +176,8 @@ export class Light {
176
176
  this.platform.log.error(`Light: ${this.accessory.displayName} Hub Device is offline.`);
177
177
  break;
178
178
  case 190:
179
- this.platform.log.error(`Light: ${this.accessory.displayName} Device internal error due to device states not synchronized with server,`
180
- + ` Or command: ${JSON.stringify(push.data)} format is invalid`);
179
+ this.platform.log.error(`Light: ${this.accessory.displayName} Device internal error due to device states not synchronized`
180
+ + ` with server, Or command: ${JSON.stringify(push.data)} format is invalid`);
181
181
  break;
182
182
  case 100:
183
183
  this.platform.debug(`Light: ${this.accessory.displayName} Command successfully sent.`);
@@ -163,8 +163,8 @@ export class Others {
163
163
  this.platform.log.error(`Other: ${this.accessory.displayName} Hub Device is offline.`);
164
164
  break;
165
165
  case 190:
166
- this.platform.log.error(`Other: ${this.accessory.displayName} Device internal error due to device states not synchronized with server,`
167
- + ` Or command: ${JSON.stringify(push.data)} format is invalid`);
166
+ this.platform.log.error(`Other: ${this.accessory.displayName} Device internal error due to device states not synchronized`
167
+ + ` with server, Or command: ${JSON.stringify(push.data)} format is invalid`);
168
168
  break;
169
169
  case 100:
170
170
  this.platform.debug(`Other: ${this.accessory.displayName} Command successfully sent.`);
@@ -156,8 +156,8 @@ export class WaterHeater {
156
156
  this.platform.log.error(`Water Heater: ${this.accessory.displayName} Hub Device is offline.`);
157
157
  break;
158
158
  case 190:
159
- this.platform.log.error(`Water Heater: ${this.accessory.displayName} Device internal error due to device states not synchronized with server,`
160
- + ` Or command: ${JSON.stringify(push.data)} format is invalid`);
159
+ this.platform.log.error(`Water Heater: ${this.accessory.displayName} Device internal error due to device states not synchronized`
160
+ + ` with server, Or command: ${JSON.stringify(push.data)} format is invalid`);
161
161
  break;
162
162
  case 100:
163
163
  this.platform.debug(`Water Heater: ${this.accessory.displayName} Command successfully sent.`);