homebridge-loxone-proxy
Version:
Homebridge Dynamic Platform Plugin which exposes a Loxone System to Homekit.
30 lines • 1.25 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SmokeSensor = void 0;
const BaseService_1 = require("./BaseService");
class SmokeSensor extends BaseService_1.BaseService {
constructor() {
super(...arguments);
this.State = {
SmokeDetected: false,
};
this.updateService = (message) => {
this.platform.log.debug(`[${this.device.name}] Callback state update for SmokeSensor: ${!!message.value}`);
this.State.SmokeDetected = !!message.value;
this.service.getCharacteristic(this.platform.Characteristic.SmokeDetected).updateValue(this.State.SmokeDetected);
};
}
setupService() {
this.service =
this.accessory.getService(this.platform.Service.SmokeSensor) ||
this.accessory.addService(this.platform.Service.SmokeSensor);
this.service.getCharacteristic(this.platform.Characteristic.SmokeDetected)
.onGet(this.handleSmokeDetectedGet.bind(this));
}
handleSmokeDetectedGet() {
this.platform.log.debug('Triggered GET SmokeDetected');
return this.State.SmokeDetected;
}
}
exports.SmokeSensor = SmokeSensor;
//# sourceMappingURL=SmokeSensor.js.map