mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-24 19:26:37 +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;
|
Settings->switchmode[i] = XdrvMailbox.payload;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
char stemp[MAX_SWITCHES_SET * 4];
|
Response_P(PSTR("{\"%s\":["), XdrvMailbox.command);
|
||||||
stemp[0] = '\0';
|
|
||||||
for (uint32_t i = 0; i < MAX_SWITCHES_SET; i++) {
|
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, "]");
|
ResponseAppend_P(PSTR("]}"));
|
||||||
Response_P(S_JSON_COMMAND_XVALUE, XdrvMailbox.command, stemp);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3631,10 +3631,9 @@ void CmndWebColor(void)
|
|||||||
#endif // FIRMWARE_MINIMAL
|
#endif // FIRMWARE_MINIMAL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Response_P(PSTR("{\"" D_CMND_WEBCOLOR "\":["));
|
Response_P(PSTR("{\"%s\":["), XdrvMailbox.command);
|
||||||
for (uint32_t i = 0; i < COL_LAST; i++) {
|
for (uint32_t i = 0; i < COL_LAST; i++) {
|
||||||
if (i) { ResponseAppend_P(PSTR(",")); }
|
ResponseAppend_P(PSTR("%s\"#%06x\""), (i>0)?",":"", WebColor(i));
|
||||||
ResponseAppend_P(PSTR("\"#%06x\""), WebColor(i));
|
|
||||||
}
|
}
|
||||||
ResponseAppend_P(PSTR("]}"));
|
ResponseAppend_P(PSTR("]}"));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user