diff --git a/src/main.cpp b/src/main.cpp index 19463e4..4ae8cbc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,8 +3,7 @@ * Normally befor sending it to git, I am testing it. But I can't test it while in school... * So the code here might work or not. But I should be able to garantee that it is working on a Node-MCU (ESP8266) when I tested it. * -* Tested: NO (I did not test it yet) -* Not Tested funktion: oneled +* TESTED: YES */ #include #include @@ -38,7 +37,7 @@ int nextLed = 0; bool onLedsShouldChange(String value){ char chars[value.length() + 1]; strcpy(chars, value.c_str()); //Transforming String into char array. - StaticJsonBuffer<200> jsonBuffer; + StaticJsonBuffer<400> jsonBuffer; JsonObject& root = jsonBuffer.parseObject(chars); //Parsing JSON String if(!root.success()){ //Parsing succeed? Homie.setNodeProperty(stripNode, "last", "{\"state\":\"error\",\"id\":\"jsonParseError\",\"msg\":\"Failed to parse Data.\"}"); //Rückmeldung an den Broker das der String nicht geparsed werden konnte @@ -124,6 +123,7 @@ bool onLedsShouldChange(String value){ else if(actionToDo == "oneled"){ reset(); thingToDo = "oneLed"; + Serial.println("Ha: " + String(root["leds"].size())); for(int count = 0;count < root["leds"].size(); count++){ strip.setPixelColor((int)root["leds"][count]["id"], strip.Color((int)root["leds"][count]["red"], (int)root["leds"][count]["green"], (int)root["leds"][count]["blue"])); }