Minor code optimizations.

This commit is contained in:
Blaz Kristan 2022-01-02 14:27:24 +01:00
parent 853463b7cd
commit e8b2d80037
2 changed files with 3 additions and 6 deletions

View File

@ -654,7 +654,7 @@ void setPaletteColors(JsonArray json, CRGBPalette16 palette)
for (int i = 0; i < 16; i++) {
JsonArray colors = json.createNestedArray();
CRGB color = palette[i];
colors.add((((float)i / (float)16) * 255));
colors.add(i<<4);
colors.add(color.red);
colors.add(color.green);
colors.add(color.blue);

View File

@ -168,11 +168,9 @@ void colorUpdated(int callMode)
void updateInterfaces(uint8_t callMode)
{
sendDataWs();
if (callMode == CALL_MODE_WS_SEND) {
lastInterfaceUpdate = millis();
return;
}
sendDataWs();
if (callMode == CALL_MODE_WS_SEND) return;
#ifndef WLED_DISABLE_ALEXA
if (espalexaDevice != nullptr && callMode != CALL_MODE_ALEXA) {
@ -185,7 +183,6 @@ void updateInterfaces(uint8_t callMode)
callMode != CALL_MODE_NO_NOTIFY) updateBlynk();
#endif
doPublishMqtt = true;
lastInterfaceUpdate = millis();
}