UNPKG

homebridge-loxone-proxy

Version:

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

32 lines 1.38 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Doorbell = void 0; const BaseService_1 = require("./BaseService"); class Doorbell extends BaseService_1.BaseService { constructor() { super(...arguments); this.State = { ProgrammableSwitchEvent: 0, }; } setupService() { this.service = this.accessory.getService(this.platform.Service.Doorbell) || this.accessory.addService(this.platform.Service.Doorbell); this.service.getCharacteristic(this.platform.Characteristic.ProgrammableSwitchEvent) .onGet(() => this.handleProgrammableSwitchEventGet()); } updateService(message) { var _a, _b; this.platform.log.debug(`[${this.device.name}] Callback state update for Doorbell: ${message.value}`); if (message.value === 1) { (_b = (_a = this.service) === null || _a === void 0 ? void 0 : _a.getCharacteristic(this.platform.Characteristic.ProgrammableSwitchEvent)) === null || _b === void 0 ? void 0 : _b.updateValue(this.State.ProgrammableSwitchEvent); } } handleProgrammableSwitchEventGet() { this.platform.log.debug('Triggered GET ProgrammableSwitchEvent'); return this.State.ProgrammableSwitchEvent; } } exports.Doorbell = Doorbell; //# sourceMappingURL=Doorbell.js.map