This commit is contained in:
2018-09-23 16:54:40 +02:00
parent 80550321d2
commit f4933cb483
2 changed files with 4 additions and 4 deletions

View File

@ -40,10 +40,10 @@ class SimpleTopicSwitchItem extends AItem_1.AItem {
MqttDispatcher_1.mqttHandler.send(this.stateFeedbackTopic, this.state);
if (this.state != this.oldState) {
if (this.state == 'ON') {
MqttDispatcher_1.mqttHandler.send(this.actionTopic, 'true');
MqttDispatcher_1.mqttHandler.send(this.actionTopic, 'ON');
}
else {
MqttDispatcher_1.mqttHandler.send(this.actionTopic, 'false');
MqttDispatcher_1.mqttHandler.send(this.actionTopic, 'OFF');
}
this.oldState = this.state;
}

View File

@ -57,9 +57,9 @@ export class SimpleTopicSwitchItem extends AItem implements HasStateAndFeedbackT
mqttHandler.send(this.stateFeedbackTopic, this.state)
if (this.state != this.oldState) {
if (this.state == 'ON') {
mqttHandler.send(this.actionTopic, 'true')
mqttHandler.send(this.actionTopic, 'ON')
} else {
mqttHandler.send(this.actionTopic, 'false')
mqttHandler.send(this.actionTopic, 'OFF')
}
this.oldState = this.state
}