Skip to content

Commit

Permalink
autosave fix: moved stateChanged to a better location wled#218
Browse files Browse the repository at this point in the history
Moved the additional `stateChanged = true` to a better location.
Only enable the code when compiling with Autosave usermod - There is a risk that the fix triggers unnecessary WS broadcasts . stateChanged forces stateUpdated() which calls applyFinalBri() ...
  • Loading branch information
softhack007 committed Jul 27, 2022
1 parent 1fbea5f commit dd214f9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion wled00/led.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,15 @@ void applyBri() {
if (!realtimeMode || !arlsForceMaxBri)
{
strip.setBrightness(scaledBri(briT));
stateChanged = true; //WLEDSR temporary fix, until solved in upstream
}
}


//applies global brightness and sets it as the "current" brightness (no transition)
void applyFinalBri() {
#ifdef USERMOD_AUTO_SAVE //WLEDSR - make autosave mod happy. A bit dangerous, as it may trigger unnecessary WS broadcasts (and other notificatios)
if (briOld != bri) stateChanged = true; //WLEDSR temporary fix, until solved in upstream
#endif
briOld = bri;
briT = bri;
applyBri();
Expand Down

0 comments on commit dd214f9

Please sign in to comment.