Files
dispatcher_ng/dist/SwitchOffAdaptor.js
Wolfgang Hottgenroth 4d0b708e4a off
2018-05-25 00:08:19 +02:00

22 lines
798 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const AItem_1 = require("./AItem");
const MqttDispatcher_1 = require("./MqttDispatcher");
class SwitchOffAdaptor extends AItem_1.AItem {
constructor(floor, room, item) {
super(floor, room, item);
this.actionStateTopic = `${this.topicFirstPart}/state`;
this.inTopic = `${this.topicFirstPart}/in`;
this.subscribeTopics = [this.inTopic];
}
getInTopic() {
return this.inTopic;
}
processMessage(topic, payload) {
if ((topic == this.inTopic) && (payload == 'SHORT')) {
MqttDispatcher_1.mqttHandler.send(this.actionStateTopic, 'OFF', true);
}
}
}
exports.SwitchOffAdaptor = SwitchOffAdaptor;
//# sourceMappingURL=SwitchOffAdaptor.js.map