Files
dispatcher_ng/dist/AItem.js
2018-04-06 23:38:08 +02:00

31 lines
970 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const MqttDispatcher_1 = require("./MqttDispatcher");
class AItem {
constructor(floor, room, item, label = '') {
this.floor = floor;
this.room = room;
this.item = item;
this.itemId = `${this.floor}_${this.room}_${this.item}`;
if (label == '') {
this.label = this.itemId;
}
else {
this.label = label;
}
this.topicFirstPart = `dispatcher_ng/items/${this.floor}/${this.room}/${this.item}`;
}
startFunc() {
}
exportItem() {
return null;
}
start() {
MqttDispatcher_1.mqttHandler.register(this.subscribeTopics, (topic, payload) => {
// logger.info(`item ${this.itemId}: ${topic}, ${payload}`)
this.processMessage(topic, payload);
}, () => { this.startFunc(); });
}
}
exports.AItem = AItem;
//# sourceMappingURL=AItem.js.map