UNPKG

homebridge-levoit-humidifiers

Version:
30 lines 1.03 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * DisplayState characteristic handler for the Display service. * Controls whether the device's display screen is on or off. * * Note: Uses cached device state from background polling to avoid slow read warnings. */ const characteristic = { /** * Gets whether the display is currently on. * Returns false if device is off, regardless of display state. * Uses cached state to ensure fast response times. */ get: async function () { // Use cached state - background polling keeps this fresh // Display should show as off when device is off return this.device.isOn && this.device.displayOn; }, /** * Sets the display state (on/off). */ set: async function (value) { const boolValue = value == 1; await this.device.setDisplay(boolValue); this.updateAllCharacteristics(); }, }; exports.default = characteristic; //# sourceMappingURL=DisplayState.js.map