mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 18:56:38 +00:00
Save some bytes
This commit is contained in:
parent
b32a093c0c
commit
9ae7b86efc
@ -2156,13 +2156,11 @@ void CmndSwitchMode(void) {
|
||||
Settings->switchmode[i] = XdrvMailbox.payload;
|
||||
}
|
||||
}
|
||||
char stemp[MAX_SWITCHES_SET * 4];
|
||||
stemp[0] = '\0';
|
||||
Response_P(PSTR("{\"%s\":["), XdrvMailbox.command);
|
||||
for (uint32_t i = 0; i < MAX_SWITCHES_SET; i++) {
|
||||
snprintf_P(stemp, sizeof(stemp), PSTR("%s%s%d" ), stemp, (i > 0 ? "," : "["), Settings->switchmode[i]);
|
||||
ResponseAppend_P(PSTR("%s%d"), (i>0)?",":"", Settings->switchmode[i]);
|
||||
}
|
||||
strcat(stemp, "]");
|
||||
Response_P(S_JSON_COMMAND_XVALUE, XdrvMailbox.command, stemp);
|
||||
ResponseAppend_P(PSTR("]}"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3631,10 +3631,9 @@ void CmndWebColor(void)
|
||||
#endif // FIRMWARE_MINIMAL
|
||||
}
|
||||
}
|
||||
Response_P(PSTR("{\"" D_CMND_WEBCOLOR "\":["));
|
||||
Response_P(PSTR("{\"%s\":["), XdrvMailbox.command);
|
||||
for (uint32_t i = 0; i < COL_LAST; i++) {
|
||||
if (i) { ResponseAppend_P(PSTR(",")); }
|
||||
ResponseAppend_P(PSTR("\"#%06x\""), WebColor(i));
|
||||
ResponseAppend_P(PSTR("%s\"#%06x\""), (i>0)?",":"", WebColor(i));
|
||||
}
|
||||
ResponseAppend_P(PSTR("]}"));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user