22 lines
798 B
JavaScript
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
|