@switchbot/homebridge-switchbot 4.1.8-beta.4 → 4.1.8-beta.6
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 +17 -6
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +17 -6
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.d.ts.map +1 -1
- package/dist/device/ceilinglight.js +17 -6
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +62 -36
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +17 -6
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +17 -6
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/fan.d.ts.map +1 -1
- package/dist/device/fan.js +17 -6
- package/dist/device/fan.js.map +1 -1
- package/dist/device/hub.d.ts.map +1 -1
- package/dist/device/hub.js +17 -6
- package/dist/device/hub.js.map +1 -1
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +17 -6
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/iosensor.d.ts.map +1 -1
- package/dist/device/iosensor.js +17 -6
- package/dist/device/iosensor.js.map +1 -1
- package/dist/device/lightstrip.d.ts.map +1 -1
- package/dist/device/lightstrip.js +62 -36
- package/dist/device/lightstrip.js.map +1 -1
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +17 -6
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +17 -6
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +17 -6
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/meterpro.d.ts.map +1 -1
- package/dist/device/meterpro.js +17 -6
- package/dist/device/meterpro.js.map +1 -1
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +17 -6
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +17 -6
- package/dist/device/plug.js.map +1 -1
- package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
- package/dist/device/robotvacuumcleaner.js +17 -6
- package/dist/device/robotvacuumcleaner.js.map +1 -1
- package/dist/device/waterdetector.d.ts.map +1 -1
- package/dist/device/waterdetector.js +17 -6
- package/dist/device/waterdetector.js.map +1 -1
- package/docs/assets/dmt/dmt-component-data.js +1 -0
- package/docs/assets/dmt/dmt-components.css +20 -0
- package/docs/assets/dmt/dmt-components.js +67 -0
- package/docs/assets/dmt/dmt-search.cmp +0 -0
- package/docs/assets/dmt/dmt-theme.css +1 -0
- package/docs/assets/main.js +1 -1
- package/docs/functions/default.html +2 -1
- package/docs/index.html +7 -6
- package/docs/modules.html +2 -1
- package/package.json +5 -3
- package/src/device/blindtilt.ts +15 -6
- package/src/device/bot.ts +15 -6
- package/src/device/ceilinglight.ts +15 -6
- package/src/device/colorbulb.ts +57 -36
- package/src/device/contact.ts +15 -6
- package/src/device/curtain.ts +15 -6
- package/src/device/fan.ts +15 -6
- package/src/device/hub.ts +15 -6
- package/src/device/humidifier.ts +15 -6
- package/src/device/iosensor.ts +15 -6
- package/src/device/lightstrip.ts +61 -42
- package/src/device/lock.ts +15 -6
- package/src/device/meter.ts +15 -6
- package/src/device/meterplus.ts +15 -6
- package/src/device/meterpro.ts +15 -6
- package/src/device/motion.ts +15 -6
- package/src/device/plug.ts +15 -6
- package/src/device/robotvacuumcleaner.ts +15 -6
- package/src/device/waterdetector.ts +15 -6
- package/typedoc.json +4 -0
- package/docs/assets/navigation.js +0 -1
- package/docs/assets/search.js +0 -1
package/src/device/meterpro.ts
CHANGED
|
@@ -394,10 +394,15 @@ export class MeterPro extends deviceBase {
|
|
|
394
394
|
this.debugLog(`bleMac: ${this.device.bleMac}`)
|
|
395
395
|
this.platform.bleEventHandler[this.device.bleMac] = async (context: meterProServiceData) => {
|
|
396
396
|
try {
|
|
397
|
-
this.debugLog(`received BLE: ${JSON.stringify(context)}`)
|
|
398
397
|
this.serviceData = context
|
|
399
|
-
|
|
400
|
-
|
|
398
|
+
if (context !== undefined || context !== null) {
|
|
399
|
+
this.debugLog(`received BLE: ${JSON.stringify(context)}`)
|
|
400
|
+
await this.BLEparseStatus()
|
|
401
|
+
await this.updateHomeKitCharacteristics()
|
|
402
|
+
} else {
|
|
403
|
+
this.errorLog(`context is either undefined or null, context: ${JSON.stringify(context)}`)
|
|
404
|
+
await this.BLERefreshConnection(context)
|
|
405
|
+
}
|
|
401
406
|
} catch (e: any) {
|
|
402
407
|
this.errorLog(`failed to handle BLE. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`)
|
|
403
408
|
}
|
|
@@ -435,10 +440,14 @@ export class MeterPro extends deviceBase {
|
|
|
435
440
|
this.debugLog('is listening webhook.')
|
|
436
441
|
this.platform.webhookEventHandler[this.device.deviceId] = async (context: meterProWebhookContext) => {
|
|
437
442
|
try {
|
|
438
|
-
this.debugLog(`received Webhook: ${JSON.stringify(context)}`)
|
|
439
443
|
this.webhookContext = context
|
|
440
|
-
|
|
441
|
-
|
|
444
|
+
if (context !== undefined || context !== null) {
|
|
445
|
+
this.debugLog(`received Webhook: ${JSON.stringify(context)}`)
|
|
446
|
+
await this.parseStatusWebhook()
|
|
447
|
+
await this.updateHomeKitCharacteristics()
|
|
448
|
+
} else {
|
|
449
|
+
this.errorLog(`context is either undefined or null, context: ${JSON.stringify(context)}`)
|
|
450
|
+
}
|
|
442
451
|
} catch (e: any) {
|
|
443
452
|
this.errorLog(`failed to handle webhook. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`)
|
|
444
453
|
}
|
package/src/device/motion.ts
CHANGED
|
@@ -289,10 +289,15 @@ export class Motion extends deviceBase {
|
|
|
289
289
|
this.debugLog(`bleMac: ${this.device.bleMac}`)
|
|
290
290
|
this.platform.bleEventHandler[this.device.bleMac] = async (context: motionSensorServiceData) => {
|
|
291
291
|
try {
|
|
292
|
-
this.debugLog(`received BLE: ${JSON.stringify(context)}`)
|
|
293
292
|
this.serviceData = context
|
|
294
|
-
|
|
295
|
-
|
|
293
|
+
if (context !== undefined || context !== null) {
|
|
294
|
+
this.debugLog(`received BLE: ${JSON.stringify(context)}`)
|
|
295
|
+
await this.BLEparseStatus()
|
|
296
|
+
await this.updateHomeKitCharacteristics()
|
|
297
|
+
} else {
|
|
298
|
+
this.errorLog(`context is either undefined or null, context: ${JSON.stringify(context)}`)
|
|
299
|
+
await this.BLERefreshConnection(context)
|
|
300
|
+
}
|
|
296
301
|
} catch (e: any) {
|
|
297
302
|
this.errorLog(`failed to handle BLE. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`)
|
|
298
303
|
}
|
|
@@ -330,10 +335,14 @@ export class Motion extends deviceBase {
|
|
|
330
335
|
this.debugLog('is listening webhook.')
|
|
331
336
|
this.platform.webhookEventHandler[this.device.deviceId] = async (context: motionSensorWebhookContext) => {
|
|
332
337
|
try {
|
|
333
|
-
this.debugLog(`received Webhook: ${JSON.stringify(context)}`)
|
|
334
338
|
this.webhookContext = context
|
|
335
|
-
|
|
336
|
-
|
|
339
|
+
if (context !== undefined || context !== null) {
|
|
340
|
+
this.debugLog(`received Webhook: ${JSON.stringify(context)}`)
|
|
341
|
+
await this.parseStatusWebhook()
|
|
342
|
+
await this.updateHomeKitCharacteristics()
|
|
343
|
+
} else {
|
|
344
|
+
this.errorLog(`context is either undefined or null, context: ${JSON.stringify(context)}`)
|
|
345
|
+
}
|
|
337
346
|
} catch (e: any) {
|
|
338
347
|
this.errorLog(`failed to handle webhook. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`)
|
|
339
348
|
}
|
package/src/device/plug.ts
CHANGED
|
@@ -214,10 +214,15 @@ export class Plug extends deviceBase {
|
|
|
214
214
|
this.debugLog(`bleMac: ${this.device.bleMac}`)
|
|
215
215
|
this.platform.bleEventHandler[this.device.bleMac] = async (context: plugMiniUSServiceData | plugMiniJPServiceData) => {
|
|
216
216
|
try {
|
|
217
|
-
this.debugLog(`received BLE: ${JSON.stringify(context)}`)
|
|
218
217
|
this.serviceData = context
|
|
219
|
-
|
|
220
|
-
|
|
218
|
+
if (context !== undefined || context !== null) {
|
|
219
|
+
this.debugLog(`received BLE: ${JSON.stringify(context)}`)
|
|
220
|
+
await this.BLEparseStatus()
|
|
221
|
+
await this.updateHomeKitCharacteristics()
|
|
222
|
+
} else {
|
|
223
|
+
this.errorLog(`context is either undefined or null, context: ${JSON.stringify(context)}`)
|
|
224
|
+
await this.BLERefreshConnection(context)
|
|
225
|
+
}
|
|
221
226
|
} catch (e: any) {
|
|
222
227
|
this.errorLog(`failed to handle BLE. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`)
|
|
223
228
|
}
|
|
@@ -255,10 +260,14 @@ export class Plug extends deviceBase {
|
|
|
255
260
|
this.debugLog('is listening webhook.')
|
|
256
261
|
this.platform.webhookEventHandler[this.device.deviceId] = async (context: plugWebhookContext | plugMiniUSWebhookContext | plugMiniJPWebhookContext) => {
|
|
257
262
|
try {
|
|
258
|
-
this.debugLog(`received Webhook: ${JSON.stringify(context)}`)
|
|
259
263
|
this.webhookContext = context
|
|
260
|
-
|
|
261
|
-
|
|
264
|
+
if (context !== undefined || context !== null) {
|
|
265
|
+
this.debugLog(`received Webhook: ${JSON.stringify(context)}`)
|
|
266
|
+
await this.parseStatusWebhook()
|
|
267
|
+
await this.updateHomeKitCharacteristics()
|
|
268
|
+
} else {
|
|
269
|
+
this.errorLog(`context is either undefined or null, context: ${JSON.stringify(context)}`)
|
|
270
|
+
}
|
|
262
271
|
} catch (e: any) {
|
|
263
272
|
this.errorLog(`failed to handle webhook. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`)
|
|
264
273
|
}
|
|
@@ -302,10 +302,15 @@ export class RobotVacuumCleaner extends deviceBase {
|
|
|
302
302
|
this.debugLog(`bleMac: ${this.device.bleMac}`)
|
|
303
303
|
this.platform.bleEventHandler[this.device.bleMac] = async (context: robotVacuumCleanerServiceData) => {
|
|
304
304
|
try {
|
|
305
|
-
this.debugLog(`received BLE: ${JSON.stringify(context)}`)
|
|
306
305
|
this.serviceData = context
|
|
307
|
-
|
|
308
|
-
|
|
306
|
+
if (context !== undefined || context !== null) {
|
|
307
|
+
this.debugLog(`received BLE: ${JSON.stringify(context)}`)
|
|
308
|
+
await this.BLEparseStatus()
|
|
309
|
+
await this.updateHomeKitCharacteristics()
|
|
310
|
+
} else {
|
|
311
|
+
this.errorLog(`context is either undefined or null, context: ${JSON.stringify(context)}`)
|
|
312
|
+
await this.BLERefreshConnection(context)
|
|
313
|
+
}
|
|
309
314
|
} catch (e: any) {
|
|
310
315
|
this.errorLog(`failed to handle BLE. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`)
|
|
311
316
|
}
|
|
@@ -343,10 +348,14 @@ export class RobotVacuumCleaner extends deviceBase {
|
|
|
343
348
|
this.debugLog('is listening webhook.')
|
|
344
349
|
this.platform.webhookEventHandler[this.device.deviceId] = async (context: robotVacuumCleanerS1WebhookContext | robotVacuumCleanerS1PlusWebhookContext | floorCleaningRobotS10WebhookContext) => {
|
|
345
350
|
try {
|
|
346
|
-
this.debugLog(`received Webhook: ${JSON.stringify(context)}`)
|
|
347
351
|
this.webhookContext = context
|
|
348
|
-
|
|
349
|
-
|
|
352
|
+
if (context !== undefined || context !== null) {
|
|
353
|
+
this.debugLog(`received Webhook: ${JSON.stringify(context)}`)
|
|
354
|
+
await this.parseStatusWebhook()
|
|
355
|
+
await this.updateHomeKitCharacteristics()
|
|
356
|
+
} else {
|
|
357
|
+
this.errorLog(`context is either undefined or null, context: ${JSON.stringify(context)}`)
|
|
358
|
+
}
|
|
350
359
|
} catch (e: any) {
|
|
351
360
|
this.errorLog(`failed to handle webhook. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`)
|
|
352
361
|
}
|
|
@@ -296,10 +296,15 @@ export class WaterDetector extends deviceBase {
|
|
|
296
296
|
this.debugLog(`bleMac: ${this.device.bleMac}`)
|
|
297
297
|
this.platform.bleEventHandler[this.device.bleMac] = async (context: waterLeakDetectorServiceData) => {
|
|
298
298
|
try {
|
|
299
|
-
this.debugLog(`received BLE: ${JSON.stringify(context)}`)
|
|
300
299
|
this.serviceData = context
|
|
301
|
-
|
|
302
|
-
|
|
300
|
+
if (context !== undefined || context !== null) {
|
|
301
|
+
this.debugLog(`received BLE: ${JSON.stringify(context)}`)
|
|
302
|
+
await this.BLEparseStatus()
|
|
303
|
+
await this.updateHomeKitCharacteristics()
|
|
304
|
+
} else {
|
|
305
|
+
this.errorLog(`context is either undefined or null, context: ${JSON.stringify(context)}`)
|
|
306
|
+
await this.BLERefreshConnection(context)
|
|
307
|
+
}
|
|
303
308
|
} catch (e: any) {
|
|
304
309
|
this.errorLog(`failed to handle BLE. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`)
|
|
305
310
|
}
|
|
@@ -337,10 +342,14 @@ export class WaterDetector extends deviceBase {
|
|
|
337
342
|
this.debugLog('is listening webhook.')
|
|
338
343
|
this.platform.webhookEventHandler[this.device.deviceId] = async (context: waterLeakDetectorWebhookContext) => {
|
|
339
344
|
try {
|
|
340
|
-
this.debugLog(`received Webhook: ${JSON.stringify(context)}`)
|
|
341
345
|
this.webhookContext = context
|
|
342
|
-
|
|
343
|
-
|
|
346
|
+
if (context !== undefined || context !== null) {
|
|
347
|
+
this.debugLog(`received Webhook: ${JSON.stringify(context)}`)
|
|
348
|
+
await this.parseStatusWebhook()
|
|
349
|
+
await this.updateHomeKitCharacteristics()
|
|
350
|
+
} else {
|
|
351
|
+
this.errorLog(`context is either undefined or null, context: ${JSON.stringify(context)}`)
|
|
352
|
+
}
|
|
344
353
|
} catch (e: any) {
|
|
345
354
|
this.errorLog(`failed to handle webhook. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`)
|
|
346
355
|
}
|
package/typedoc.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
window.navigationData = "eJyLrlYqSa0oUbJSSklNSyzNKVHSUSpILMlQslJKK81LLsnMzyvWh0rpZZTk5ijpKGVn5qUoWZmZ1MYCAKPQFUI="
|
package/docs/assets/search.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
window.searchData = "eJxNj11qwzAQhO8yz8IxaWjSvUEukBchipHWRFSWgiQnBaG7F/mH9G2Znd35piCGVwLJgh/rDejzJOCHiUEwPA6zyxCYowNhnL3ONvh02DbdPU8OAtoNKXECAVUJWG/4F1Tw5Jhs8CAcu4/uCwKjZWda3JohoMM0sW8ZJuh5GdVmu7HOITbz6j70ELIXx+5yPisl5H676Iuwv9iUBeXJMbO5rkhSvksVfG+g/d64oAeVWt9YVOo/srZrXx/2wc56BklV6x95cGof";
|