"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const logger = require("./log"); 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}`; } exportHomekit() { return { 'id': this.itemId, 'object': null }; } 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