off
This commit is contained in:
22
dist/SwitchOffAdaptor.js
vendored
Normal file
22
dist/SwitchOffAdaptor.js
vendored
Normal 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
|
Reference in New Issue
Block a user