Open drhideg opened 1 year ago
This is intentional as presets have no function while in live mode. Though...
If you select to apply live mode only on main segment then your observation is correct, preset should be applied. The problem in such case is that preset may change segment set-up (change main segment, length, etc) which could break live mode functionality.
So, best i can do is to maintain a fork/local copy, and let the wled.cpp as is, but add a call for handlePresets()
after each applyPreset([...])
in button.cpp ?
@@ -22,6 +22,8 @@@@ void shortPressAction(uint8_t b)
}
} else {
applyPreset(macroButton[b], CALL_MODE_BUTTON_PRESET);
+ handlePresets();
+ yield();
}
// publish MQTT message
@@ -41,6 +43,8 @@@@ void longPressAction(uint8_t b)
}
} else {
applyPreset(macroLongPress[b], CALL_MODE_BUTTON_PRESET);
+ handlePresets();
+ yield();
}
// publish MQTT message
@@ -60,6 +64,8 @@@@ void doublePressAction(uint8_t b)
}
} else {
applyPreset(macroDoublePress[b], CALL_MODE_BUTTON_PRESET);
+ handlePresets();
+ yield();
}
// publish MQTT message
What you do in your local fork is completely up to you. I cannot suggest anything as it would be wrong. Your issue will stay open as a reminder if at some point good idea comes around.
What happened?
I have d1 mini with pushbutton configured as
Button 1
onGPIO0
in interface. I set this because i like the internal brighness setting on long press. The short and double press configured over presets. The presets not handled while in live mode and the buttons looks like do not work as they should. I can make it work if i move https://github.com/Aircoookie/WLED/blob/98138a02e3feae68abd8ed571c3863978f131e50/wled00/wled.cpp#L104 before the conditionals https://github.com/Aircoookie/WLED/blob/98138a02e3feae68abd8ed571c3863978f131e50/wled00/wled.cpp#L84To Reproduce Bug
Wire a button and configure preset (ex-macro).
Expected Behavior
Buttons must always work.
Install Method
Self-Compiled
What version of WLED?
v0.14.0-b0 "Hoshi" (build 2211261)
Which microcontroller/board are you seeing the problem on?
ESP8266
Relevant log/trace output
No response
Anything else?
Config:
Presets:
Code of Conduct