on/off only

This commit is contained in:
2018-07-11 07:52:09 +02:00
parent a44235a8e8
commit 389d519a58

View File

@ -83,8 +83,11 @@ void callback(char* topic, byte* payload, unsigned int length) {
#endif
if (! strcmp(topic, configBlock.mqttTopic)) {
int value = atoi(buffer);
analogWrite(LIGHT_PIN, value);
if (! strcmp(buffer, "ON")) {
digitalWrite(LIGHT_PIN, HIGH);
} else {
digitalWrite(LIGHT_PIN, LOW);
}
}
}
}