This commit is contained in:
Wolfgang Hottgenroth
2018-05-25 00:08:19 +02:00
parent e413f2871c
commit 4d0b708e4a
4 changed files with 41 additions and 32 deletions

22
dist/SwitchOffAdaptor.js vendored Normal file
View File

@ -0,0 +1,22 @@
"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