homebridge-levoit-humidifiers
Version:
Homebridge plugin for Levoit Humidifiers
28 lines • 1.31 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const characteristic = {
get: async function () {
await this.device.updateInfo();
return this.device.isOn && this.device.warmEnabled;
},
set: async function (value) {
const boolValue = value == 1;
if (!boolValue) {
await this.device.changeWarmMistLevel(0);
await this.device.updateInfo();
}
else if (!this.device.warmEnabled && this.device.warmLevel == 0) {
/*
If turning on Warm Mode from Off state, we set it to the highest warmMistLevel value.
This is because we can't determine the selected slider number from the WarmMistLevel characteristic.
This appears like a bug (from Off, set to lowest level, but it will set to highest level instead),
but there's not a good way to handle this since VeSync doesn't have an on/off for Warm Mode, just
level selection.
*/
await this.device.changeWarmMistLevel(Number(this.device.deviceType.warmMistLevels));
await this.device.updateInfo();
}
},
};
exports.default = characteristic;
//# sourceMappingURL=WarmActive.js.map