@switchbot/homebridge-switchbot 1.10.2-beta.4 → 1.10.2-beta.8

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.
@@ -38,9 +38,6 @@ export class Plug {
38
38
  this.On = this.accessory.context.On;
39
39
  }
40
40
 
41
- // Plug Config
42
- this.debugLog(`Plug: ${this.accessory.displayName} Config: (offline: ${device.offline})`);
43
-
44
41
  // this is subject we use to track when we need to POST changes to the SwitchBot API
45
42
  this.doPlugUpdate = new Subject();
46
43
  this.plugUpdateInProgress = false;
@@ -55,7 +52,7 @@ export class Plug {
55
52
  .setCharacteristic(this.platform.Characteristic.Model, this.model(device))
56
53
  .setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!);
57
54
 
58
- // get the WindowCovering service if it exists, otherwise create a new WindowCovering service
55
+ // get the Outlet service if it exists, otherwise create a new Outlet service
59
56
  // you can create multiple services for each accessory
60
57
  (this.service = accessory.getService(this.platform.Service.Outlet) || accessory.addService(this.platform.Service.Outlet)),
61
58
  `${device.deviceName} ${device.deviceType}`;
@@ -69,7 +66,7 @@ export class Plug {
69
66
  this.service.setCharacteristic(this.platform.Characteristic.Name, accessory.displayName);
70
67
 
71
68
  // each service must implement at-minimum the "required characteristics" for the given service type
72
- // see https://developers.homebridge.io/#/service/WindowCovering
69
+ // see https://developers.homebridge.io/#/service/Outlet
73
70
 
74
71
  // create handlers for required characteristics
75
72
  this.service.getCharacteristic(this.platform.Characteristic.On).onSet(this.OnSet.bind(this));
@@ -277,6 +274,9 @@ export class Plug {
277
274
  if (device.scanDuration !== undefined) {
278
275
  config['scanDuration'] = device.scanDuration;
279
276
  }
277
+ if (device.offline !== undefined) {
278
+ config['offline'] = device.offline;
279
+ }
280
280
  if (Object.entries(config).length !== 0) {
281
281
  this.warnLog(`Plug: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
282
282
  }
package/src/platform.ts CHANGED
@@ -389,7 +389,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
389
389
  this.debugLog(`Discovered ${device.deviceType}: ${device.deviceId}`);
390
390
  this.createPlug(device);
391
391
  break;
392
- case 'Lock':
392
+ case 'Smart Lock':
393
393
  this.debugLog(`Discovered ${device.deviceType}: ${device.deviceId}`);
394
394
  this.createLock(device);
395
395
  break;