fix
This commit is contained in:
4
dist/SimpleTopicSwitchItem.js
vendored
4
dist/SimpleTopicSwitchItem.js
vendored
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user