Save a bit of RAM and flash.
This commit is contained in:
parent
59ce88f044
commit
d7dac57a07
@ -664,19 +664,10 @@ void decodeIRJson(uint32_t code)
|
||||
}
|
||||
} else {
|
||||
// HTTP API command
|
||||
if (cmdStr.indexOf("~") || fdo["rpt"])
|
||||
{
|
||||
// repeatable action
|
||||
lastValidCode = code;
|
||||
}
|
||||
if (effectCurrent == 0 && cmdStr.indexOf("FP=") > -1) {
|
||||
// setting palette but it wont show because effect is solid
|
||||
effectCurrent = FX_MODE_GRADIENT;
|
||||
}
|
||||
if (!cmdStr.startsWith("win&")) {
|
||||
cmdStr = "win&" + cmdStr;
|
||||
}
|
||||
fdo.clear(); //clear JSON buffer (it is no longer needed)
|
||||
String apireq = "win"; apireq += '&'; // reduce flash string usage
|
||||
if (cmdStr.indexOf("~") || fdo["rpt"]) lastValidCode = code; // repeatable action
|
||||
if (!cmdStr.startsWith(apireq)) cmdStr = apireq + cmdStr; // if no "win&" prefix
|
||||
fdo.clear(); // clear JSON buffer (it is no longer needed)
|
||||
handleSet(nullptr, cmdStr, false); // no colorUpdated() call here
|
||||
}
|
||||
} else {
|
||||
|
@ -365,7 +365,7 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId)
|
||||
//HTTP API commands
|
||||
const char* httpwin = root["win"];
|
||||
if (httpwin) {
|
||||
String apireq = "win&";
|
||||
String apireq = "win"; apireq += '&'; // reduce flash string usage
|
||||
apireq += httpwin;
|
||||
handleSet(nullptr, apireq, false);
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ void onMqttMessage(char* topic, char* payload, AsyncMqttClientMessageProperties
|
||||
deserializeJson(doc, payloadStr);
|
||||
deserializeState(doc.as<JsonObject>());
|
||||
} else { //HTTP API
|
||||
String apireq = "win&";
|
||||
String apireq = "win"; apireq += '&'; // reduce flash string usage
|
||||
apireq += (char*)payloadStr;
|
||||
handleSet(nullptr, apireq);
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ void handlePresets()
|
||||
//HTTP API commands
|
||||
const char* httpwin = fdo["win"];
|
||||
if (httpwin) {
|
||||
String apireq = "win&";
|
||||
String apireq = "win"; apireq += '&'; // reduce flash string usage
|
||||
apireq += httpwin;
|
||||
handleSet(nullptr, apireq, false);
|
||||
} else {
|
||||
|
@ -514,7 +514,7 @@ void handleNotifications()
|
||||
|
||||
if (requestJSONBufferLock(18)) {
|
||||
if (udpIn[0] >= 'A' && udpIn[0] <= 'Z') { //HTTP API
|
||||
String apireq = "win&";
|
||||
String apireq = "win"; apireq += '&'; // reduce flash string usage
|
||||
apireq += (char*)udpIn;
|
||||
handleSet(nullptr, apireq);
|
||||
} else if (udpIn[0] == '{') { //JSON API
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
// version code in format yymmddb (b = daily build)
|
||||
#define VERSION 2202121
|
||||
#define VERSION 2202191
|
||||
|
||||
//uncomment this if you have a "my_config.h" file you'd like to use
|
||||
//#define WLED_USE_MY_CONFIG
|
||||
|
Loading…
Reference in New Issue
Block a user