mirror of https://github.com/arendst/Tasmota.git
Reduce tasmota-minmal
Making `WebColor` and `Template` commands read-only Saves 4kb on tasmota-minimal. No changes for other versions.
This commit is contained in:
parent
90ad1666e0
commit
51d39798d4
|
@ -1284,12 +1284,14 @@ void CmndTemplate(void)
|
|||
}
|
||||
}
|
||||
else {
|
||||
if (JsonTemplate(XdrvMailbox.data)) { // Free 336 bytes StaticJsonBuffer stack space by moving code to function
|
||||
#ifndef FIRMWARE_MINIMAL // if tasmota-minimal, `Template` is read-only
|
||||
if (JsonTemplate(XdrvMailbox.data)) {
|
||||
if (USER_MODULE == Settings.module) { TasmotaGlobal.restart_flag = 2; }
|
||||
} else {
|
||||
ResponseCmndChar_P(PSTR(D_JSON_INVALID_JSON));
|
||||
error = true;
|
||||
}
|
||||
#endif // FIRMWARE_MINIMAL
|
||||
}
|
||||
if (!error) { TemplateJson(); }
|
||||
}
|
||||
|
|
|
@ -3401,7 +3401,9 @@ void CmndWebColor(void)
|
|||
}
|
||||
}
|
||||
else {
|
||||
#ifndef FIRMWARE_MINIMAL // if tasmota-minimal, read only and don't parse JSON
|
||||
JsonWebColor(XdrvMailbox.data);
|
||||
#endif // FIRMWARE_MINIMAL
|
||||
}
|
||||
}
|
||||
Response_P(PSTR("{\"" D_CMND_WEBCOLOR "\":["));
|
||||
|
|
Loading…
Reference in New Issue