"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const MqttDispatcher_1 = require("./MqttDispatcher"); const Events = require("events"); class AItem extends Events.EventEmitter { constructor(floor, room, item, label = '') { super(); 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