@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.
- package/config.schema.json +64 -2
- package/dist/device/blindtilt.js +12 -12
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.js +1 -1
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.js +1 -1
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.js +1 -1
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.js +1 -1
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.js +1 -1
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/humidifier.js +1 -1
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/lock.js +1 -1
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.js +1 -1
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.js +1 -1
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.js +1 -1
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.js +1 -1
- package/dist/device/plug.js.map +1 -1
- package/dist/device/robotvacuumcleaner.js +1 -1
- package/dist/device/robotvacuumcleaner.js.map +1 -1
- package/dist/device/striplight.js +7 -7
- package/dist/device/striplight.js.map +1 -1
- package/dist/settings.d.ts +11 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js.map +1 -1
- package/package.json +1 -1
- package/src/device/blindtilt.ts +12 -12
- package/src/device/bot.ts +1 -1
- package/src/device/ceilinglight.ts +1 -1
- package/src/device/colorbulb.ts +1 -1
- package/src/device/contact.ts +1 -1
- package/src/device/curtain.ts +1 -1
- package/src/device/humidifier.ts +1 -1
- package/src/device/lock.ts +1 -1
- package/src/device/meter.ts +1 -1
- package/src/device/meterplus.ts +1 -1
- package/src/device/motion.ts +1 -1
- package/src/device/plug.ts +1 -1
- package/src/device/robotvacuumcleaner.ts +1 -1
- package/src/device/striplight.ts +7 -7
- package/src/settings.ts +12 -0
package/src/device/blindtilt.ts
CHANGED
|
@@ -302,7 +302,7 @@ export class BlindTilt {
|
|
|
302
302
|
` TargetPosition: ${this.TargetPosition}, PositionState: ${this.PositionState},`,
|
|
303
303
|
);
|
|
304
304
|
|
|
305
|
-
if (!this.device.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
1021
|
-
this.set_minStep = device.
|
|
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.
|
|
1030
|
-
this.set_minLux = this.device.
|
|
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.
|
|
1039
|
-
this.set_maxLux = this.device.
|
|
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
package/src/device/colorbulb.ts
CHANGED
|
@@ -1079,7 +1079,7 @@ export class ColorBulb {
|
|
|
1079
1079
|
}
|
|
1080
1080
|
|
|
1081
1081
|
async stopScanning(switchbot: any) {
|
|
1082
|
-
|
|
1082
|
+
switchbot.stopScan();
|
|
1083
1083
|
if (this.connected) {
|
|
1084
1084
|
await this.BLEparseStatus();
|
|
1085
1085
|
await this.updateHomeKitCharacteristics();
|
package/src/device/contact.ts
CHANGED
package/src/device/curtain.ts
CHANGED
package/src/device/humidifier.ts
CHANGED
package/src/device/lock.ts
CHANGED
package/src/device/meter.ts
CHANGED
package/src/device/meterplus.ts
CHANGED
package/src/device/motion.ts
CHANGED
package/src/device/plug.ts
CHANGED
package/src/device/striplight.ts
CHANGED
|
@@ -843,7 +843,7 @@ export class StripLight {
|
|
|
843
843
|
}
|
|
844
844
|
|
|
845
845
|
async stopScanning(switchbot: any) {
|
|
846
|
-
|
|
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.
|
|
913
|
-
this.set_minStep = device.
|
|
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.
|
|
922
|
-
this.adaptiveLightingShift = device.
|
|
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.
|
|
1054
|
-
config = device.
|
|
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;
|