@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.
- package/CHANGELOG.md +6 -0
- package/README.md +10 -0
- package/dist/device/bot.d.ts +2 -2
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +3 -0
- package/dist/device/bot.js.map +1 -1
- package/dist/device/colorbulb.d.ts +1 -1
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +3 -0
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/humidifier.d.ts +4 -4
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +3 -3
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/lock.d.ts +2 -1
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +14 -15
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +0 -3
- package/dist/device/meter.js.map +1 -1
- package/dist/device/motion.d.ts +2 -2
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +3 -4
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +5 -4
- package/dist/device/plug.js.map +1 -1
- package/dist/platform.js +1 -1
- package/dist/platform.js.map +1 -1
- package/package.json +1 -1
- package/src/device/bot.ts +5 -2
- package/src/device/colorbulb.ts +4 -1
- package/src/device/humidifier.ts +7 -10
- package/src/device/lock.ts +16 -17
- package/src/device/meter.ts +0 -6
- package/src/device/motion.ts +5 -9
- package/src/device/plug.ts +5 -5
- package/src/platform.ts +1 -1
package/src/device/plug.ts
CHANGED
|
@@ -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
|
|
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/
|
|
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;
|