tsvesync 1.0.54 → 1.0.55
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.
|
@@ -16,10 +16,7 @@ class VeSyncAirBypass extends vesyncFan_1.VeSyncFan {
|
|
|
16
16
|
this.modes = ['auto', 'manual', 'sleep'];
|
|
17
17
|
this.displayModes = ['on', 'off'];
|
|
18
18
|
this.childLockModes = ['on', 'off'];
|
|
19
|
-
logger_1.logger.
|
|
20
|
-
logger_1.logger.info(`Device Details: ${JSON.stringify(details)}`);
|
|
21
|
-
logger_1.logger.info(`Config: ${JSON.stringify(this.config)}`);
|
|
22
|
-
logger_1.logger.info(`Initialized VeSyncAirBypass device: ${this.deviceName}`);
|
|
19
|
+
logger_1.logger.debug(`Initialized VeSyncAirBypass device: ${this.deviceName}`);
|
|
23
20
|
}
|
|
24
21
|
/**
|
|
25
22
|
* Build API dictionary
|
|
@@ -213,10 +210,11 @@ class VeSyncAirBypass extends vesyncFan_1.VeSyncFan {
|
|
|
213
210
|
* Change fan speed
|
|
214
211
|
*/
|
|
215
212
|
async changeFanSpeed(speed) {
|
|
216
|
-
var _a;
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
213
|
+
var _a, _b, _c;
|
|
214
|
+
logger_1.logger.debug(`Attempting to change fan speed to ${speed} for device: ${this.deviceName}`);
|
|
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}`);
|
|
220
218
|
return false;
|
|
221
219
|
}
|
|
222
220
|
logger_1.logger.info(`Changing fan speed to ${speed} for device: ${this.deviceName}`);
|
package/package.json
CHANGED
package/src/lib/vesyncFanImpl.ts
CHANGED
|
@@ -17,10 +17,7 @@ export class VeSyncAirBypass extends VeSyncFan {
|
|
|
17
17
|
|
|
18
18
|
constructor(details: Record<string, any>, manager: VeSync) {
|
|
19
19
|
super(details, manager);
|
|
20
|
-
logger.
|
|
21
|
-
logger.info(`Device Details: ${JSON.stringify(details)}`);
|
|
22
|
-
logger.info(`Config: ${JSON.stringify(this.config)}`);
|
|
23
|
-
logger.info(`Initialized VeSyncAirBypass device: ${this.deviceName}`);
|
|
20
|
+
logger.debug(`Initialized VeSyncAirBypass device: ${this.deviceName}`);
|
|
24
21
|
}
|
|
25
22
|
|
|
26
23
|
/**
|
|
@@ -261,9 +258,11 @@ export class VeSyncAirBypass extends VeSyncFan {
|
|
|
261
258
|
* Change fan speed
|
|
262
259
|
*/
|
|
263
260
|
async changeFanSpeed(speed: number): Promise<boolean> {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
261
|
+
logger.debug(`Attempting to change fan speed to ${speed} for device: ${this.deviceName}`);
|
|
262
|
+
logger.debug(`Available speeds: ${this.config.levels?.join(', ')}`);
|
|
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}`);
|
|
267
266
|
return false;
|
|
268
267
|
}
|
|
269
268
|
|