@switchbot/homebridge-switchbot 2.5.2-beta.3 → 2.5.2-beta.5

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 (48) hide show
  1. package/config.schema.json +64 -2
  2. package/dist/device/blindtilt.js +12 -12
  3. package/dist/device/blindtilt.js.map +1 -1
  4. package/dist/device/bot.js +1 -1
  5. package/dist/device/bot.js.map +1 -1
  6. package/dist/device/ceilinglight.js +1 -1
  7. package/dist/device/ceilinglight.js.map +1 -1
  8. package/dist/device/colorbulb.js +1 -1
  9. package/dist/device/colorbulb.js.map +1 -1
  10. package/dist/device/contact.js +1 -1
  11. package/dist/device/contact.js.map +1 -1
  12. package/dist/device/curtain.js +1 -1
  13. package/dist/device/curtain.js.map +1 -1
  14. package/dist/device/humidifier.js +1 -1
  15. package/dist/device/humidifier.js.map +1 -1
  16. package/dist/device/lock.js +1 -1
  17. package/dist/device/lock.js.map +1 -1
  18. package/dist/device/meter.js +1 -1
  19. package/dist/device/meter.js.map +1 -1
  20. package/dist/device/meterplus.js +1 -1
  21. package/dist/device/meterplus.js.map +1 -1
  22. package/dist/device/motion.js +1 -1
  23. package/dist/device/motion.js.map +1 -1
  24. package/dist/device/plug.js +1 -1
  25. package/dist/device/plug.js.map +1 -1
  26. package/dist/device/robotvacuumcleaner.js +1 -1
  27. package/dist/device/robotvacuumcleaner.js.map +1 -1
  28. package/dist/device/striplight.js +7 -7
  29. package/dist/device/striplight.js.map +1 -1
  30. package/dist/settings.d.ts +11 -0
  31. package/dist/settings.d.ts.map +1 -1
  32. package/dist/settings.js.map +1 -1
  33. package/package.json +1 -1
  34. package/src/device/blindtilt.ts +12 -12
  35. package/src/device/bot.ts +1 -1
  36. package/src/device/ceilinglight.ts +1 -1
  37. package/src/device/colorbulb.ts +1 -1
  38. package/src/device/contact.ts +1 -1
  39. package/src/device/curtain.ts +1 -1
  40. package/src/device/humidifier.ts +1 -1
  41. package/src/device/lock.ts +1 -1
  42. package/src/device/meter.ts +1 -1
  43. package/src/device/meterplus.ts +1 -1
  44. package/src/device/motion.ts +1 -1
  45. package/src/device/plug.ts +1 -1
  46. package/src/device/robotvacuumcleaner.ts +1 -1
  47. package/src/device/striplight.ts +7 -7
  48. package/src/settings.ts +12 -0
@@ -302,7 +302,7 @@ export class BlindTilt {
302
302
  ` TargetPosition: ${this.TargetPosition}, PositionState: ${this.PositionState},`,
303
303
  );
304
304
 
305
- if (!this.device.curtain?.hide_lightsensor) {
305
+ if (!this.device.blindTilt?.hide_lightsensor) {
306
306
  this.set_minLux = this.minLux();
307
307
  this.set_maxLux = this.maxLux();
308
308
  this.spaceBetweenLevels = 9;
@@ -423,7 +423,7 @@ export class BlindTilt {
423
423
  ` TargetPosition: ${this.TargetPosition}, PositionState: ${this.PositionState},`,
424
424
  );
425
425
 
426
- if (!this.device.curtain?.hide_lightsensor) {
426
+ if (!this.device.blindTilt?.hide_lightsensor) {
427
427
  this.set_minLux = this.minLux();
428
428
  this.set_maxLux = this.maxLux();
429
429
  // Brightness
@@ -867,7 +867,7 @@ export class BlindTilt {
867
867
  this.windowCoveringService.updateCharacteristic(this.platform.Characteristic.TargetPosition, Number(this.TargetPosition));
868
868
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic TargetPosition: ${this.TargetPosition}`);
869
869
  }
870
- if (!this.device.curtain?.hide_lightsensor) {
870
+ if (!this.device.blindTilt?.hide_lightsensor) {
871
871
  if (this.CurrentAmbientLightLevel === undefined || Number.isNaN(this.CurrentAmbientLightLevel)) {
872
872
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} CurrentAmbientLightLevel: ${this.CurrentAmbientLightLevel}`);
873
873
  } else {
@@ -937,7 +937,7 @@ export class BlindTilt {
937
937
  }
938
938
 
939
939
  async stopScanning(switchbot: any) {
940
- await switchbot.stopScan();
940
+ switchbot.stopScan();
941
941
  if (this.connected) {
942
942
  await this.BLEparseStatus();
943
943
  await this.updateHomeKitCharacteristics();
@@ -981,7 +981,7 @@ export class BlindTilt {
981
981
 
982
982
  async SilentPerformance() {
983
983
  if (this.TargetPosition > 50) {
984
- if (this.device.curtain?.setOpenMode === '1') {
984
+ if (this.device.blindTilt?.setOpenMode === '1') {
985
985
  this.setPositionMode = 1;
986
986
  this.Mode = 'Silent Mode';
987
987
  } else {
@@ -989,7 +989,7 @@ export class BlindTilt {
989
989
  this.Mode = 'Performance Mode';
990
990
  }
991
991
  } else {
992
- if (this.device.curtain?.setCloseMode === '1') {
992
+ if (this.device.blindTilt?.setCloseMode === '1') {
993
993
  this.setPositionMode = 1;
994
994
  this.Mode = 'Silent Mode';
995
995
  } else {
@@ -1017,8 +1017,8 @@ export class BlindTilt {
1017
1017
  }
1018
1018
 
1019
1019
  minStep(device: device & devicesConfig): number {
1020
- if (device.curtain?.set_minStep) {
1021
- this.set_minStep = device.curtain?.set_minStep;
1020
+ if (device.blindTilt?.set_minStep) {
1021
+ this.set_minStep = device.blindTilt?.set_minStep;
1022
1022
  } else {
1023
1023
  this.set_minStep = 1;
1024
1024
  }
@@ -1026,8 +1026,8 @@ export class BlindTilt {
1026
1026
  }
1027
1027
 
1028
1028
  minLux(): number {
1029
- if (this.device.curtain?.set_minLux) {
1030
- this.set_minLux = this.device.curtain?.set_minLux;
1029
+ if (this.device.blindTilt?.set_minLux) {
1030
+ this.set_minLux = this.device.blindTilt?.set_minLux;
1031
1031
  } else {
1032
1032
  this.set_minLux = 1;
1033
1033
  }
@@ -1035,8 +1035,8 @@ export class BlindTilt {
1035
1035
  }
1036
1036
 
1037
1037
  maxLux(): number {
1038
- if (this.device.curtain?.set_maxLux) {
1039
- this.set_maxLux = this.device.curtain?.set_maxLux;
1038
+ if (this.device.blindTilt?.set_maxLux) {
1039
+ this.set_maxLux = this.device.blindTilt?.set_maxLux;
1040
1040
  } else {
1041
1041
  this.set_maxLux = 6001;
1042
1042
  }
package/src/device/bot.ts CHANGED
@@ -1130,7 +1130,7 @@ export class Bot {
1130
1130
  }
1131
1131
 
1132
1132
  async stopScanning(switchbot: any) {
1133
- await switchbot.stopScan();
1133
+ switchbot.stopScan();
1134
1134
  if (this.connected) {
1135
1135
  await this.BLEparseStatus();
1136
1136
  await this.updateHomeKitCharacteristics();
@@ -922,7 +922,7 @@ export class CeilingLight {
922
922
  }
923
923
 
924
924
  async stopScanning(switchbot: any) {
925
- await switchbot.stopScan();
925
+ switchbot.stopScan();
926
926
  if (this.connected) {
927
927
  await this.BLEparseStatus();
928
928
  await this.updateHomeKitCharacteristics();
@@ -1079,7 +1079,7 @@ export class ColorBulb {
1079
1079
  }
1080
1080
 
1081
1081
  async stopScanning(switchbot: any) {
1082
- await switchbot.stopScan();
1082
+ switchbot.stopScan();
1083
1083
  if (this.connected) {
1084
1084
  await this.BLEparseStatus();
1085
1085
  await this.updateHomeKitCharacteristics();
@@ -470,7 +470,7 @@ export class Contact {
470
470
  }
471
471
 
472
472
  async stopScanning(switchbot: any) {
473
- await switchbot.stopScan();
473
+ switchbot.stopScan();
474
474
  if (this.connected) {
475
475
  await this.BLEparseStatus();
476
476
  await this.updateHomeKitCharacteristics();
@@ -846,7 +846,7 @@ export class Curtain {
846
846
  }
847
847
 
848
848
  async stopScanning(switchbot: any) {
849
- await switchbot.stopScan();
849
+ switchbot.stopScan();
850
850
  if (this.connected) {
851
851
  await this.BLEparseStatus();
852
852
  await this.updateHomeKitCharacteristics();
@@ -771,7 +771,7 @@ export class Humidifier {
771
771
  }
772
772
 
773
773
  async stopScanning(switchbot: any) {
774
- await switchbot.stopScan();
774
+ switchbot.stopScan();
775
775
  if (this.connected) {
776
776
  await this.BLEparseStatus();
777
777
  await this.updateHomeKitCharacteristics();
@@ -513,7 +513,7 @@ export class Lock {
513
513
  }
514
514
 
515
515
  async stopScanning(switchbot: any) {
516
- await switchbot.stopScan();
516
+ switchbot.stopScan();
517
517
  if (this.connected) {
518
518
  await this.BLEparseStatus();
519
519
  await this.updateHomeKitCharacteristics();
@@ -495,7 +495,7 @@ export class Meter {
495
495
  }
496
496
 
497
497
  async stopScanning(switchbot: any) {
498
- await switchbot.stopScan();
498
+ switchbot.stopScan();
499
499
  if (this.connected) {
500
500
  await this.BLEparseStatus();
501
501
  await this.updateHomeKitCharacteristics();
@@ -495,7 +495,7 @@ export class MeterPlus {
495
495
  }
496
496
 
497
497
  async stopScanning(switchbot: any) {
498
- await switchbot.stopScan();
498
+ switchbot.stopScan();
499
499
  if (this.connected) {
500
500
  await this.BLEparseStatus();
501
501
  await this.updateHomeKitCharacteristics();
@@ -420,7 +420,7 @@ export class Motion {
420
420
  }
421
421
 
422
422
  async stopScanning(switchbot: any) {
423
- await switchbot.stopScan();
423
+ switchbot.stopScan();
424
424
  if (this.connected) {
425
425
  await this.BLEparseStatus();
426
426
  await this.updateHomeKitCharacteristics();
@@ -471,7 +471,7 @@ export class Plug {
471
471
  }
472
472
 
473
473
  async stopScanning(switchbot: any) {
474
- await switchbot.stopScan();
474
+ switchbot.stopScan();
475
475
  if (this.connected) {
476
476
  await this.BLEparseStatus();
477
477
  await this.updateHomeKitCharacteristics();
@@ -595,7 +595,7 @@ export class RobotVacuumCleaner {
595
595
  }
596
596
 
597
597
  async stopScanning(switchbot: any) {
598
- await switchbot.stopScan();
598
+ switchbot.stopScan();
599
599
  if (this.connected) {
600
600
  await this.BLEparseStatus();
601
601
  await this.updateHomeKitCharacteristics();
@@ -843,7 +843,7 @@ export class StripLight {
843
843
  }
844
844
 
845
845
  async stopScanning(switchbot: any) {
846
- await switchbot.stopScan();
846
+ switchbot.stopScan();
847
847
  if (this.connected) {
848
848
  await this.BLEparseStatus();
849
849
  await this.updateHomeKitCharacteristics();
@@ -909,8 +909,8 @@ export class StripLight {
909
909
  }
910
910
 
911
911
  minStep(device: device & devicesConfig): number {
912
- if (device.colorbulb?.set_minStep) {
913
- this.set_minStep = device.colorbulb?.set_minStep;
912
+ if (device.striplight?.set_minStep) {
913
+ this.set_minStep = device.striplight?.set_minStep;
914
914
  } else {
915
915
  this.set_minStep = 1;
916
916
  }
@@ -918,8 +918,8 @@ export class StripLight {
918
918
  }
919
919
 
920
920
  async adaptiveLighting(device: device & devicesConfig): Promise<void> {
921
- if (device.colorbulb?.adaptiveLightingShift) {
922
- this.adaptiveLightingShift = device.colorbulb.adaptiveLightingShift;
921
+ if (device.striplight?.adaptiveLightingShift) {
922
+ this.adaptiveLightingShift = device.striplight.adaptiveLightingShift;
923
923
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} adaptiveLightingShift: ${this.adaptiveLightingShift}`);
924
924
  } else {
925
925
  this.adaptiveLightingShift = 0;
@@ -1050,8 +1050,8 @@ export class StripLight {
1050
1050
 
1051
1051
  async config(device: device & devicesConfig): Promise<void> {
1052
1052
  let config = {};
1053
- if (device.colorbulb) {
1054
- config = device.colorbulb;
1053
+ if (device.striplight) {
1054
+ config = device.striplight;
1055
1055
  }
1056
1056
  if (device.connectionType !== undefined) {
1057
1057
  config['connectionType'] = device.connectionType;
package/src/settings.ts CHANGED
@@ -69,6 +69,7 @@ export interface devicesConfig extends device {
69
69
  contact?: contact;
70
70
  motion?: motion;
71
71
  colorbulb?: colorbulb;
72
+ striplight?: striplight;
72
73
  ceilinglight?: ceilinglight;
73
74
  plug?: Record<any, any>;
74
75
  lock?: lock;
@@ -108,9 +109,15 @@ export type curtain = {
108
109
 
109
110
  export type blindTilt = {
110
111
  mode?: string;
112
+ hide_lightsensor?: boolean;
113
+ set_minLux?: number;
114
+ set_maxLux?: number;
111
115
  updateRate?: number;
112
116
  set_max?: number;
113
117
  set_min?: number;
118
+ set_minStep?: number;
119
+ setCloseMode?: string;
120
+ setOpenMode?: string;
114
121
  };
115
122
 
116
123
  export type contact = {
@@ -131,6 +138,11 @@ export type colorbulb = {
131
138
  adaptiveLightingShift?: number;
132
139
  };
133
140
 
141
+ export type striplight = {
142
+ set_minStep?: number;
143
+ adaptiveLightingShift?: number;
144
+ };
145
+
134
146
  export type ceilinglight = {
135
147
  set_minStep?: number;
136
148
  adaptiveLightingShift?: number;