typescriptifying
This commit is contained in:
21
dist/AItem.js
vendored
Normal file
21
dist/AItem.js
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const logger = require("./log");
|
||||
const MqttDispatcher_1 = require("./MqttDispatcher");
|
||||
class AItem {
|
||||
constructor(floor, room, item) {
|
||||
this.floor = floor;
|
||||
this.room = room;
|
||||
this.item = item;
|
||||
this.itemId = `${this.floor}.${this.room}.${this.item}`;
|
||||
this.topicFirstPart = `dispatcher_ng/items/${this.floor}/${this.room}/${this.item}`;
|
||||
}
|
||||
start() {
|
||||
MqttDispatcher_1.mqttHandler.register(this.subscribeTopics, (topic, payload) => {
|
||||
logger.info(`item ${this.itemId}: ${topic}, ${payload}`);
|
||||
this.processMessage(topic, payload);
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.AItem = AItem;
|
||||
//# sourceMappingURL=AItem.js.map
|
Reference in New Issue
Block a user