Merge pull request #1786 from DerFetzer/fix_fx_sync
Send notification for HTTP API calls with only effects parameters
This commit is contained in:
commit
eee2450c9e
@ -101,7 +101,7 @@ void colorUpdated(int callMode)
|
|||||||
//Notifier: apply received FX to selected segments only if actually receiving FX
|
//Notifier: apply received FX to selected segments only if actually receiving FX
|
||||||
if (someSel) strip.applyToAllSelected = receiveNotificationEffects;
|
if (someSel) strip.applyToAllSelected = receiveNotificationEffects;
|
||||||
|
|
||||||
bool fxChanged = strip.setEffectConfig(effectCurrent, effectSpeed, effectIntensity, effectPalette);
|
bool fxChanged = strip.setEffectConfig(effectCurrent, effectSpeed, effectIntensity, effectPalette) || effectChanged;
|
||||||
bool colChanged = colorChanged();
|
bool colChanged = colorChanged();
|
||||||
|
|
||||||
//Notifier: apply received color to selected segments only if actually receiving color
|
//Notifier: apply received color to selected segments only if actually receiving color
|
||||||
@ -109,6 +109,7 @@ void colorUpdated(int callMode)
|
|||||||
|
|
||||||
if (fxChanged || colChanged)
|
if (fxChanged || colChanged)
|
||||||
{
|
{
|
||||||
|
effectChanged = false;
|
||||||
if (realtimeTimeout == UINT32_MAX) realtimeTimeout = 0;
|
if (realtimeTimeout == UINT32_MAX) realtimeTimeout = 0;
|
||||||
if (isPreset) {isPreset = false;}
|
if (isPreset) {isPreset = false;}
|
||||||
else {currentPreset = -1;}
|
else {currentPreset = -1;}
|
||||||
|
@ -812,10 +812,22 @@ bool handleSet(AsyncWebServerRequest *request, const String& req, bool apply)
|
|||||||
{
|
{
|
||||||
WS2812FX::Segment& seg = strip.getSegment(i);
|
WS2812FX::Segment& seg = strip.getSegment(i);
|
||||||
if (!seg.isSelected()) continue;
|
if (!seg.isSelected()) continue;
|
||||||
if (effectCurrent != prevEffect) seg.mode = effectCurrent;
|
if (effectCurrent != prevEffect) {
|
||||||
if (effectSpeed != prevSpeed) seg.speed = effectSpeed;
|
seg.mode = effectCurrent;
|
||||||
if (effectIntensity != prevIntensity) seg.intensity = effectIntensity;
|
effectChanged = true;
|
||||||
if (effectPalette != prevPalette) seg.palette = effectPalette;
|
}
|
||||||
|
if (effectSpeed != prevSpeed) {
|
||||||
|
seg.speed = effectSpeed;
|
||||||
|
effectChanged = true;
|
||||||
|
}
|
||||||
|
if (effectIntensity != prevIntensity) {
|
||||||
|
seg.intensity = effectIntensity;
|
||||||
|
effectChanged = true;
|
||||||
|
}
|
||||||
|
if (effectPalette != prevPalette) {
|
||||||
|
seg.palette = effectPalette;
|
||||||
|
effectChanged = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (col0Changed) {
|
if (col0Changed) {
|
||||||
|
@ -425,6 +425,7 @@ WLED_GLOBAL byte effectCurrent _INIT(0);
|
|||||||
WLED_GLOBAL byte effectSpeed _INIT(128);
|
WLED_GLOBAL byte effectSpeed _INIT(128);
|
||||||
WLED_GLOBAL byte effectIntensity _INIT(128);
|
WLED_GLOBAL byte effectIntensity _INIT(128);
|
||||||
WLED_GLOBAL byte effectPalette _INIT(0);
|
WLED_GLOBAL byte effectPalette _INIT(0);
|
||||||
|
WLED_GLOBAL bool effectChanged _INIT(false);
|
||||||
|
|
||||||
// network
|
// network
|
||||||
WLED_GLOBAL bool udpConnected _INIT(false), udp2Connected _INIT(false), udpRgbConnected _INIT(false);
|
WLED_GLOBAL bool udpConnected _INIT(false), udp2Connected _INIT(false), udpRgbConnected _INIT(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user