Browse Source

Added MQTT toggle message

fastled
Xose Pérez 8 years ago
parent
commit
b4e376fe05
1 changed files with 9 additions and 3 deletions
  1. +9
    -3
      code/src/code.ino

+ 9
- 3
code/src/code.ino View File

@ -547,11 +547,17 @@ void wifiLoop() {
Serial.println(); Serial.println();
#endif #endif
isMQTTMessage = true;
// Action to perform
if ((char)payload[0] == '0') {
isMQTTMessage = true;
switchRelayOff();
}
if ((char)payload[0] == '1') { if ((char)payload[0] == '1') {
isMQTTMessage = true;
switchRelayOn(); switchRelayOn();
} else {
switchRelayOff();
}
if ((char)payload[0] == '2') {
toggleRelay();
} }
isMQTTMessage = false; isMQTTMessage = false;


Loading…
Cancel
Save