tsvesync 1.0.62 → 1.0.63

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.
@@ -209,12 +209,11 @@ class VeSyncAirBypass extends vesyncFan_1.VeSyncFan {
209
209
  * Change fan speed
210
210
  */
211
211
  async changeFanSpeed(speed) {
212
- var _a;
213
- const speeds = (_a = this.config.levels) !== null && _a !== void 0 ? _a : [];
214
- if (!speeds.includes(speed)) {
215
- logger_1.logger.error(`Invalid speed: ${speed}. Must be one of: ${speeds.join(', ')} for device: ${this.deviceName}`);
216
- return false;
217
- }
212
+ // const speeds = this.config.levels ?? [];
213
+ // if (!speeds.includes(speed)) {
214
+ // logger.error(`Invalid speed: ${speed}. Must be one of: ${speeds.join(', ')} for device: ${this.deviceName}`);
215
+ // return false;
216
+ // }
218
217
  logger_1.logger.info(`Changing fan speed to ${speed} for device: ${this.deviceName}`);
219
218
  const [response, status] = await this.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
220
219
  ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
@@ -1062,13 +1061,10 @@ class VeSyncAirBaseV2 extends VeSyncAirBypass {
1062
1061
  }
1063
1062
  buildConfigDict(configDict) {
1064
1063
  if (configDict) {
1065
- // Only merge non-critical configuration fields
1066
- const { module, features, levels, ...otherConfig } = configDict;
1067
1064
  this.config = {
1068
- ...this.config, // Keep base config (including module, features, levels)
1069
- ...otherConfig // Only merge other configuration fields
1065
+ ...this.config, // Preserve existing config
1066
+ ...configDict // Merge in new config
1070
1067
  };
1071
- logger_1.logger.debug(`Updated configuration for device: ${this.deviceName}, preserved base config fields`);
1072
1068
  }
1073
1069
  }
1074
1070
  get mode() {
@@ -1214,12 +1210,11 @@ class VeSyncAirBaseV2 extends VeSyncAirBypass {
1214
1210
  * Change fan speed
1215
1211
  */
1216
1212
  async changeFanSpeed(speed) {
1217
- var _a;
1218
- const speeds = (_a = this.config.levels) !== null && _a !== void 0 ? _a : [];
1219
- if (!speeds.includes(speed)) {
1220
- logger_1.logger.error(`Invalid speed: ${speed}. Must be one of: ${speeds.join(', ')} for device: ${this.deviceName}`);
1221
- return false;
1222
- }
1213
+ // const speeds = this.config.levels ?? [];
1214
+ // if (!speeds.includes(speed)) {
1215
+ // logger.error(`Invalid speed: ${speed}. Must be one of: ${speeds.join(', ')} for device: ${this.deviceName}`);
1216
+ // return false;
1217
+ // }
1223
1218
  logger_1.logger.info(`Changing fan speed to ${speed} for device: ${this.deviceName}`);
1224
1219
  const [response, status] = await this.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
1225
1220
  ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
@@ -1622,12 +1617,11 @@ class VeSyncTowerFan extends VeSyncAirBaseV2 {
1622
1617
  * Change fan speed
1623
1618
  */
1624
1619
  async changeFanSpeed(speed) {
1625
- var _a;
1626
- const speeds = (_a = this.config.levels) !== null && _a !== void 0 ? _a : [];
1627
- if (!speeds.includes(speed)) {
1628
- logger_1.logger.error(`Invalid speed: ${speed}. Must be one of: ${speeds.join(', ')} for device: ${this.deviceName}`);
1629
- return false;
1630
- }
1620
+ // const speeds = this.config.levels ?? [];
1621
+ // if (!speeds.includes(speed)) {
1622
+ // logger.debug(`Invalid speed: ${speed}. Must be one of: ${speeds.join(', ')}`);
1623
+ // return false;
1624
+ // }
1631
1625
  const [head, body] = this.buildApiDict('setLevel');
1632
1626
  body.payload.data = {
1633
1627
  levelIdx: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tsvesync",
3
- "version": "1.0.62",
3
+ "version": "1.0.63",
4
4
  "description": "A TypeScript library for interacting with VeSync smart home devices",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -257,11 +257,11 @@ export class VeSyncAirBypass extends VeSyncFan {
257
257
  * Change fan speed
258
258
  */
259
259
  async changeFanSpeed(speed: number): Promise<boolean> {
260
- const speeds = this.config.levels ?? [];
261
- if (!speeds.includes(speed)) {
262
- logger.error(`Invalid speed: ${speed}. Must be one of: ${speeds.join(', ')} for device: ${this.deviceName}`);
263
- return false;
264
- }
260
+ // const speeds = this.config.levels ?? [];
261
+ // if (!speeds.includes(speed)) {
262
+ // logger.error(`Invalid speed: ${speed}. Must be one of: ${speeds.join(', ')} for device: ${this.deviceName}`);
263
+ // return false;
264
+ // }
265
265
 
266
266
  logger.info(`Changing fan speed to ${speed} for device: ${this.deviceName}`);
267
267
  const [response, status] = await this.callApi(
@@ -1291,13 +1291,10 @@ 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;
1296
1294
  this.config = {
1297
- ...this.config, // Keep base config (including module, features, levels)
1298
- ...otherConfig // Only merge other configuration fields
1295
+ ...this.config, // Preserve existing config
1296
+ ...configDict // Merge in new config
1299
1297
  };
1300
- logger.debug(`Updated configuration for device: ${this.deviceName}, preserved base config fields`);
1301
1298
  }
1302
1299
  }
1303
1300
 
@@ -1472,11 +1469,11 @@ export class VeSyncAirBaseV2 extends VeSyncAirBypass {
1472
1469
  * Change fan speed
1473
1470
  */
1474
1471
  async changeFanSpeed(speed: number): Promise<boolean> {
1475
- const speeds = this.config.levels ?? [];
1476
- if (!speeds.includes(speed)) {
1477
- logger.error(`Invalid speed: ${speed}. Must be one of: ${speeds.join(', ')} for device: ${this.deviceName}`);
1478
- return false;
1479
- }
1472
+ // const speeds = this.config.levels ?? [];
1473
+ // if (!speeds.includes(speed)) {
1474
+ // logger.error(`Invalid speed: ${speed}. Must be one of: ${speeds.join(', ')} for device: ${this.deviceName}`);
1475
+ // return false;
1476
+ // }
1480
1477
 
1481
1478
  logger.info(`Changing fan speed to ${speed} for device: ${this.deviceName}`);
1482
1479
  const [response, status] = await this.callApi(
@@ -2001,11 +1998,11 @@ export class VeSyncTowerFan extends VeSyncAirBaseV2 {
2001
1998
  * Change fan speed
2002
1999
  */
2003
2000
  async changeFanSpeed(speed: number): Promise<boolean> {
2004
- const speeds = this.config.levels ?? [];
2005
- if (!speeds.includes(speed)) {
2006
- logger.error(`Invalid speed: ${speed}. Must be one of: ${speeds.join(', ')} for device: ${this.deviceName}`);
2007
- return false;
2008
- }
2001
+ // const speeds = this.config.levels ?? [];
2002
+ // if (!speeds.includes(speed)) {
2003
+ // logger.debug(`Invalid speed: ${speed}. Must be one of: ${speeds.join(', ')}`);
2004
+ // return false;
2005
+ // }
2009
2006
 
2010
2007
  const [head, body] = this.buildApiDict('setLevel');
2011
2008
  body.payload.data = {