@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.
Files changed (89) hide show
  1. package/dist/device/blindtilt.d.ts.map +1 -1
  2. package/dist/device/blindtilt.js +17 -6
  3. package/dist/device/blindtilt.js.map +1 -1
  4. package/dist/device/bot.d.ts.map +1 -1
  5. package/dist/device/bot.js +17 -6
  6. package/dist/device/bot.js.map +1 -1
  7. package/dist/device/ceilinglight.d.ts.map +1 -1
  8. package/dist/device/ceilinglight.js +17 -6
  9. package/dist/device/ceilinglight.js.map +1 -1
  10. package/dist/device/colorbulb.d.ts.map +1 -1
  11. package/dist/device/colorbulb.js +62 -36
  12. package/dist/device/colorbulb.js.map +1 -1
  13. package/dist/device/contact.d.ts.map +1 -1
  14. package/dist/device/contact.js +17 -6
  15. package/dist/device/contact.js.map +1 -1
  16. package/dist/device/curtain.d.ts.map +1 -1
  17. package/dist/device/curtain.js +17 -6
  18. package/dist/device/curtain.js.map +1 -1
  19. package/dist/device/fan.d.ts.map +1 -1
  20. package/dist/device/fan.js +17 -6
  21. package/dist/device/fan.js.map +1 -1
  22. package/dist/device/hub.d.ts.map +1 -1
  23. package/dist/device/hub.js +17 -6
  24. package/dist/device/hub.js.map +1 -1
  25. package/dist/device/humidifier.d.ts.map +1 -1
  26. package/dist/device/humidifier.js +17 -6
  27. package/dist/device/humidifier.js.map +1 -1
  28. package/dist/device/iosensor.d.ts.map +1 -1
  29. package/dist/device/iosensor.js +17 -6
  30. package/dist/device/iosensor.js.map +1 -1
  31. package/dist/device/lightstrip.d.ts.map +1 -1
  32. package/dist/device/lightstrip.js +62 -36
  33. package/dist/device/lightstrip.js.map +1 -1
  34. package/dist/device/lock.d.ts.map +1 -1
  35. package/dist/device/lock.js +17 -6
  36. package/dist/device/lock.js.map +1 -1
  37. package/dist/device/meter.d.ts.map +1 -1
  38. package/dist/device/meter.js +17 -6
  39. package/dist/device/meter.js.map +1 -1
  40. package/dist/device/meterplus.d.ts.map +1 -1
  41. package/dist/device/meterplus.js +17 -6
  42. package/dist/device/meterplus.js.map +1 -1
  43. package/dist/device/meterpro.d.ts.map +1 -1
  44. package/dist/device/meterpro.js +17 -6
  45. package/dist/device/meterpro.js.map +1 -1
  46. package/dist/device/motion.d.ts.map +1 -1
  47. package/dist/device/motion.js +17 -6
  48. package/dist/device/motion.js.map +1 -1
  49. package/dist/device/plug.d.ts.map +1 -1
  50. package/dist/device/plug.js +17 -6
  51. package/dist/device/plug.js.map +1 -1
  52. package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
  53. package/dist/device/robotvacuumcleaner.js +17 -6
  54. package/dist/device/robotvacuumcleaner.js.map +1 -1
  55. package/dist/device/waterdetector.d.ts.map +1 -1
  56. package/dist/device/waterdetector.js +17 -6
  57. package/dist/device/waterdetector.js.map +1 -1
  58. package/docs/assets/dmt/dmt-component-data.js +1 -0
  59. package/docs/assets/dmt/dmt-components.css +20 -0
  60. package/docs/assets/dmt/dmt-components.js +67 -0
  61. package/docs/assets/dmt/dmt-search.cmp +0 -0
  62. package/docs/assets/dmt/dmt-theme.css +1 -0
  63. package/docs/assets/main.js +1 -1
  64. package/docs/functions/default.html +2 -1
  65. package/docs/index.html +7 -6
  66. package/docs/modules.html +2 -1
  67. package/package.json +5 -3
  68. package/src/device/blindtilt.ts +15 -6
  69. package/src/device/bot.ts +15 -6
  70. package/src/device/ceilinglight.ts +15 -6
  71. package/src/device/colorbulb.ts +57 -36
  72. package/src/device/contact.ts +15 -6
  73. package/src/device/curtain.ts +15 -6
  74. package/src/device/fan.ts +15 -6
  75. package/src/device/hub.ts +15 -6
  76. package/src/device/humidifier.ts +15 -6
  77. package/src/device/iosensor.ts +15 -6
  78. package/src/device/lightstrip.ts +61 -42
  79. package/src/device/lock.ts +15 -6
  80. package/src/device/meter.ts +15 -6
  81. package/src/device/meterplus.ts +15 -6
  82. package/src/device/meterpro.ts +15 -6
  83. package/src/device/motion.ts +15 -6
  84. package/src/device/plug.ts +15 -6
  85. package/src/device/robotvacuumcleaner.ts +15 -6
  86. package/src/device/waterdetector.ts +15 -6
  87. package/typedoc.json +4 -0
  88. package/docs/assets/navigation.js +0 -1
  89. package/docs/assets/search.js +0 -1
@@ -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
- await this.BLEparseStatus()
400
- await this.updateHomeKitCharacteristics()
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
- await this.parseStatusWebhook()
441
- await this.updateHomeKitCharacteristics()
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
  }
@@ -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
- await this.BLEparseStatus()
295
- await this.updateHomeKitCharacteristics()
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
- await this.parseStatusWebhook()
336
- await this.updateHomeKitCharacteristics()
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
  }
@@ -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
- await this.BLEparseStatus()
220
- await this.updateHomeKitCharacteristics()
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
- await this.parseStatusWebhook()
261
- await this.updateHomeKitCharacteristics()
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
- await this.BLEparseStatus()
308
- await this.updateHomeKitCharacteristics()
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
- await this.parseStatusWebhook()
349
- await this.updateHomeKitCharacteristics()
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
- await this.BLEparseStatus()
302
- await this.updateHomeKitCharacteristics()
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
- await this.parseStatusWebhook()
343
- await this.updateHomeKitCharacteristics()
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,4 +1,8 @@
1
1
  {
2
+ "plugin": [
3
+ "@typhonjs-typedoc/typedoc-theme-dmt"
4
+ ],
5
+ "theme": "default-modern",
2
6
  "out": "docs",
3
7
  "exclude": ["src/**/*.spec.ts"],
4
8
  "entryPoints": [
@@ -1 +0,0 @@
1
- window.navigationData = "eJyLrlYqSa0oUbJSSklNSyzNKVHSUSpILMlQslJKK81LLsnMzyvWh0rpZZTk5ijpKGVn5qUoWZmZ1MYCAKPQFUI="
@@ -1 +0,0 @@
1
- window.searchData = "eJxNj11qwzAQhO8yz8IxaWjSvUEukBchipHWRFSWgiQnBaG7F/mH9G2Znd35piCGVwLJgh/rDejzJOCHiUEwPA6zyxCYowNhnL3ONvh02DbdPU8OAtoNKXECAVUJWG/4F1Tw5Jhs8CAcu4/uCwKjZWda3JohoMM0sW8ZJuh5GdVmu7HOITbz6j70ELIXx+5yPisl5H676Iuwv9iUBeXJMbO5rkhSvksVfG+g/d64oAeVWt9YVOo/srZrXx/2wc56BklV6x95cGof";