Add new + command also to MQTT

See: https://github.com/toblum/McLighting/pull/45
This commit is contained in:
Tobias Blum 2017-10-29 00:20:57 +02:00
parent e3a4690693
commit a025e0a35a

View file

@ -297,6 +297,7 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght
webSocket.sendTXT(num, "OK");
}
// + ==> Set multiple LED in the given colors
if (payload[0] == '+') {
handleSetDifferentColors(payload);
webSocket.sendTXT(num, "OK");
@ -406,6 +407,12 @@ void checkForRequests() {
DBG_OUTPUT_PORT.printf("MQTT: Set single LED in given color [%s]\n", payload);
mqtt_client.publish(mqtt_outtopic, String(String("OK ") + String((char *)payload)).c_str());
}
// + ==> Set multiple LED in the given colors
if (payload[0] == '+') {
handleSetDifferentColors(payload);
mqtt_client.publish(mqtt_outtopic, String(String("OK ") + String((char *)payload)).c_str());
}
// = ==> Activate named mode
if (payload[0] == '=') {