fix states
This commit is contained in:
parent
132cdac6ad
commit
67120c4c35
@ -11,11 +11,11 @@ void DeviceRelay::deviceSetup() {
|
|||||||
|
|
||||||
bool DeviceRelay::relayOnHandler(String value) {
|
bool DeviceRelay::relayOnHandler(String value) {
|
||||||
if (value == "true") {
|
if (value == "true") {
|
||||||
setRelay(HIGH);
|
setRelay(LOW);
|
||||||
Homie.setNodeProperty(relayNode, "on", "true");
|
Homie.setNodeProperty(relayNode, "on", "true");
|
||||||
Serial.println("relay is on");
|
Serial.println("relay is on");
|
||||||
} else if (value == "false") {
|
} else if (value == "false") {
|
||||||
setRelay(LOW);
|
setRelay(HIGH);
|
||||||
Homie.setNodeProperty(relayNode, "on", "false");
|
Homie.setNodeProperty(relayNode, "on", "false");
|
||||||
Serial.println("relay is off");
|
Serial.println("relay is off");
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user