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:
Stephan Hadinger 2020-12-27 14:13:23 +01:00
parent 90ad1666e0
commit 51d39798d4
2 changed files with 5 additions and 1 deletions

View File

@ -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(); }
}

View File

@ -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 "\":["));