@switchbot/homebridge-switchbot 3.5.0-beta.0 → 3.5.0-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.
Files changed (142) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/config.schema.json +27 -6
  3. package/dist/device/blindtilt.d.ts +1 -0
  4. package/dist/device/blindtilt.d.ts.map +1 -1
  5. package/dist/device/blindtilt.js +9 -0
  6. package/dist/device/blindtilt.js.map +1 -1
  7. package/dist/device/bot.d.ts +1 -0
  8. package/dist/device/bot.d.ts.map +1 -1
  9. package/dist/device/bot.js +9 -0
  10. package/dist/device/bot.js.map +1 -1
  11. package/dist/device/ceilinglight.d.ts +1 -0
  12. package/dist/device/ceilinglight.d.ts.map +1 -1
  13. package/dist/device/ceilinglight.js +13 -0
  14. package/dist/device/ceilinglight.js.map +1 -1
  15. package/dist/device/colorbulb.d.ts +1 -0
  16. package/dist/device/colorbulb.d.ts.map +1 -1
  17. package/dist/device/colorbulb.js +15 -0
  18. package/dist/device/colorbulb.js.map +1 -1
  19. package/dist/device/contact.d.ts +1 -0
  20. package/dist/device/contact.d.ts.map +1 -1
  21. package/dist/device/contact.js +5 -0
  22. package/dist/device/contact.js.map +1 -1
  23. package/dist/device/curtain.d.ts +1 -0
  24. package/dist/device/curtain.d.ts.map +1 -1
  25. package/dist/device/curtain.js +9 -0
  26. package/dist/device/curtain.js.map +1 -1
  27. package/dist/device/hub.d.ts +1 -0
  28. package/dist/device/hub.d.ts.map +1 -1
  29. package/dist/device/hub.js +5 -0
  30. package/dist/device/hub.js.map +1 -1
  31. package/dist/device/humidifier.d.ts +1 -0
  32. package/dist/device/humidifier.d.ts.map +1 -1
  33. package/dist/device/humidifier.js +14 -1
  34. package/dist/device/humidifier.js.map +1 -1
  35. package/dist/device/iosensor.d.ts +1 -0
  36. package/dist/device/iosensor.d.ts.map +1 -1
  37. package/dist/device/iosensor.js +5 -0
  38. package/dist/device/iosensor.js.map +1 -1
  39. package/dist/device/lightstrip.d.ts +1 -0
  40. package/dist/device/lightstrip.d.ts.map +1 -1
  41. package/dist/device/lightstrip.js +13 -0
  42. package/dist/device/lightstrip.js.map +1 -1
  43. package/dist/device/lock.d.ts +1 -0
  44. package/dist/device/lock.d.ts.map +1 -1
  45. package/dist/device/lock.js +9 -0
  46. package/dist/device/lock.js.map +1 -1
  47. package/dist/device/meter.d.ts +1 -0
  48. package/dist/device/meter.d.ts.map +1 -1
  49. package/dist/device/meter.js +5 -0
  50. package/dist/device/meter.js.map +1 -1
  51. package/dist/device/meterplus.d.ts +1 -0
  52. package/dist/device/meterplus.d.ts.map +1 -1
  53. package/dist/device/meterplus.js +5 -0
  54. package/dist/device/meterplus.js.map +1 -1
  55. package/dist/device/motion.d.ts +1 -0
  56. package/dist/device/motion.d.ts.map +1 -1
  57. package/dist/device/motion.js +5 -0
  58. package/dist/device/motion.js.map +1 -1
  59. package/dist/device/plug.d.ts +1 -0
  60. package/dist/device/plug.d.ts.map +1 -1
  61. package/dist/device/plug.js +9 -0
  62. package/dist/device/plug.js.map +1 -1
  63. package/dist/device/robotvacuumcleaner.d.ts +1 -0
  64. package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
  65. package/dist/device/robotvacuumcleaner.js +16 -4
  66. package/dist/device/robotvacuumcleaner.js.map +1 -1
  67. package/dist/device/waterdetector.d.ts +85 -0
  68. package/dist/device/waterdetector.d.ts.map +1 -0
  69. package/dist/device/waterdetector.js +656 -0
  70. package/dist/device/waterdetector.js.map +1 -0
  71. package/dist/irdevice/airconditioner.d.ts +1 -0
  72. package/dist/irdevice/airconditioner.d.ts.map +1 -1
  73. package/dist/irdevice/airconditioner.js +6 -0
  74. package/dist/irdevice/airconditioner.js.map +1 -1
  75. package/dist/irdevice/airpurifier.d.ts +1 -0
  76. package/dist/irdevice/airpurifier.d.ts.map +1 -1
  77. package/dist/irdevice/airpurifier.js +6 -0
  78. package/dist/irdevice/airpurifier.js.map +1 -1
  79. package/dist/irdevice/camera.d.ts +1 -0
  80. package/dist/irdevice/camera.d.ts.map +1 -1
  81. package/dist/irdevice/camera.js +6 -0
  82. package/dist/irdevice/camera.js.map +1 -1
  83. package/dist/irdevice/fan.d.ts +1 -0
  84. package/dist/irdevice/fan.d.ts.map +1 -1
  85. package/dist/irdevice/fan.js +6 -0
  86. package/dist/irdevice/fan.js.map +1 -1
  87. package/dist/irdevice/light.d.ts +1 -0
  88. package/dist/irdevice/light.d.ts.map +1 -1
  89. package/dist/irdevice/light.js +6 -0
  90. package/dist/irdevice/light.js.map +1 -1
  91. package/dist/irdevice/other.d.ts +1 -0
  92. package/dist/irdevice/other.d.ts.map +1 -1
  93. package/dist/irdevice/other.js +6 -0
  94. package/dist/irdevice/other.js.map +1 -1
  95. package/dist/irdevice/tv.d.ts +1 -0
  96. package/dist/irdevice/tv.d.ts.map +1 -1
  97. package/dist/irdevice/tv.js +6 -0
  98. package/dist/irdevice/tv.js.map +1 -1
  99. package/dist/irdevice/vacuumcleaner.d.ts +1 -0
  100. package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
  101. package/dist/irdevice/vacuumcleaner.js +6 -0
  102. package/dist/irdevice/vacuumcleaner.js.map +1 -1
  103. package/dist/irdevice/waterheater.d.ts +1 -0
  104. package/dist/irdevice/waterheater.d.ts.map +1 -1
  105. package/dist/irdevice/waterheater.js +6 -0
  106. package/dist/irdevice/waterheater.js.map +1 -1
  107. package/dist/platform.d.ts +2 -0
  108. package/dist/platform.d.ts.map +1 -1
  109. package/dist/platform.js +68 -0
  110. package/dist/platform.js.map +1 -1
  111. package/dist/settings.d.ts +5 -0
  112. package/dist/settings.d.ts.map +1 -1
  113. package/dist/settings.js.map +1 -1
  114. package/package.json +14 -14
  115. package/src/device/blindtilt.ts +19 -9
  116. package/src/device/bot.ts +10 -0
  117. package/src/device/ceilinglight.ts +14 -0
  118. package/src/device/colorbulb.ts +16 -0
  119. package/src/device/contact.ts +6 -0
  120. package/src/device/curtain.ts +10 -0
  121. package/src/device/hub.ts +6 -0
  122. package/src/device/humidifier.ts +15 -1
  123. package/src/device/iosensor.ts +6 -0
  124. package/src/device/lightstrip.ts +14 -0
  125. package/src/device/lock.ts +10 -0
  126. package/src/device/meter.ts +6 -0
  127. package/src/device/meterplus.ts +6 -0
  128. package/src/device/motion.ts +6 -0
  129. package/src/device/plug.ts +10 -0
  130. package/src/device/robotvacuumcleaner.ts +17 -4
  131. package/src/device/waterdetector.ts +695 -0
  132. package/src/irdevice/airconditioner.ts +7 -0
  133. package/src/irdevice/airpurifier.ts +7 -0
  134. package/src/irdevice/camera.ts +7 -0
  135. package/src/irdevice/fan.ts +7 -0
  136. package/src/irdevice/light.ts +7 -0
  137. package/src/irdevice/other.ts +7 -0
  138. package/src/irdevice/tv.ts +7 -0
  139. package/src/irdevice/vacuumcleaner.ts +7 -0
  140. package/src/irdevice/waterheater.ts +7 -0
  141. package/src/platform.ts +72 -0
  142. package/src/settings.ts +6 -0
@@ -275,6 +275,7 @@ export class AirConditioner {
275
275
  if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
276
276
  this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
277
277
  + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
278
+ this.successLog(`${this.device.remoteType}: ${this.accessory.displayName} request to SwitchBot API, body: ${bodyChange} sent successfully`);
278
279
  this.updateHomeKitCharacteristics();
279
280
  } else {
280
281
  this.statusCode(statusCode);
@@ -799,6 +800,12 @@ export class AirConditioner {
799
800
  /**
800
801
  * Logging for Device
801
802
  */
803
+ successLog(...log: any[]): void {
804
+ if (this.enablingDeviceLogging()) {
805
+ this.platform.log.success(String(...log));
806
+ }
807
+ }
808
+
802
809
  infoLog(...log: any[]): void {
803
810
  if (this.enablingDeviceLogging()) {
804
811
  this.platform.log.info(String(...log));
@@ -227,6 +227,7 @@ export class AirPurifier {
227
227
  if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
228
228
  this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
229
229
  + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
230
+ this.successLog(`${this.device.remoteType}: ${this.accessory.displayName} request to SwitchBot API, body: ${bodyChange} sent successfully`);
230
231
  this.updateHomeKitCharacteristics();
231
232
  } else {
232
233
  this.statusCode(statusCode);
@@ -478,6 +479,12 @@ export class AirPurifier {
478
479
  /**
479
480
  * Logging for Device
480
481
  */
482
+ successLog(...log: any[]): void {
483
+ if (this.enablingDeviceLogging()) {
484
+ this.platform.log.success(String(...log));
485
+ }
486
+ }
487
+
481
488
  infoLog(...log: any[]): void {
482
489
  if (this.enablingDeviceLogging()) {
483
490
  this.platform.log.info(String(...log));
@@ -132,6 +132,7 @@ export class Camera {
132
132
  if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
133
133
  this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
134
134
  + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
135
+ this.successLog(`${this.device.remoteType}: ${this.accessory.displayName} request to SwitchBot API, body: ${bodyChange} sent successfully`);
135
136
  this.updateHomeKitCharacteristics();
136
137
  } else {
137
138
  this.statusCode(statusCode);
@@ -354,6 +355,12 @@ export class Camera {
354
355
  /**
355
356
  * Logging for Device
356
357
  */
358
+ successLog(...log: any[]): void {
359
+ if (this.enablingDeviceLogging()) {
360
+ this.platform.log.success(String(...log));
361
+ }
362
+ }
363
+
357
364
  infoLog(...log: any[]): void {
358
365
  if (this.enablingDeviceLogging()) {
359
366
  this.platform.log.info(String(...log));
@@ -249,6 +249,7 @@ export class Fan {
249
249
  if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
250
250
  this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
251
251
  + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
252
+ this.successLog(`${this.device.remoteType}: ${this.accessory.displayName} request to SwitchBot API, body: ${bodyChange} sent successfully`);
252
253
  this.updateHomeKitCharacteristics();
253
254
  } else {
254
255
  this.statusCode(statusCode);
@@ -486,6 +487,12 @@ export class Fan {
486
487
  /**
487
488
  * Logging for Device
488
489
  */
490
+ successLog(...log: any[]): void {
491
+ if (this.enablingDeviceLogging()) {
492
+ this.platform.log.success(String(...log));
493
+ }
494
+ }
495
+
489
496
  infoLog(...log: any[]): void {
490
497
  if (this.enablingDeviceLogging()) {
491
498
  this.platform.log.info(String(...log));
@@ -247,6 +247,7 @@ export class Light {
247
247
  if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
248
248
  this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
249
249
  + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
250
+ this.successLog(`${this.device.remoteType}: ${this.accessory.displayName} request to SwitchBot API, body: ${bodyChange} sent successfully`);
250
251
  this.accessory.context.On = this.On;
251
252
  this.updateHomeKitCharacteristics();
252
253
  } else {
@@ -502,6 +503,12 @@ export class Light {
502
503
  /**
503
504
  * Logging for Device
504
505
  */
506
+ successLog(...log: any[]): void {
507
+ if (this.enablingDeviceLogging()) {
508
+ this.platform.log.success(String(...log));
509
+ }
510
+ }
511
+
505
512
  infoLog(...log: any[]): void {
506
513
  if (this.enablingDeviceLogging()) {
507
514
  this.platform.log.info(String(...log));
@@ -439,6 +439,7 @@ export class Others {
439
439
  if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
440
440
  this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
441
441
  + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
442
+ this.successLog(`${this.device.remoteType}: ${this.accessory.displayName} request to SwitchBot API, body: ${bodyChange} sent successfully`);
442
443
  this.updateHomeKitCharacteristics();
443
444
  } else {
444
445
  this.statusCode(statusCode);
@@ -975,6 +976,12 @@ export class Others {
975
976
  /**
976
977
  * Logging for Device
977
978
  */
979
+ successLog(...log: any[]): void {
980
+ if (this.enablingDeviceLogging()) {
981
+ this.platform.log.success(String(...log));
982
+ }
983
+ }
984
+
978
985
  infoLog(...log: any[]): void {
979
986
  if (this.enablingDeviceLogging()) {
980
987
  this.platform.log.info(String(...log));
@@ -381,6 +381,7 @@ export class TV {
381
381
  if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
382
382
  this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
383
383
  + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
384
+ this.successLog(`${this.device.remoteType}: ${this.accessory.displayName} request to SwitchBot API, body: ${bodyChange} sent successfully`);
384
385
  this.updateHomeKitCharacteristics();
385
386
  } else {
386
387
  this.statusCode(statusCode);
@@ -628,6 +629,12 @@ export class TV {
628
629
  /**
629
630
  * Logging for Device
630
631
  */
632
+ successLog(...log: any[]): void {
633
+ if (this.enablingDeviceLogging()) {
634
+ this.platform.log.success(String(...log));
635
+ }
636
+ }
637
+
631
638
  infoLog(...log: any[]): void {
632
639
  if (this.enablingDeviceLogging()) {
633
640
  this.platform.log.info(String(...log));
@@ -128,6 +128,7 @@ export class VacuumCleaner {
128
128
  if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
129
129
  this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
130
130
  + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
131
+ this.successLog(`${this.device.remoteType}: ${this.accessory.displayName} request to SwitchBot API, body: ${bodyChange} sent successfully`);
131
132
  this.updateHomeKitCharacteristics();
132
133
  } else {
133
134
  this.statusCode(statusCode);
@@ -350,6 +351,12 @@ export class VacuumCleaner {
350
351
  /**
351
352
  * Logging for Device
352
353
  */
354
+ successLog(...log: any[]): void {
355
+ if (this.enablingDeviceLogging()) {
356
+ this.platform.log.success(String(...log));
357
+ }
358
+ }
359
+
353
360
  infoLog(...log: any[]): void {
354
361
  if (this.enablingDeviceLogging()) {
355
362
  this.platform.log.info(String(...log));
@@ -137,6 +137,7 @@ export class WaterHeater {
137
137
  if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
138
138
  this.debugErrorLog(`${this.device.remoteType}: ${this.accessory.displayName} `
139
139
  + `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
140
+ this.successLog(`${this.device.remoteType}: ${this.accessory.displayName} request to SwitchBot API, body: ${bodyChange} sent successfully`);
140
141
  this.updateHomeKitCharacteristics();
141
142
  } else {
142
143
  this.statusCode(statusCode);
@@ -359,6 +360,12 @@ export class WaterHeater {
359
360
  /**
360
361
  * Logging for Device
361
362
  */
363
+ successLog(...log: any[]): void {
364
+ if (this.enablingDeviceLogging()) {
365
+ this.platform.log.success(String(...log));
366
+ }
367
+ }
368
+
362
369
  infoLog(...log: any[]): void {
363
370
  if (this.enablingDeviceLogging()) {
364
371
  this.platform.log.info(String(...log));
package/src/platform.ts CHANGED
@@ -13,6 +13,7 @@ import { Hub } from './device/hub.js';
13
13
  import { Contact } from './device/contact.js';
14
14
  import { Curtain } from './device/curtain.js';
15
15
  import { IOSensor } from './device/iosensor.js';
16
+ import { WaterDetector } from './device/waterdetector.js';
16
17
  import { MeterPlus } from './device/meterplus.js';
17
18
  import { ColorBulb } from './device/colorbulb.js';
18
19
  import { CeilingLight } from './device/ceilinglight.js';
@@ -654,6 +655,10 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
654
655
  this.debugLog(`Discovered ${device.deviceType}: ${device.deviceId}`);
655
656
  this.createIOSensor(device);
656
657
  break;
658
+ case 'Water Detector':
659
+ this.debugLog(`Discovered ${device.deviceType}: ${device.deviceId}`);
660
+ this.createWaterDetector(device);
661
+ break;
657
662
  case 'Motion Sensor':
658
663
  this.debugLog(`Discovered ${device.deviceType}: ${device.deviceId}`);
659
664
  this.createMotion(device);
@@ -686,6 +691,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
686
691
  this.debugLog(`Discovered ${device.deviceType}: ${device.deviceId}`);
687
692
  this.createColorBulb(device);
688
693
  break;
694
+ case 'K10+':
689
695
  case 'WoSweeper':
690
696
  case 'WoSweeperMini':
691
697
  case 'Robot Vacuum Cleaner S1':
@@ -1150,6 +1156,66 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1150
1156
  }
1151
1157
  }
1152
1158
 
1159
+ private async createWaterDetector(device: device & devicesConfig) {
1160
+ const uuid = this.api.hap.uuid.generate(`${device.deviceId}-${device.deviceType}`);
1161
+
1162
+ // see if an accessory with the same uuid has already been registered and restored from
1163
+ // the cached devices we stored in the `configureAccessory` method above
1164
+ const existingAccessory = this.accessories.find((accessory) => accessory.UUID === uuid);
1165
+
1166
+ if (existingAccessory) {
1167
+ // the accessory already exists
1168
+ if (await this.registerDevice(device)) {
1169
+ // if you need to update the accessory.context then you should run `api.updatePlatformAccessories`. eg.:
1170
+ existingAccessory.context.model = device.deviceType;
1171
+ existingAccessory.context.deviceID = device.deviceId;
1172
+ existingAccessory.displayName = device.configDeviceName || device.deviceName;
1173
+ if (device.firmware) {
1174
+ existingAccessory.context.FirmwareRevision = device.firmware;
1175
+ }
1176
+ existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
1177
+ this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
1178
+ existingAccessory.context.connectionType = await this.connectionType(device);
1179
+ this.api.updatePlatformAccessories([existingAccessory]);
1180
+ // create the accessory handler for the restored accessory
1181
+ // this is imported from `platformAccessory.ts`
1182
+ new WaterDetector(this, existingAccessory, device);
1183
+ this.debugLog(`${device.deviceType} uuid: ${device.deviceId}-${device.deviceType}, (${existingAccessory.UUID})`);
1184
+ } else {
1185
+ this.unregisterPlatformAccessories(existingAccessory);
1186
+ }
1187
+ } else if (await this.registerDevice(device)) {
1188
+ // the accessory does not yet exist, so we need to create it
1189
+ if (!device.external) {
1190
+ this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
1191
+ }
1192
+
1193
+ // create a new accessory
1194
+ const accessory = new this.api.platformAccessory(device.deviceName, uuid);
1195
+
1196
+ // store a copy of the device object in the `accessory.context`
1197
+ // the `context` property can be used to store any data about the accessory you may need
1198
+ accessory.context.device = device;
1199
+ accessory.context.model = device.deviceType;
1200
+ accessory.context.deviceID = device.deviceId;
1201
+ if (device.firmware) {
1202
+ accessory.context.FirmwareRevision = device.firmware;
1203
+ }
1204
+ accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
1205
+ accessory.context.connectionType = await this.connectionType(device);
1206
+ // create the accessory handler for the newly create accessory
1207
+ // this is imported from `platformAccessory.ts`
1208
+ new WaterDetector(this, accessory, device);
1209
+ this.debugLog(`${device.deviceType} uuid: ${device.deviceId}-${device.deviceType}, (${accessory.UUID})`);
1210
+
1211
+ // publish device externally or link the accessory to your platform
1212
+ this.externalOrPlatform(device, accessory);
1213
+ this.accessories.push(accessory);
1214
+ } else {
1215
+ this.debugLog(`Device not registered: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
1216
+ }
1217
+ }
1218
+
1153
1219
  private async createMotion(device: device & devicesConfig) {
1154
1220
  const uuid = this.api.hap.uuid.generate(`${device.deviceId}-${device.deviceType}`);
1155
1221
 
@@ -2622,6 +2688,12 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
2622
2688
  * If device level logging is turned on, log to log.warn
2623
2689
  * Otherwise send debug logs to log.debug
2624
2690
  */
2691
+ successLog(...log: any[]): void {
2692
+ if (this.enablingPlatformLogging()) {
2693
+ this.log.success(String(...log));
2694
+ }
2695
+ }
2696
+
2625
2697
  infoLog(...log: any[]): void {
2626
2698
  if (this.enablingPlatformLogging()) {
2627
2699
  this.log.info(String(...log));
package/src/settings.ts CHANGED
@@ -72,6 +72,7 @@ export interface devicesConfig extends device {
72
72
  blindTilt?: blindTilt;
73
73
  contact?: contact;
74
74
  motion?: motion;
75
+ waterdetector?: waterdetector;
75
76
  colorbulb?: colorbulb;
76
77
  striplight?: striplight;
77
78
  ceilinglight?: ceilinglight;
@@ -138,6 +139,10 @@ export type motion = {
138
139
  set_maxLux?: number;
139
140
  };
140
141
 
142
+ export type waterdetector = {
143
+ hide_leak?: boolean;
144
+ };
145
+
141
146
  export type colorbulb = {
142
147
  set_minStep?: number;
143
148
  adaptiveLightingShift?: number;
@@ -313,6 +318,7 @@ export type deviceStatus = {
313
318
  shaking?: boolean; //determines if the fan is swinging or not. (Used by the following deviceTypes: Smart Fan)
314
319
  shakeCenter?: string; //the fan's swing direction. (Used by the following deviceTypes: Smart Fan)
315
320
  shakeRange?: string; //the fan's swing range, 0~120°. (Used by the following deviceTypes: Smart Fan)
321
+ status?: number //the leak status. 0 for no leak, 1 for leak. (Used by the following deviceTypes: Water Detector)
316
322
  };
317
323
 
318
324
  export type ad = {