add all existing items, homekit export
This commit is contained in:
9
dist/HomematicSwitchItem.js
vendored
9
dist/HomematicSwitchItem.js
vendored
@ -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) {
|
||||
|
Reference in New Issue
Block a user