fix states

This commit is contained in:
Ronald Schaten 2017-01-20 22:59:25 +01:00
parent 132cdac6ad
commit 67120c4c35

View File

@ -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 {