Merge branch 'master' into master-merge

This commit is contained in:
Blaž Kristan 2022-03-15 09:55:23 +01:00
parent ac20d7f302
commit 0234017ca1
13 changed files with 73 additions and 27 deletions

View File

@ -45,7 +45,7 @@ body:
attributes: attributes:
label: What version of WLED? label: What version of WLED?
description: You can find this in by going to Config -> Security & Updates -> Scroll to Bottom. Copy and paste the entire line after "Server message" description: You can find this in by going to Config -> Security & Updates -> Scroll to Bottom. Copy and paste the entire line after "Server message"
placeholder: "e.g. WLED 0.13.0-b7 (build 2202222)" placeholder: "e.g. WLED 0.13.1 (build 2203150)"
validations: validations:
required: true required: true
- type: dropdown - type: dropdown

View File

@ -1,6 +1,28 @@
## WLED changelog ## WLED changelog
### Builds after release 0.12.0 ### WLED release 0.13.1
#### Build 2203150
- Version bump to v0.13.1 "Toki"
- Fix persistent preset bug, preventing save of new presets
### WLED release 0.13.0
#### Build 2203142
- Release of WLED v0.13.0 "Toki"
- Reduce APA102 hardware SPI frequency to 5Mhz
- Remove `persistent` parameter in `savePreset()`
### Builds between releases 0.12.0 and 0.13.0
#### Build 2203140
- Added factory reset by pressing button 0 for >10 seconds
- Added ability to set presets from DMX Effect mode
- Simplified label hiding JS in user interface
- Fixed JSON `{"live":true}` indefinite realtime mode
#### Build 2203080 #### Build 2203080

View File

@ -337,7 +337,7 @@ platform = ${esp32.platform}
platform_packages = ${esp32.platform_packages} platform_packages = ${esp32.platform_packages}
upload_speed = 921600 upload_speed = 921600
build_unflags = ${common.build_unflags} build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32_Ethernet -D RLYPIN=-1 -D WLED_USE_ETHERNET -D BTNPIN=-1 build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32_Ethernet -D RLYPIN=-1 -D WLED_USE_ETHERNET -D BTNPIN=-1 -D WLED_DISABLE_BLYNK
lib_deps = ${esp32.lib_deps} lib_deps = ${esp32.lib_deps}
board_build.partitions = ${esp32.default_partitions} board_build.partitions = ${esp32.default_partitions}

View File

@ -19,6 +19,11 @@ build_flags = ${common.build_flags_esp8266}
; *** Use custom settings from file my_config.h ; *** Use custom settings from file my_config.h
-DWLED_USE_MY_CONFIG -DWLED_USE_MY_CONFIG
; ********************************************************************* ; *********************************************************************
;
;
; *** To use the below defines/overrides, copy and paste each onto it's own line just below build_flags in the section above.
;
; disable specific features
; -D WLED_DISABLE_OTA ; -D WLED_DISABLE_OTA
; -D WLED_DISABLE_ALEXA ; -D WLED_DISABLE_ALEXA
; -D WLED_DISABLE_BLYNK ; -D WLED_DISABLE_BLYNK
@ -44,3 +49,15 @@ build_flags = ${common.build_flags_esp8266}
; for the Magic Home LED Controller use PWM pins 5,12,13,15 ; for the Magic Home LED Controller use PWM pins 5,12,13,15
; for the H801 controller use PINs 15,13,12,14 (W2 = 04) ; for the H801 controller use PINs 15,13,12,14 (W2 = 04)
; for the BW-LT11 controller use PINs 12,4,14,5 ; for the BW-LT11 controller use PINs 12,4,14,5
;
; set the name of the module - make sure there is a quote-backslash-quote before the name and a backslash-quote-quote after the name
; -D SERVERNAME="\"WLED\""
;
; set the number of LEDs
; -D DEFAULT_LED_COUNT=30
;
; set milliampere limit when using ESP pin to power leds
; -D ABL_MILLIAMPS_DEFAULT =850
;
; enable IR by setting remote type
; -D IRTYPE=0 //0 Remote disabled | 1 24-key RGB | 2 24-key with CT | 3 40-key blue | 4 40-key RGB | 5 21-key RGB | 6 6-key black | 7 9-key red | 8 JSON remote

View File

@ -64,8 +64,8 @@ class AutoSaveUsermod : public Usermod {
PSTR("~ %02d-%02d %02d:%02d:%02d ~"), PSTR("~ %02d-%02d %02d:%02d:%02d ~"),
month(localTime), day(localTime), month(localTime), day(localTime),
hour(localTime), minute(localTime), second(localTime)); hour(localTime), minute(localTime), second(localTime));
savePreset(autoSavePreset, true, presetNameBuffer);
cacheInvalidate++; // force reload of presets cacheInvalidate++; // force reload of presets
savePreset(autoSavePreset, presetNameBuffer);
} }
void inline displayOverlay() { void inline displayOverlay() {

View File

@ -65,7 +65,7 @@ void hourChime()
//strip.resetSegments(); //strip.resetSegments();
selectWordSegments(true); selectWordSegments(true);
colorUpdated(CALL_MODE_FX_CHANGED); colorUpdated(CALL_MODE_FX_CHANGED);
savePreset(13, false); //savePreset(255);
selectWordSegments(false); selectWordSegments(false);
//strip.getSegment(0).setOption(0, true); //strip.getSegment(0).setOption(0, true);
strip.getSegment(0).setOption(2, true); strip.getSegment(0).setOption(2, true);
@ -299,7 +299,7 @@ void userLoop()
if (minute(localTime) == 1){ if (minute(localTime) == 1){
//turn off background segment; //turn off background segment;
strip.getSegment(0).setOption(2, false); strip.getSegment(0).setOption(2, false);
//applyPreset(13); //applyPreset(255);
} }
} }
} }

View File

@ -133,7 +133,7 @@
#endif #endif
//APA102 //APA102
#define B_HS_DOT_3 NeoPixelBrightnessBus<DotStarBgrFeature, DotStarSpiMethod> //hardware SPI #define B_HS_DOT_3 NeoPixelBrightnessBus<DotStarBgrFeature, DotStarSpi5MhzMethod> //hardware SPI
#define B_SS_DOT_3 NeoPixelBrightnessBus<DotStarBgrFeature, DotStarMethod> //soft SPI #define B_SS_DOT_3 NeoPixelBrightnessBus<DotStarBgrFeature, DotStarMethod> //soft SPI
//LPD8806 //LPD8806

View File

@ -7,8 +7,9 @@
#define WLED_DEBOUNCE_THRESHOLD 50 // only consider button input of at least 50ms as valid (debouncing) #define WLED_DEBOUNCE_THRESHOLD 50 // only consider button input of at least 50ms as valid (debouncing)
#define WLED_LONG_PRESS 600 // long press if button is released after held for at least 600ms #define WLED_LONG_PRESS 600 // long press if button is released after held for at least 600ms
#define WLED_DOUBLE_PRESS 350 // double press if another press within 350ms after a short press #define WLED_DOUBLE_PRESS 350 // double press if another press within 350ms after a short press
#define WLED_LONG_REPEATED_ACTION 333 //how often a repeated action (e.g. dimming) is fired on long press on button IDs >0 #define WLED_LONG_REPEATED_ACTION 300 // how often a repeated action (e.g. dimming) is fired on long press on button IDs >0
#define WLED_LONG_AP 6000 //how long the button needs to be held to activate WLED-AP #define WLED_LONG_AP 5000 // how long button 0 needs to be held to activate WLED-AP
#define WLED_LONG_FACTORY_RESET 10000 // how long button 0 needs to be held to trigger a factory reset
static const char _mqtt_topic_button[] PROGMEM = "%s/button/%d"; // optimize flash usage static const char _mqtt_topic_button[] PROGMEM = "%s/button/%d"; // optimize flash usage
@ -237,12 +238,14 @@ void handleButton()
bool doublePress = buttonWaitTime[b]; //did we have a short press before? bool doublePress = buttonWaitTime[b]; //did we have a short press before?
buttonWaitTime[b] = 0; buttonWaitTime[b] = 0;
if (b == 0 && dur > 2*WLED_LONG_AP) { //very long press on button 0 (when released) if (b == 0 && dur > WLED_LONG_AP) { // long press on button 0 (when released)
if (dur > WLED_LONG_FACTORY_RESET) { // factory reset if pressed > 10 seconds
WLED_FS.format(); WLED_FS.format();
clearEEPROM(); clearEEPROM();
doReboot = true; doReboot = true;
} else if (b == 0 && dur > WLED_LONG_AP) { //long press on button 0 (when released) } else {
WLED::instance().initAP(true); WLED::instance().initAP(true);
}
} else if (!buttonLongPressed[b]) { //short press } else if (!buttonLongPressed[b]) { //short press
//NOTE: this interferes with double click handling in usermods so usermod needs to implement full button handling //NOTE: this interferes with double click handling in usermods so usermod needs to implement full button handling
if (b != 1 && !macroDoublePress[b]) { //don't wait for double press on buttons without a default action if no double press macro set if (b != 1 && !macroDoublePress[b]) { //don't wait for double press on buttons without a default action if no double press macro set

View File

@ -193,8 +193,8 @@ void handlePlaylist();
void handlePresets(); void handlePresets();
bool applyPreset(byte index, byte callMode = CALL_MODE_DIRECT_CHANGE, bool fromJson = false); bool applyPreset(byte index, byte callMode = CALL_MODE_DIRECT_CHANGE, bool fromJson = false);
inline bool applyTemporaryPreset() {return applyPreset(255);}; inline bool applyTemporaryPreset() {return applyPreset(255);};
void savePreset(byte index, bool persist = true, const char* pname = nullptr, JsonObject saveobj = JsonObject()); void savePreset(byte index, const char* pname = nullptr, JsonObject saveobj = JsonObject());
inline void saveTemporaryPreset() {savePreset(255, false);}; inline void saveTemporaryPreset() {savePreset(255);};
void deletePreset(byte index); void deletePreset(byte index);
//set.cpp //set.cpp

View File

@ -695,7 +695,7 @@ void decodeIRJson(uint32_t code)
char pname[33]; char pname[33];
sprintf_P(pname, PSTR("IR Preset %d"), psave); sprintf_P(pname, PSTR("IR Preset %d"), psave);
fdo.clear(); fdo.clear();
if (psave > 0 && psave < 251) savePreset(psave, true, pname, fdo); if (psave > 0 && psave < 251) savePreset(psave, pname, fdo);
} }
} }
releaseJSONBufferLock(); releaseJSONBufferLock();

View File

@ -335,7 +335,7 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId)
byte ps = root[F("psave")]; byte ps = root[F("psave")];
if (ps > 0) { if (ps > 0) {
DEBUG_PRINTLN(F("Saving preset")); DEBUG_PRINTLN(F("Saving preset"));
savePreset(ps, true, nullptr, root); savePreset(ps, nullptr, root);
} else { } else {
ps = root[F("pdel")]; //deletion ps = root[F("pdel")]; //deletion
if (ps > 0) { if (ps > 0) {

View File

@ -76,14 +76,14 @@ void handlePresets()
} }
//called from handleSet(PS=) [network callback (fileDoc==nullptr), IR (irrational), deserializeState, UDP] and deserializeState() [network callback (filedoc!=nullptr)] //called from handleSet(PS=) [network callback (fileDoc==nullptr), IR (irrational), deserializeState, UDP] and deserializeState() [network callback (filedoc!=nullptr)]
void savePreset(byte index, bool persist, const char* pname, JsonObject saveobj) void savePreset(byte index, const char* pname, JsonObject saveobj)
{ {
if (index == 0 || (index > 250 && persist) || (index<255 && !persist)) return; if (index == 0 || (index > 250 && index < 255)) return;
char tmp[12]; char tmp[12];
JsonObject sObj = saveobj; JsonObject sObj = saveobj;
bool bufferAllocated = false; bool bufferAllocated = false;
bool persist = (index != 255);
const char *filename = persist ? "/presets.json" : "/tmp.json"; const char *filename = persist ? "/presets.json" : "/tmp.json";
if (!fileDoc) { if (!fileDoc) {

View File

@ -8,7 +8,7 @@
*/ */
// version code in format yymmddb (b = daily build) // version code in format yymmddb (b = daily build)
#define VERSION 2203141 #define VERSION 2203151
//uncomment this if you have a "my_config.h" file you'd like to use //uncomment this if you have a "my_config.h" file you'd like to use
//#define WLED_USE_MY_CONFIG //#define WLED_USE_MY_CONFIG
@ -296,7 +296,11 @@ WLED_GLOBAL uint16_t transitionDelay _INIT(750); // default crossfade duratio
WLED_GLOBAL byte briMultiplier _INIT(100); // % of brightness to set (to limit power, if you set it to 50 and set bri to 255, actual brightness will be 127) WLED_GLOBAL byte briMultiplier _INIT(100); // % of brightness to set (to limit power, if you set it to 50 and set bri to 255, actual brightness will be 127)
// User Interface CONFIG // User Interface CONFIG
WLED_GLOBAL char serverDescription[33] _INIT("WLED"); // Name of module #ifndef SERVERNAME
WLED_GLOBAL char serverDescription[33] _INIT("WLED"); // Name of module - use default
#else
WLED_GLOBAL char serverDescription[33] _INIT(SERVERNAME); // use predefined name
#endif
WLED_GLOBAL bool syncToggleReceive _INIT(false); // UIs which only have a single button for sync should toggle send+receive if this is true, only send otherwise WLED_GLOBAL bool syncToggleReceive _INIT(false); // UIs which only have a single button for sync should toggle send+receive if this is true, only send otherwise
WLED_GLOBAL bool simplifiedUI _INIT(false); // enable simplified UI WLED_GLOBAL bool simplifiedUI _INIT(false); // enable simplified UI
WLED_GLOBAL byte cacheInvalidate _INIT(0); // used to invalidate browser cache when switching from regular to simplified UI WLED_GLOBAL byte cacheInvalidate _INIT(0); // used to invalidate browser cache when switching from regular to simplified UI