@switchbot/homebridge-switchbot 3.5.1-beta.0 → 3.5.1-beta.10
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/README.md +16 -0
- package/dist/device/blindtilt.d.ts +15 -6
- package/dist/device/blindtilt.d.ts.map +1 -1
- package/dist/device/blindtilt.js +224 -370
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.d.ts +9 -4
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +197 -221
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.d.ts +10 -5
- package/dist/device/ceilinglight.d.ts.map +1 -1
- package/dist/device/ceilinglight.js +214 -292
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts +10 -5
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +335 -421
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts +9 -4
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +121 -200
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts +20 -7
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +229 -403
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/device.d.ts +41 -22
- package/dist/device/device.d.ts.map +1 -1
- package/dist/device/device.js +212 -181
- package/dist/device/device.js.map +1 -1
- package/dist/device/fan.d.ts +9 -4
- package/dist/device/fan.d.ts.map +1 -1
- package/dist/device/fan.js +204 -249
- package/dist/device/fan.js.map +1 -1
- package/dist/device/hub.d.ts +9 -5
- package/dist/device/hub.d.ts.map +1 -1
- package/dist/device/hub.js +107 -233
- package/dist/device/hub.js.map +1 -1
- package/dist/device/humidifier.d.ts +12 -4
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +193 -235
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/iosensor.d.ts +9 -4
- package/dist/device/iosensor.d.ts.map +1 -1
- package/dist/device/iosensor.js +92 -159
- package/dist/device/iosensor.js.map +1 -1
- package/dist/device/lightstrip.d.ts +10 -5
- package/dist/device/lightstrip.d.ts.map +1 -1
- package/dist/device/lightstrip.js +288 -370
- package/dist/device/lightstrip.js.map +1 -1
- package/dist/device/lock.d.ts +10 -5
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +172 -219
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts +9 -4
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +94 -160
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts +9 -4
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +95 -157
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.d.ts +9 -4
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +85 -144
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts +9 -4
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +100 -127
- package/dist/device/plug.js.map +1 -1
- package/dist/device/robotvacuumcleaner.d.ts +9 -6
- package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
- package/dist/device/robotvacuumcleaner.js +172 -259
- package/dist/device/robotvacuumcleaner.js.map +1 -1
- package/dist/device/waterdetector.d.ts +12 -4
- package/dist/device/waterdetector.d.ts.map +1 -1
- package/dist/device/waterdetector.js +106 -131
- package/dist/device/waterdetector.js.map +1 -1
- package/dist/irdevice/airconditioner.d.ts +2 -1
- package/dist/irdevice/airconditioner.d.ts.map +1 -1
- package/dist/irdevice/airconditioner.js +2 -3
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.d.ts +2 -1
- package/dist/irdevice/airpurifier.d.ts.map +1 -1
- package/dist/irdevice/airpurifier.js +2 -3
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.d.ts +2 -1
- package/dist/irdevice/camera.d.ts.map +1 -1
- package/dist/irdevice/camera.js +2 -3
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.d.ts +2 -1
- package/dist/irdevice/fan.d.ts.map +1 -1
- package/dist/irdevice/fan.js +2 -3
- package/dist/irdevice/fan.js.map +1 -1
- package/dist/irdevice/irdevice.d.ts +3 -1
- package/dist/irdevice/irdevice.d.ts.map +1 -1
- package/dist/irdevice/irdevice.js +5 -1
- package/dist/irdevice/irdevice.js.map +1 -1
- package/dist/irdevice/light.d.ts +2 -1
- package/dist/irdevice/light.d.ts.map +1 -1
- package/dist/irdevice/light.js +2 -3
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.d.ts +2 -1
- package/dist/irdevice/other.d.ts.map +1 -1
- package/dist/irdevice/other.js +2 -3
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.d.ts +2 -1
- package/dist/irdevice/tv.d.ts.map +1 -1
- package/dist/irdevice/tv.js +2 -3
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.d.ts +2 -1
- package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +2 -3
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.d.ts +2 -1
- package/dist/irdevice/waterheater.d.ts.map +1 -1
- package/dist/irdevice/waterheater.js +2 -3
- package/dist/irdevice/waterheater.js.map +1 -1
- package/dist/platform.d.ts +14 -14
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +102 -86
- package/dist/platform.js.map +1 -1
- package/dist/settings.d.ts +49 -190
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +19 -0
- package/dist/settings.js.map +1 -1
- package/dist/types/bledevicestatus.d.ts +279 -0
- package/dist/types/bledevicestatus.d.ts.map +1 -0
- package/dist/types/bledevicestatus.js +2 -0
- package/dist/types/bledevicestatus.js.map +1 -0
- package/dist/types/devicelist.d.ts +89 -0
- package/dist/types/devicelist.d.ts.map +1 -0
- package/dist/types/devicelist.js +6 -0
- package/dist/types/devicelist.js.map +1 -0
- package/dist/types/deviceresponse.d.ts +13 -0
- package/dist/types/deviceresponse.d.ts.map +1 -0
- package/dist/types/deviceresponse.js +2 -0
- package/dist/types/deviceresponse.js.map +1 -0
- package/dist/types/devicestatus.d.ts +149 -0
- package/dist/types/devicestatus.d.ts.map +1 -0
- package/dist/types/devicestatus.js +3 -0
- package/dist/types/devicestatus.js.map +1 -0
- package/dist/types/devicewebhookstatus.d.ts +156 -0
- package/dist/types/devicewebhookstatus.d.ts.map +1 -0
- package/dist/types/devicewebhookstatus.js +2 -0
- package/dist/types/devicewebhookstatus.js.map +1 -0
- package/dist/types/irdevicelist.d.ts +10 -0
- package/dist/types/irdevicelist.d.ts.map +1 -0
- package/dist/types/irdevicelist.js +2 -0
- package/dist/types/irdevicelist.js.map +1 -0
- package/dist/types/pushbody.d.ts +6 -0
- package/dist/types/pushbody.d.ts.map +1 -0
- package/dist/types/pushbody.js +2 -0
- package/dist/types/pushbody.js.map +1 -0
- package/dist/utils.d.ts +25 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +28 -0
- package/dist/utils.js.map +1 -1
- package/package.json +11 -11
- package/src/device/blindtilt.ts +254 -376
- package/src/device/bot.ts +209 -224
- package/src/device/ceilinglight.ts +227 -297
- package/src/device/colorbulb.ts +345 -435
- package/src/device/contact.ts +139 -200
- package/src/device/curtain.ts +254 -414
- package/src/device/device.ts +221 -190
- package/src/device/fan.ts +222 -253
- package/src/device/hub.ts +127 -248
- package/src/device/humidifier.ts +217 -246
- package/src/device/iosensor.ts +115 -168
- package/src/device/lightstrip.ts +303 -380
- package/src/device/lock.ts +188 -224
- package/src/device/meter.ts +117 -179
- package/src/device/meterplus.ts +118 -176
- package/src/device/motion.ts +100 -146
- package/src/device/plug.ts +111 -131
- package/src/device/robotvacuumcleaner.ts +191 -258
- package/src/device/waterdetector.ts +124 -141
- package/src/irdevice/airconditioner.ts +4 -4
- package/src/irdevice/airpurifier.ts +4 -4
- package/src/irdevice/camera.ts +4 -4
- package/src/irdevice/fan.ts +4 -4
- package/src/irdevice/irdevice.ts +8 -2
- package/src/irdevice/light.ts +4 -4
- package/src/irdevice/other.ts +4 -4
- package/src/irdevice/tv.ts +4 -4
- package/src/irdevice/vacuumcleaner.ts +4 -4
- package/src/irdevice/waterheater.ts +4 -4
- package/src/platform.ts +104 -87
- package/src/settings.ts +30 -238
- package/src/types/bledevicestatus.ts +305 -0
- package/src/types/devicelist.ts +124 -0
- package/src/types/deviceresponse.ts +15 -0
- package/src/types/devicestatus.ts +178 -0
- package/src/types/devicewebhookstatus.ts +196 -0
- package/src/types/irdevicelist.ts +15 -0
- package/src/types/pushbody.ts +9 -0
- package/src/utils.ts +33 -0
package/dist/device/lock.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* lock.ts: @switchbot/homebridge-switchbot.
|
|
4
4
|
*/
|
|
5
5
|
import { deviceBase } from './device.js';
|
|
6
|
-
import {
|
|
7
|
-
import { debounceTime, skipWhile, take, tap } from 'rxjs
|
|
6
|
+
import { SwitchBotBLEModel, SwitchBotBLEModelName } from 'node-switchbot';
|
|
7
|
+
import { Subject, debounceTime, interval, skipWhile, take, tap } from 'rxjs';
|
|
8
8
|
export class Lock extends deviceBase {
|
|
9
9
|
platform;
|
|
10
10
|
// Services
|
|
@@ -114,14 +114,14 @@ export class Lock extends deviceBase {
|
|
|
114
114
|
this.refreshStatus();
|
|
115
115
|
// Update Homekit
|
|
116
116
|
this.updateHomeKitCharacteristics();
|
|
117
|
+
//regisiter webhook event handler
|
|
118
|
+
this.registerWebhook();
|
|
117
119
|
// Start an update interval
|
|
118
120
|
interval(this.deviceRefreshRate * 1000)
|
|
119
121
|
.pipe(skipWhile(() => this.lockUpdateInProgress))
|
|
120
122
|
.subscribe(async () => {
|
|
121
123
|
await this.refreshStatus();
|
|
122
124
|
});
|
|
123
|
-
//regisiter webhook event handler
|
|
124
|
-
this.registerWebhook(accessory, device);
|
|
125
125
|
// Watch for Lock change events
|
|
126
126
|
// We put in a debounce of 100ms so we don't make duplicate calls
|
|
127
127
|
this.doLockUpdate
|
|
@@ -133,86 +133,64 @@ export class Lock extends deviceBase {
|
|
|
133
133
|
await this.pushChanges();
|
|
134
134
|
}
|
|
135
135
|
catch (e) {
|
|
136
|
-
this.apiError(e);
|
|
137
|
-
this.errorLog(
|
|
138
|
-
+ ` Error Message: ${JSON.stringify(e.message)}`);
|
|
136
|
+
await this.apiError(e);
|
|
137
|
+
await this.errorLog(`failed pushChanges with ${device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`);
|
|
139
138
|
}
|
|
140
139
|
this.lockUpdateInProgress = false;
|
|
141
140
|
});
|
|
142
141
|
}
|
|
143
142
|
async BLEparseStatus(serviceData) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
this.LockMechanism.LockTargetState = this.hap.Characteristic.LockTargetState.UNSECURED;
|
|
154
|
-
}
|
|
155
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName}`
|
|
156
|
-
+ ` LockTargetState: ${this.LockMechanism.LockTargetState}, LockCurrentState: ${this.LockMechanism.LockCurrentState}`);
|
|
143
|
+
await this.debugLog('BLEparseStatus');
|
|
144
|
+
// LockCurrentState
|
|
145
|
+
this.LockMechanism.LockCurrentState = serviceData.status === 'locked'
|
|
146
|
+
? this.hap.Characteristic.LockCurrentState.SECURED : this.hap.Characteristic.LockCurrentState.UNSECURED;
|
|
147
|
+
await this.debugLog(`LockCurrentState: ${this.LockMechanism.LockCurrentState}`);
|
|
148
|
+
// LockTargetState
|
|
149
|
+
this.LockMechanism.LockTargetState = serviceData.status === 'locked'
|
|
150
|
+
? this.hap.Characteristic.LockTargetState.SECURED : this.hap.Characteristic.LockTargetState.UNSECURED;
|
|
151
|
+
await this.debugLog(`LockTargetState: ${this.LockMechanism.LockTargetState}`);
|
|
157
152
|
// Contact Sensor
|
|
158
|
-
if (!this.device.lock?.hide_contactsensor) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
break;
|
|
163
|
-
default:
|
|
164
|
-
this.ContactSensor.ContactSensorState = this.hap.Characteristic.ContactSensorState.CONTACT_DETECTED;
|
|
165
|
-
}
|
|
166
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} ContactSensorState: ${this.ContactSensor.ContactSensorState}`);
|
|
153
|
+
if (!this.device.lock?.hide_contactsensor && this.ContactSensor?.Service) {
|
|
154
|
+
this.ContactSensor.ContactSensorState = serviceData.door_open === 'opened'
|
|
155
|
+
? this.hap.Characteristic.ContactSensorState.CONTACT_NOT_DETECTED : this.hap.Characteristic.ContactSensorState.CONTACT_DETECTED;
|
|
156
|
+
await this.debugLog(`ContactSensorState: ${this.ContactSensor.ContactSensorState}`);
|
|
167
157
|
}
|
|
168
|
-
//
|
|
158
|
+
// BatteryLevel
|
|
169
159
|
this.Battery.BatteryLevel = Number(serviceData.battery);
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}
|
|
176
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName}`
|
|
177
|
-
+ ` BatteryLevel: ${this.Battery.BatteryLevel}, StatusLowBattery: ${this.Battery.StatusLowBattery}`);
|
|
160
|
+
await this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`);
|
|
161
|
+
// StatusLowBattery
|
|
162
|
+
this.Battery.StatusLowBattery = this.Battery.BatteryLevel < 10
|
|
163
|
+
? this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_LOW : this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL;
|
|
164
|
+
await this.debugLog(`StatusLowBattery: ${this.Battery.StatusLowBattery}`);
|
|
178
165
|
}
|
|
179
166
|
async openAPIparseStatus(deviceStatus) {
|
|
180
|
-
this.debugLog(
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
this.
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
this.debugLog(
|
|
198
|
-
//
|
|
199
|
-
this.Battery.
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
else {
|
|
204
|
-
this.Battery.StatusLowBattery = this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL;
|
|
205
|
-
}
|
|
206
|
-
if (Number.isNaN(this.Battery.BatteryLevel)) {
|
|
207
|
-
this.Battery.BatteryLevel = 100;
|
|
208
|
-
}
|
|
209
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} BatteryLevel: ${this.Battery.BatteryLevel},`
|
|
210
|
-
+ ` StatusLowBattery: ${this.Battery.StatusLowBattery}`);
|
|
167
|
+
await this.debugLog('openAPIparseStatus');
|
|
168
|
+
// LockCurrentState
|
|
169
|
+
this.LockMechanism.LockCurrentState = deviceStatus.lockState === 'locked'
|
|
170
|
+
? this.hap.Characteristic.LockCurrentState.SECURED : this.hap.Characteristic.LockCurrentState.UNSECURED;
|
|
171
|
+
await this.debugLog(`LockCurrentState: ${this.LockMechanism.LockCurrentState}`);
|
|
172
|
+
// LockTargetState
|
|
173
|
+
this.LockMechanism.LockTargetState = deviceStatus.lockState === 'locked'
|
|
174
|
+
? this.hap.Characteristic.LockTargetState.SECURED : this.hap.Characteristic.LockTargetState.UNSECURED;
|
|
175
|
+
await this.debugLog(`LockTargetState: ${this.LockMechanism.LockTargetState}`);
|
|
176
|
+
// ContactSensorState
|
|
177
|
+
if (!this.device.lock?.hide_contactsensor && this.ContactSensor?.Service) {
|
|
178
|
+
this.ContactSensor.ContactSensorState = deviceStatus.doorState === 'opened'
|
|
179
|
+
? this.hap.Characteristic.ContactSensorState.CONTACT_NOT_DETECTED : this.hap.Characteristic.ContactSensorState.CONTACT_DETECTED;
|
|
180
|
+
await this.debugLog(`ContactSensorState: ${this.ContactSensor.ContactSensorState}`);
|
|
181
|
+
}
|
|
182
|
+
// BatteryLevel
|
|
183
|
+
this.Battery.BatteryLevel = Number(deviceStatus.battery);
|
|
184
|
+
await this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`);
|
|
185
|
+
// StatusLowBattery
|
|
186
|
+
this.Battery.StatusLowBattery = this.Battery.BatteryLevel < 10
|
|
187
|
+
? this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_LOW : this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL;
|
|
188
|
+
await this.debugLog(`StatusLowBattery: ${this.Battery.StatusLowBattery}`);
|
|
211
189
|
// Firmware Version
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
const deviceVersion = version
|
|
190
|
+
if (deviceStatus.version) {
|
|
191
|
+
const version = deviceStatus.version.toString();
|
|
192
|
+
await this.debugLog(`Firmware Version: ${version.replace(/^V|-.*$/g, '')}`);
|
|
193
|
+
const deviceVersion = version.replace(/^V|-.*$/g, '') ?? '0.0.0';
|
|
216
194
|
this.accessory
|
|
217
195
|
.getService(this.hap.Service.AccessoryInformation)
|
|
218
196
|
.setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
|
|
@@ -220,15 +198,27 @@ export class Lock extends deviceBase {
|
|
|
220
198
|
.getCharacteristic(this.hap.Characteristic.FirmwareRevision)
|
|
221
199
|
.updateValue(deviceVersion);
|
|
222
200
|
this.accessory.context.deviceVersion = deviceVersion;
|
|
223
|
-
this.debugSuccessLog(
|
|
201
|
+
await this.debugSuccessLog(`deviceVersion: ${this.accessory.context.deviceVersion}`);
|
|
224
202
|
}
|
|
225
203
|
}
|
|
204
|
+
async parseStatusWebhook(context) {
|
|
205
|
+
await this.debugLog('parseStatusWebhook');
|
|
206
|
+
await this.debugLog(`(lockState) = Webhook:(${context.lockState}), current:(${this.LockMechanism.LockCurrentState})`);
|
|
207
|
+
// LockCurrentState
|
|
208
|
+
this.LockMechanism.LockCurrentState = context.lockState === 'LOCKED'
|
|
209
|
+
? this.hap.Characteristic.LockCurrentState.SECURED : this.hap.Characteristic.LockCurrentState.UNSECURED;
|
|
210
|
+
await this.debugLog(`LockCurrentState: ${this.LockMechanism.LockCurrentState}`);
|
|
211
|
+
// LockTargetState
|
|
212
|
+
this.LockMechanism.LockTargetState = context.lockState === 'LOCKED'
|
|
213
|
+
? this.hap.Characteristic.LockTargetState.SECURED : this.hap.Characteristic.LockTargetState.UNSECURED;
|
|
214
|
+
await this.debugLog(`LockTargetState: ${this.LockMechanism.LockTargetState}`);
|
|
215
|
+
}
|
|
226
216
|
/**
|
|
227
217
|
* Asks the SwitchBot API for the latest device information
|
|
228
218
|
*/
|
|
229
219
|
async refreshStatus() {
|
|
230
220
|
if (!this.device.enableCloudService && this.OpenAPI) {
|
|
231
|
-
this.errorLog(
|
|
221
|
+
await this.errorLog(`refreshStatus enableCloudService: ${this.device.enableCloudService}`);
|
|
232
222
|
}
|
|
233
223
|
else if (this.BLE) {
|
|
234
224
|
await this.BLERefreshStatus();
|
|
@@ -238,12 +228,11 @@ export class Lock extends deviceBase {
|
|
|
238
228
|
}
|
|
239
229
|
else {
|
|
240
230
|
await this.offlineOff();
|
|
241
|
-
this.debugWarnLog(
|
|
242
|
-
+ ` ${this.device.connectionType}, refreshStatus will not happen.`);
|
|
231
|
+
await this.debugWarnLog(`Connection Type: ${this.device.connectionType}, refreshStatus will not happen.`);
|
|
243
232
|
}
|
|
244
233
|
}
|
|
245
234
|
async BLERefreshStatus() {
|
|
246
|
-
this.debugLog(
|
|
235
|
+
await this.debugLog('BLERefreshStatus');
|
|
247
236
|
const switchbot = await this.switchbotBLE();
|
|
248
237
|
if (switchbot === undefined) {
|
|
249
238
|
await this.BLERefreshConnection(switchbot);
|
|
@@ -254,58 +243,56 @@ export class Lock extends deviceBase {
|
|
|
254
243
|
// Start to monitor advertisement packets
|
|
255
244
|
const serviceData = await this.monitorAdvertisementPackets(switchbot);
|
|
256
245
|
// Update HomeKit
|
|
257
|
-
if (serviceData.model
|
|
246
|
+
if ((serviceData.model === SwitchBotBLEModel.Lock || SwitchBotBLEModel.LockPro)
|
|
247
|
+
&& (serviceData.modelName === SwitchBotBLEModelName.Lock || SwitchBotBLEModelName.LockPro)) {
|
|
258
248
|
await this.BLEparseStatus(serviceData);
|
|
259
249
|
await this.updateHomeKitCharacteristics();
|
|
260
250
|
}
|
|
261
251
|
else {
|
|
262
|
-
this.errorLog(
|
|
252
|
+
await this.errorLog(`failed to get serviceData, serviceData: ${serviceData}`);
|
|
263
253
|
await this.BLERefreshConnection(switchbot);
|
|
264
254
|
}
|
|
265
255
|
})();
|
|
266
256
|
}
|
|
267
257
|
}
|
|
268
258
|
async openAPIRefreshStatus() {
|
|
269
|
-
this.debugLog(
|
|
259
|
+
await this.debugLog('openAPIRefreshStatus');
|
|
270
260
|
try {
|
|
271
261
|
const { body, statusCode } = await this.deviceRefreshStatus();
|
|
272
262
|
const deviceStatus = await body.json();
|
|
273
|
-
await this.
|
|
263
|
+
await this.debugLog(`statusCode: ${statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
274
264
|
;
|
|
275
|
-
if (
|
|
276
|
-
await this.
|
|
277
|
-
await this.openAPIparseStatus(deviceStatus);
|
|
265
|
+
if (await this.successfulStatusCodes(statusCode, deviceStatus)) {
|
|
266
|
+
await this.debugSuccessLog(`statusCode: ${statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
267
|
+
await this.openAPIparseStatus(deviceStatus.body);
|
|
278
268
|
await this.updateHomeKitCharacteristics();
|
|
279
269
|
}
|
|
280
270
|
else {
|
|
281
|
-
await this.
|
|
271
|
+
await this.debugWarnLog(`statusCode: ${statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
272
|
+
await this.debugWarnLog(statusCode, deviceStatus);
|
|
282
273
|
}
|
|
283
274
|
}
|
|
284
275
|
catch (e) {
|
|
285
|
-
this.apiError(e);
|
|
286
|
-
this.errorLog(
|
|
287
|
-
+ ` Connection, Error Message: ${JSON.stringify(e.message)}`);
|
|
276
|
+
await this.apiError(e);
|
|
277
|
+
await this.errorLog(`failed openAPIRefreshStatus with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`);
|
|
288
278
|
}
|
|
289
279
|
}
|
|
290
|
-
async registerWebhook(
|
|
291
|
-
if (device.webhook) {
|
|
292
|
-
this.debugLog(
|
|
293
|
-
this.platform.webhookEventHandler[device.deviceId] = async (context) => {
|
|
280
|
+
async registerWebhook() {
|
|
281
|
+
if (this.device.webhook) {
|
|
282
|
+
await this.debugLog('is listening webhook.');
|
|
283
|
+
this.platform.webhookEventHandler[this.device.deviceId] = async (context) => {
|
|
294
284
|
try {
|
|
295
|
-
this.debugLog(
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
this.debugLog(`${device.deviceType}: ${accessory.displayName} (lockState) = Webhook:(${lockState}), current:(${LockCurrentState})`);
|
|
299
|
-
this.LockMechanism.LockCurrentState = lockState === 'LOCKED' ? 1 : 0;
|
|
300
|
-
this.updateHomeKitCharacteristics();
|
|
285
|
+
await this.debugLog(`received Webhook: ${JSON.stringify(context)}`);
|
|
286
|
+
await this.parseStatusWebhook(context);
|
|
287
|
+
await this.updateHomeKitCharacteristics();
|
|
301
288
|
}
|
|
302
289
|
catch (e) {
|
|
303
|
-
this.errorLog(
|
|
290
|
+
await this.errorLog(`failed to handle webhook. Received: ${JSON.stringify(context)} Error: ${e}`);
|
|
304
291
|
}
|
|
305
292
|
};
|
|
306
293
|
}
|
|
307
294
|
else {
|
|
308
|
-
this.debugLog(
|
|
295
|
+
await this.debugLog('is not listening webhook.');
|
|
309
296
|
}
|
|
310
297
|
}
|
|
311
298
|
/**
|
|
@@ -316,7 +303,7 @@ export class Lock extends deviceBase {
|
|
|
316
303
|
*/
|
|
317
304
|
async pushChanges() {
|
|
318
305
|
if (!this.device.enableCloudService && this.OpenAPI) {
|
|
319
|
-
this.errorLog(
|
|
306
|
+
await this.errorLog(`pushChanges enableCloudService: ${this.device.enableCloudService}`);
|
|
320
307
|
}
|
|
321
308
|
else if (this.BLE) {
|
|
322
309
|
await this.BLEpushChanges();
|
|
@@ -326,8 +313,7 @@ export class Lock extends deviceBase {
|
|
|
326
313
|
}
|
|
327
314
|
else {
|
|
328
315
|
await this.offlineOff();
|
|
329
|
-
this.debugWarnLog(
|
|
330
|
-
+ ` ${this.device.connectionType}, pushChanges will not happen.`);
|
|
316
|
+
await this.debugWarnLog(`Connection Type: ${this.device.connectionType}, pushChanges will not happen.`);
|
|
331
317
|
}
|
|
332
318
|
// Refresh the status from the API
|
|
333
319
|
interval(15000)
|
|
@@ -338,60 +324,63 @@ export class Lock extends deviceBase {
|
|
|
338
324
|
});
|
|
339
325
|
}
|
|
340
326
|
async BLEpushChanges() {
|
|
341
|
-
this.debugLog(
|
|
327
|
+
await this.debugLog('BLEpushChanges');
|
|
342
328
|
if (this.LockMechanism.LockTargetState !== this.accessory.context.LockTargetState) {
|
|
343
|
-
this.
|
|
344
|
-
+ ` LockTargetStateCached: ${this.accessory.context.LockTargetState}`);
|
|
345
|
-
const switchbot = await this.platform.connectBLE();
|
|
346
|
-
// Convert to BLE Address
|
|
329
|
+
const switchbot = await this.platform.connectBLE(this.accessory, this.device);
|
|
347
330
|
await this.convertBLEAddress();
|
|
348
|
-
switchbot
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
331
|
+
if (switchbot !== false) {
|
|
332
|
+
switchbot
|
|
333
|
+
.discover({ model: this.device.bleModel, id: this.device.bleMac })
|
|
334
|
+
.then(async (device_list) => {
|
|
335
|
+
return await this.retryBLE({
|
|
336
|
+
max: await this.maxRetryBLE(),
|
|
337
|
+
fn: async () => {
|
|
338
|
+
if (this.LockMechanism.LockTargetState === this.hap.Characteristic.LockTargetState.SECURED) {
|
|
339
|
+
return await device_list[0].lock({ id: this.device.bleMac });
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
return await device_list[0].unlock({ id: this.device.bleMac });
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
});
|
|
346
|
+
})
|
|
347
|
+
.then(async () => {
|
|
348
|
+
await this.successLog(`LockTargetState: ${this.LockMechanism.LockTargetState} sent over SwitchBot BLE, sent successfully`);
|
|
349
|
+
await this.updateHomeKitCharacteristics();
|
|
350
|
+
})
|
|
351
|
+
.catch(async (e) => {
|
|
352
|
+
await this.apiError(e);
|
|
353
|
+
await this.errorLog(`failed BLEpushChanges with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`);
|
|
354
|
+
await this.BLEPushConnection();
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
await this.errorLog(`wasn't able to establish BLE Connection, node-switchbot: ${switchbot}`);
|
|
363
359
|
await this.BLEPushConnection();
|
|
364
|
-
}
|
|
360
|
+
}
|
|
365
361
|
}
|
|
366
362
|
else {
|
|
367
|
-
this.debugLog(
|
|
368
|
-
+ `
|
|
369
|
-
+ `LockTargetStateCached: ${this.accessory.context.LockTargetState}`);
|
|
363
|
+
await this.debugLog(`No changes (BLEpushChanges), LockTargetState: ${this.LockMechanism.LockTargetState},`
|
|
364
|
+
+ ` LockCurrentState: ${this.LockMechanism.LockCurrentState}`);
|
|
370
365
|
}
|
|
371
366
|
}
|
|
372
367
|
async openAPIpushChanges(LatchUnlock) {
|
|
373
|
-
this.debugLog(
|
|
368
|
+
await this.debugLog('openAPIpushChanges');
|
|
374
369
|
if ((this.LockMechanism.LockTargetState !== this.accessory.context.LockTargetState) || LatchUnlock) {
|
|
375
370
|
// Determine the command based on the LockTargetState or the forceUnlock parameter
|
|
376
|
-
|
|
377
|
-
if (LatchUnlock) {
|
|
378
|
-
command = 'unlock';
|
|
379
|
-
}
|
|
380
|
-
else {
|
|
381
|
-
command = this.LockMechanism.LockTargetState ? 'lock' : 'unlock';
|
|
382
|
-
}
|
|
371
|
+
const command = LatchUnlock ? 'unlock' : this.LockMechanism.LockTargetState ? 'lock' : 'unlock';
|
|
383
372
|
const bodyChange = JSON.stringify({
|
|
384
373
|
command: `${command}`,
|
|
385
374
|
parameter: 'default',
|
|
386
375
|
commandType: 'command',
|
|
387
376
|
});
|
|
388
|
-
this.debugLog(
|
|
377
|
+
await this.debugLog(`SwitchBot OpenAPI bodyChange: ${JSON.stringify(bodyChange)}`);
|
|
389
378
|
try {
|
|
390
379
|
const { body, statusCode } = await this.pushChangeRequest(bodyChange);
|
|
391
380
|
const deviceStatus = await body.json();
|
|
392
|
-
await this.
|
|
393
|
-
if (
|
|
394
|
-
await this.
|
|
381
|
+
await this.debugLog(`statusCode: ${statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
382
|
+
if (await this.successfulStatusCodes(statusCode, deviceStatus)) {
|
|
383
|
+
await this.debugSuccessLog(`statusCode: ${statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
395
384
|
await this.updateHomeKitCharacteristics();
|
|
396
385
|
}
|
|
397
386
|
else {
|
|
@@ -400,25 +389,24 @@ export class Lock extends deviceBase {
|
|
|
400
389
|
}
|
|
401
390
|
}
|
|
402
391
|
catch (e) {
|
|
403
|
-
this.apiError(e);
|
|
404
|
-
this.errorLog(
|
|
405
|
-
+ ` Connection, Error Message: ${JSON.stringify(e.message)}`);
|
|
392
|
+
await this.apiError(e);
|
|
393
|
+
await this.errorLog(`failed openAPIpushChanges with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`);
|
|
406
394
|
}
|
|
407
395
|
}
|
|
408
396
|
else {
|
|
409
|
-
this.debugLog(
|
|
410
|
-
+
|
|
397
|
+
await this.debugLog(`No changes (openAPIpushChanges), LockCurrentState: ${this.LockMechanism.LockCurrentState},`
|
|
398
|
+
+ ` TargetPosition: ${this.LockMechanism.LockTargetState}`);
|
|
411
399
|
}
|
|
412
400
|
}
|
|
413
401
|
/**
|
|
414
402
|
* Handle requests to set the value of the "On" characteristic
|
|
415
403
|
*/
|
|
416
404
|
async LockTargetStateSet(value) {
|
|
417
|
-
if (this.LockMechanism.LockTargetState
|
|
418
|
-
this.
|
|
405
|
+
if (this.LockMechanism.LockTargetState !== this.accessory.context.LockTargetState) {
|
|
406
|
+
await this.infoLog(`Set LockTargetState: ${value}`);
|
|
419
407
|
}
|
|
420
408
|
else {
|
|
421
|
-
this.
|
|
409
|
+
await this.debugLog(`No Changes, LockTargetState: ${value}`);
|
|
422
410
|
}
|
|
423
411
|
this.LockMechanism.LockTargetState = value;
|
|
424
412
|
this.doLockUpdate.next();
|
|
@@ -427,116 +415,81 @@ export class Lock extends deviceBase {
|
|
|
427
415
|
* Handle requests to set the value of the "On" characteristic
|
|
428
416
|
*/
|
|
429
417
|
async OnSet(value) {
|
|
430
|
-
this.debugLog(
|
|
418
|
+
await this.debugLog(`Latch Button Set On: ${value}`);
|
|
431
419
|
if (value) {
|
|
432
|
-
this.debugLog('Attempting to open the latch');
|
|
433
|
-
this.openAPIpushChanges(value).then(() => {
|
|
434
|
-
this.debugLog(
|
|
435
|
-
this.debugLog(
|
|
436
|
-
+ ` SwitchService is: ${this.Switch.Service ? 'available' : 'not available'}`);
|
|
420
|
+
await this.debugLog('Attempting to open the latch');
|
|
421
|
+
this.openAPIpushChanges(value).then(async () => {
|
|
422
|
+
await this.debugLog('Latch opened successfully');
|
|
423
|
+
await this.debugLog(`SwitchService is: ${this.Switch?.Service ? 'available' : 'not available'}`);
|
|
437
424
|
// simulate button press to turn the switch back off
|
|
438
|
-
if (this.Switch
|
|
425
|
+
if (this.Switch?.Service) {
|
|
439
426
|
const SwitchService = this.Switch.Service;
|
|
440
427
|
// Simulate a button press by waiting a short period before turning the switch off
|
|
441
|
-
setTimeout(() => {
|
|
428
|
+
setTimeout(async () => {
|
|
442
429
|
SwitchService.getCharacteristic(this.hap.Characteristic.On).updateValue(false);
|
|
443
|
-
this.debugLog(
|
|
430
|
+
await this.debugLog('Latch button switched off automatically.');
|
|
444
431
|
}, 500); // 500 ms delay
|
|
445
432
|
}
|
|
446
|
-
}).catch((e) => {
|
|
433
|
+
}).catch(async (e) => {
|
|
447
434
|
// Log the error if the operation failed
|
|
448
|
-
this.debugLog(`Error opening latch: ${e}`);
|
|
435
|
+
await this.debugLog(`Error opening latch: ${e}`);
|
|
449
436
|
// Ensure we turn the switch back off even in case of an error
|
|
450
|
-
if (this.Switch
|
|
437
|
+
if (this.Switch?.Service) {
|
|
451
438
|
this.Switch.Service.getCharacteristic(this.hap.Characteristic.On).updateValue(false);
|
|
452
|
-
this.debugLog(
|
|
439
|
+
await this.debugLog('Latch button switched off after an error.');
|
|
453
440
|
}
|
|
454
441
|
});
|
|
455
442
|
}
|
|
456
443
|
else {
|
|
457
|
-
this.debugLog(
|
|
444
|
+
await this.debugLog('Switch is off, nothing to do');
|
|
458
445
|
}
|
|
459
446
|
this.Switch.On = value;
|
|
460
447
|
this.doLockUpdate.next();
|
|
461
448
|
}
|
|
462
449
|
async updateHomeKitCharacteristics() {
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} LockTargetState: ${this.LockMechanism.LockTargetState}`);
|
|
476
|
-
}
|
|
477
|
-
else {
|
|
478
|
-
this.accessory.context.LockTargetState = this.LockMechanism.LockTargetState;
|
|
479
|
-
this.LockMechanism.Service.updateCharacteristic(this.hap.Characteristic.LockTargetState, this.LockMechanism.LockTargetState);
|
|
480
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic`
|
|
481
|
-
+ ` LockTargetState: ${this.LockMechanism.LockTargetState}`);
|
|
482
|
-
}
|
|
483
|
-
if (this.LockMechanism.LockCurrentState === undefined) {
|
|
484
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} LockCurrentState: ${this.LockMechanism.LockCurrentState}`);
|
|
485
|
-
}
|
|
486
|
-
else {
|
|
487
|
-
this.accessory.context.LockCurrentState = this.LockMechanism.LockCurrentState;
|
|
488
|
-
this.LockMechanism.Service.updateCharacteristic(this.hap.Characteristic.LockCurrentState, this.LockMechanism.LockCurrentState);
|
|
489
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic`
|
|
490
|
-
+ ` LockCurrentState: ${this.LockMechanism.LockCurrentState}`);
|
|
491
|
-
}
|
|
492
|
-
if (this.Battery.BatteryLevel === undefined) {
|
|
493
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} BatteryLevel: ${this.Battery.BatteryLevel}`);
|
|
494
|
-
}
|
|
495
|
-
else {
|
|
496
|
-
this.accessory.context.BatteryLevel = this.Battery.BatteryLevel;
|
|
497
|
-
this.Battery.Service.updateCharacteristic(this.hap.Characteristic.BatteryLevel, this.Battery.BatteryLevel);
|
|
498
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic`
|
|
499
|
-
+ ` BatteryLevel: ${this.Battery.BatteryLevel}`);
|
|
500
|
-
}
|
|
501
|
-
if (this.Battery.StatusLowBattery === undefined) {
|
|
502
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} StatusLowBattery: ${this.Battery.StatusLowBattery}`);
|
|
503
|
-
}
|
|
504
|
-
else {
|
|
505
|
-
this.accessory.context.StatusLowBattery = this.Battery.StatusLowBattery;
|
|
506
|
-
this.Battery.Service.updateCharacteristic(this.hap.Characteristic.StatusLowBattery, this.Battery.StatusLowBattery);
|
|
507
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic`
|
|
508
|
-
+ ` StatusLowBattery: ${this.Battery.StatusLowBattery}`);
|
|
509
|
-
}
|
|
450
|
+
// LockCurrentState
|
|
451
|
+
await this.updateCharacteristic(this.LockMechanism.Service, this.hap.Characteristic.LockTargetState, this.LockMechanism.LockTargetState, 'LockTargetState');
|
|
452
|
+
// LockCurrentState
|
|
453
|
+
await this.updateCharacteristic(this.LockMechanism.Service, this.hap.Characteristic.LockCurrentState, this.LockMechanism.LockCurrentState, 'LockCurrentState');
|
|
454
|
+
// ContactSensorState
|
|
455
|
+
if (!this.device.lock?.hide_contactsensor && this.ContactSensor?.Service) {
|
|
456
|
+
await this.updateCharacteristic(this.ContactSensor.Service, this.hap.Characteristic.ContactSensorState, this.ContactSensor.ContactSensorState, 'ContactSensorState');
|
|
457
|
+
}
|
|
458
|
+
// BatteryLevel
|
|
459
|
+
await this.updateCharacteristic(this.Battery.Service, this.hap.Characteristic.BatteryLevel, this.Battery.BatteryLevel, 'BatteryLevel');
|
|
460
|
+
// StatusLowBattery
|
|
461
|
+
await this.updateCharacteristic(this.Battery.Service, this.hap.Characteristic.StatusLowBattery, this.Battery.StatusLowBattery, 'StatusLowBattery');
|
|
510
462
|
}
|
|
511
463
|
async BLEPushConnection() {
|
|
512
464
|
if (this.platform.config.credentials?.token && this.device.connectionType === 'BLE/OpenAPI') {
|
|
513
|
-
this.warnLog(
|
|
465
|
+
await this.warnLog('Using OpenAPI Connection to Push Changes');
|
|
514
466
|
await this.openAPIpushChanges();
|
|
515
467
|
}
|
|
516
468
|
}
|
|
517
469
|
async BLERefreshConnection(switchbot) {
|
|
518
|
-
this.errorLog(
|
|
519
|
-
+ ` ${JSON.stringify(switchbot)}`);
|
|
470
|
+
await this.errorLog(`wasn't able to establish BLE Connection, node-switchbot: ${JSON.stringify(switchbot)}`);
|
|
520
471
|
if (this.platform.config.credentials?.token && this.device.connectionType === 'BLE/OpenAPI') {
|
|
521
|
-
this.warnLog(
|
|
472
|
+
await this.warnLog('Using OpenAPI Connection to Refresh Status');
|
|
522
473
|
await this.openAPIRefreshStatus();
|
|
523
474
|
}
|
|
524
475
|
}
|
|
525
476
|
async offlineOff() {
|
|
526
477
|
if (this.device.offline) {
|
|
527
|
-
if (!this.device.lock?.hide_contactsensor) {
|
|
528
|
-
this.ContactSensor.Service.updateCharacteristic(this.hap.Characteristic.ContactSensorState, this.hap.Characteristic.ContactSensorState.CONTACT_DETECTED);
|
|
529
|
-
}
|
|
530
478
|
this.LockMechanism.Service.updateCharacteristic(this.hap.Characteristic.LockTargetState, this.hap.Characteristic.LockTargetState.SECURED);
|
|
531
479
|
this.LockMechanism.Service.updateCharacteristic(this.hap.Characteristic.LockCurrentState, this.hap.Characteristic.LockCurrentState.SECURED);
|
|
480
|
+
if (!this.device.lock?.hide_contactsensor && this.ContactSensor?.Service) {
|
|
481
|
+
this.ContactSensor.Service.updateCharacteristic(this.hap.Characteristic.ContactSensorState, this.hap.Characteristic.ContactSensorState.CONTACT_DETECTED);
|
|
482
|
+
}
|
|
532
483
|
}
|
|
533
484
|
}
|
|
534
485
|
async apiError(e) {
|
|
535
|
-
if (!this.device.lock?.hide_contactsensor) {
|
|
536
|
-
this.ContactSensor.Service.updateCharacteristic(this.hap.Characteristic.ContactSensorState, e);
|
|
537
|
-
}
|
|
538
486
|
this.LockMechanism.Service.updateCharacteristic(this.hap.Characteristic.LockTargetState, e);
|
|
539
487
|
this.LockMechanism.Service.updateCharacteristic(this.hap.Characteristic.LockCurrentState, e);
|
|
488
|
+
if (!this.device.lock?.hide_contactsensor && this.ContactSensor?.Service) {
|
|
489
|
+
this.ContactSensor.Service.updateCharacteristic(this.hap.Characteristic.ContactSensorState, e);
|
|
490
|
+
}
|
|
491
|
+
this.Battery.Service.updateCharacteristic(this.hap.Characteristic.BatteryLevel, e);
|
|
492
|
+
this.Battery.Service.updateCharacteristic(this.hap.Characteristic.StatusLowBattery, e);
|
|
540
493
|
}
|
|
541
494
|
}
|
|
542
495
|
//# sourceMappingURL=lock.js.map
|