UNPKG

homebridge-loxone-proxy

Version:

Homebridge Dynamic Platform Plugin which exposes a Loxone System to Homekit.

33 lines 1.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LightBulb = void 0; const Switch_1 = require("./Switch"); class LightBulb extends Switch_1.Switch { constructor() { super(...arguments); this.State = { On: false, Brightness: 0, }; } setupService() { super.setupService(); this.service.getCharacteristic(this.platform.Characteristic.Brightness) .onSet(this.setBrightness.bind(this)); } getSwitchType() { return this.platform.Service.Lightbulb; } updateService(message) { super.updateService(message); this.State.Brightness = message.value; this.service.getCharacteristic(this.platform.Characteristic.Brightness).updateValue(this.State.Brightness); } async setBrightness(value) { this.State.Brightness = value; this.platform.log.debug(`[${this.device.name}] - send message: ${this.State.Brightness}`); this.platform.LoxoneHandler.sendCommand(this.device.uuidAction, this.State.Brightness.toString()); } } exports.LightBulb = LightBulb; //# sourceMappingURL=LightBulb.js.map