homebridge-levoit-air-purifier
Version:
Made for Core 200S/300S/400S/400S Pro/600S
25 lines • 797 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("../util");
const characteristic = {
get: async function () {
await this.device.updateInfo();
return this.device.isOn;
},
set: async function (value) {
var _a;
let boolValue = value === 1;
if (boolValue !== this.device.isOn) {
const success = await this.device.setPower(boolValue);
if (!success) {
boolValue = !boolValue;
}
}
else {
await (0, util_1.delay)(10);
}
(_a = this.currentStateChar) === null || _a === void 0 ? void 0 : _a.updateValue(this.device.currentState);
}
};
exports.default = characteristic;
//# sourceMappingURL=Active.js.map