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
|
|
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
|
-
|
|
217
|
-
|
|
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
package/src/lib/vesyncFanImpl.ts
CHANGED
|
@@ -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
|
-
|
|
265
|
-
|
|
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
|
|