tsvesync 1.0.60 → 1.0.62
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.
|
@@ -1062,10 +1062,13 @@ class VeSyncAirBaseV2 extends VeSyncAirBypass {
|
|
|
1062
1062
|
}
|
|
1063
1063
|
buildConfigDict(configDict) {
|
|
1064
1064
|
if (configDict) {
|
|
1065
|
+
// Only merge non-critical configuration fields
|
|
1066
|
+
const { module, features, levels, ...otherConfig } = configDict;
|
|
1065
1067
|
this.config = {
|
|
1066
|
-
...this.config, //
|
|
1067
|
-
...
|
|
1068
|
+
...this.config, // Keep base config (including module, features, levels)
|
|
1069
|
+
...otherConfig // Only merge other configuration fields
|
|
1068
1070
|
};
|
|
1071
|
+
logger_1.logger.debug(`Updated configuration for device: ${this.deviceName}, preserved base config fields`);
|
|
1069
1072
|
}
|
|
1070
1073
|
}
|
|
1071
1074
|
get mode() {
|
|
@@ -1622,7 +1625,7 @@ class VeSyncTowerFan extends VeSyncAirBaseV2 {
|
|
|
1622
1625
|
var _a;
|
|
1623
1626
|
const speeds = (_a = this.config.levels) !== null && _a !== void 0 ? _a : [];
|
|
1624
1627
|
if (!speeds.includes(speed)) {
|
|
1625
|
-
logger_1.logger.
|
|
1628
|
+
logger_1.logger.error(`Invalid speed: ${speed}. Must be one of: ${speeds.join(', ')} for device: ${this.deviceName}`);
|
|
1626
1629
|
return false;
|
|
1627
1630
|
}
|
|
1628
1631
|
const [head, body] = this.buildApiDict('setLevel');
|
package/package.json
CHANGED
package/src/lib/vesyncFanImpl.ts
CHANGED
|
@@ -1291,10 +1291,13 @@ export class VeSyncAirBaseV2 extends VeSyncAirBypass {
|
|
|
1291
1291
|
|
|
1292
1292
|
protected buildConfigDict(configDict: Record<string, any>): void {
|
|
1293
1293
|
if (configDict) {
|
|
1294
|
+
// Only merge non-critical configuration fields
|
|
1295
|
+
const { module, features, levels, ...otherConfig } = configDict;
|
|
1294
1296
|
this.config = {
|
|
1295
|
-
...this.config, //
|
|
1296
|
-
...
|
|
1297
|
+
...this.config, // Keep base config (including module, features, levels)
|
|
1298
|
+
...otherConfig // Only merge other configuration fields
|
|
1297
1299
|
};
|
|
1300
|
+
logger.debug(`Updated configuration for device: ${this.deviceName}, preserved base config fields`);
|
|
1298
1301
|
}
|
|
1299
1302
|
}
|
|
1300
1303
|
|
|
@@ -2000,7 +2003,7 @@ export class VeSyncTowerFan extends VeSyncAirBaseV2 {
|
|
|
2000
2003
|
async changeFanSpeed(speed: number): Promise<boolean> {
|
|
2001
2004
|
const speeds = this.config.levels ?? [];
|
|
2002
2005
|
if (!speeds.includes(speed)) {
|
|
2003
|
-
logger.
|
|
2006
|
+
logger.error(`Invalid speed: ${speed}. Must be one of: ${speeds.join(', ')} for device: ${this.deviceName}`);
|
|
2004
2007
|
return false;
|
|
2005
2008
|
}
|
|
2006
2009
|
|