remove state for switch actors
This commit is contained in:
15
dist/HomematicSwitchItem.js
vendored
15
dist/HomematicSwitchItem.js
vendored
@ -31,7 +31,6 @@ class HomematicSwitchItem extends AHomegearItem_1.AHomegearItem {
|
||||
this.deviceFeedbackTopic
|
||||
];
|
||||
this.state = 'OFF';
|
||||
this.oldState = undefined;
|
||||
this.type = type;
|
||||
}
|
||||
exportItem() {
|
||||
@ -42,14 +41,11 @@ class HomematicSwitchItem extends AHomegearItem_1.AHomegearItem {
|
||||
case this.stateTopic:
|
||||
this.state = payload;
|
||||
MqttDispatcher_1.mqttHandler.send(this.stateFeedbackTopic, this.state);
|
||||
if (this.state != this.oldState) {
|
||||
if (this.state == 'ON') {
|
||||
MqttDispatcher_1.mqttHandler.send(this.actionTopic, 'true');
|
||||
}
|
||||
else {
|
||||
MqttDispatcher_1.mqttHandler.send(this.actionTopic, 'false');
|
||||
}
|
||||
this.oldState = this.state;
|
||||
if (this.state == 'ON') {
|
||||
MqttDispatcher_1.mqttHandler.send(this.actionTopic, 'true');
|
||||
}
|
||||
else {
|
||||
MqttDispatcher_1.mqttHandler.send(this.actionTopic, 'false');
|
||||
}
|
||||
break;
|
||||
case this.deviceFeedbackTopic:
|
||||
@ -59,7 +55,6 @@ class HomematicSwitchItem extends AHomegearItem_1.AHomegearItem {
|
||||
else {
|
||||
this.state = 'OFF';
|
||||
}
|
||||
this.oldState = this.state;
|
||||
MqttDispatcher_1.mqttHandler.send(this.stateFeedbackTopic, this.state);
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user