tsvesync 1.0.55 → 1.0.56

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.
@@ -210,11 +210,12 @@ class VeSyncAirBypass extends vesyncFan_1.VeSyncFan {
210
210
  * Change fan speed
211
211
  */
212
212
  async changeFanSpeed(speed) {
213
- var _a, _b, _c;
213
+ var _a, _b;
214
214
  logger_1.logger.debug(`Attempting to change fan speed to ${speed} for device: ${this.deviceName}`);
215
215
  logger_1.logger.debug(`Available speeds: ${(_a = this.config.levels) === null || _a === void 0 ? void 0 : _a.join(', ')}`);
216
- if (!((_b = this.config.levels) === null || _b === void 0 ? void 0 : _b.includes(speed))) {
217
- logger_1.logger.error(`Invalid speed: ${speed}. Must be one of: ${(_c = this.config.levels) === null || _c === void 0 ? void 0 : _c.join(', ')} for device: ${this.deviceName}`);
216
+ const speeds = (_b = this.config.levels) !== null && _b !== void 0 ? _b : [];
217
+ if (!speeds.includes(speed)) {
218
+ logger_1.logger.debug(`Invalid speed: ${speed}. Must be one of: ${speeds.join(', ')}`);
218
219
  return false;
219
220
  }
220
221
  logger_1.logger.info(`Changing fan speed to ${speed} for device: ${this.deviceName}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tsvesync",
3
- "version": "1.0.55",
3
+ "version": "1.0.56",
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",
@@ -261,8 +261,9 @@ export class VeSyncAirBypass extends VeSyncFan {
261
261
  logger.debug(`Attempting to change fan speed to ${speed} for device: ${this.deviceName}`);
262
262
  logger.debug(`Available speeds: ${this.config.levels?.join(', ')}`);
263
263
 
264
- if (!this.config.levels?.includes(speed)) {
265
- logger.error(`Invalid speed: ${speed}. Must be one of: ${this.config.levels?.join(', ')} for device: ${this.deviceName}`);
264
+ const speeds = this.config.levels ?? [];
265
+ if (!speeds.includes(speed)) {
266
+ logger.debug(`Invalid speed: ${speed}. Must be one of: ${speeds.join(', ')}`);
266
267
  return false;
267
268
  }
268
269