on/off only
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user