I’ve added a publication of button click state (short, long, double) over mqtt in button.cpp in /btn topic of 3 constant define in const.h.
My wled project is my bedside lamp included in my domotic to gently wake me up, and I need to send the button click to my domo system to manage my alarm clock.
As an exercice, I’m trying to add a custom setting in the sync page.
No pb with html in setting.h :
Send Button State over MQTT : \<input type="checkbox" name="BTM"><br>
i’ve added a variable in wled.h :
WLED_GLOBAL bool buttonMQTTEnabled _INIT(false);
in xml.cpp :
and in wled_eeprom.cpp
just before the commit();
buttonMQTTEnabled = EEPROM.read(2600);
just below the reading for mqttEnabled.
In the web interface, there is now a brand new checkbox setting, I’m able to save it with the “save” button and the sketch in my modified “button.cpp” is able to handle it.
But when I reboot the esp, I’m back to the initialisation of that var.
I know some of that shouldn’t be of good practice, and i’m pretty sure i do not understand all i’ve added here, it’s just an exercise
but How to save this setting more consistently and permanently ?
My device : wemos D1 mini 4M, RGBW adressable led strip.