add all existing items, homekit export

This commit is contained in:
Wolfgang Hottgenroth
2018-01-10 14:15:43 +01:00
parent 153b8570e4
commit 8a6547ff91
20 changed files with 746 additions and 42 deletions

View File

@ -2,9 +2,10 @@
Object.defineProperty(exports, "__esModule", { value: true });
const MqttDispatcher_1 = require("./MqttDispatcher");
const AHomematicItem_1 = require("./AHomematicItem");
const Export_1 = require("./Export");
class HomematicSwitchItem extends AHomematicItem_1.AHomematicItem {
constructor(floor, room, item, hmId) {
super(floor, room, item, hmId);
constructor(floor, room, item, label, hmId, type = 'bulb') {
super(floor, room, item, label, hmId);
this.stateTopic = `${this.topicFirstPart}/state`;
this.stateFeedbackTopic = `${this.topicFirstPart}/state/feedback`;
this.deviceFeedbackTopic = `${this.deviceTopicPre}/1/STATE`;
@ -15,6 +16,10 @@ class HomematicSwitchItem extends AHomematicItem_1.AHomematicItem {
];
this.state = 'OFF';
this.oldState = undefined;
this.type = type;
}
exportHomekit() {
return Export_1.SwitchHomekitExport(this.itemId, this.label, this.stateTopic, this.stateFeedbackTopic, this.type);
}
processMessage(topic, payload) {
switch (topic) {