diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 30e5f3bc..0a8e61e8 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -45,7 +45,7 @@ body: attributes: 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" - placeholder: "e.g. WLED 0.13.0-b4 (build 2110110)" + placeholder: "e.g. WLED 0.13.0-b7 (build 2202222)" validations: required: true - type: dropdown diff --git a/CHANGELOG.md b/CHANGELOG.md index edd24cb7..ac52339f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ### Builds after release 0.12.0 +#### Build 2202222 + +- Version bump to 0.13.0-b7 "Toki" +- Fixed HTTP API commands not applying to all selected segments in some conditions +- Blynk support is not compiled in by default on ESP32 builds + #### Build 2202210 - Fixed HTTP API commands not applying to all selected segments if called from JSON diff --git a/package-lock.json b/package-lock.json index babeeda2..8f4014f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "wled", - "version": "0.13.0-b6", + "version": "0.13.0-b7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8e00d8cf..cc8b38b2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wled", - "version": "0.13.0-b6", + "version": "0.13.0-b7", "description": "Tools for WLED project", "main": "tools/cdata.js", "directories": { diff --git a/platformio.ini b/platformio.ini index 121d7527..7bbec9f8 100644 --- a/platformio.ini +++ b/platformio.ini @@ -35,6 +35,7 @@ default_envs = nodemcuv2, esp8266_2m, esp01_1m_full, esp32dev, esp32_eth, esp32s ; default_envs = wemos_shield_esp32 ; default_envs = m5atom ; default_envs = esp32_eth +; default_envs = esp32_eth_ota1mapp ; default_envs = esp32s2_saola src_dir = ./wled00 @@ -318,7 +319,7 @@ lib_deps = ${esp8266.lib_deps} board = esp32dev platform = ${esp32.platform} build_unflags = ${common.build_unflags} -build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32 #-D WLED_DISABLE_BROWNOUT_DET +build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32 -D WLED_DISABLE_BLYNK #-D WLED_DISABLE_BROWNOUT_DET lib_deps = ${esp32.lib_deps} monitor_filters = esp32_exception_decoder board_build.partitions = ${esp32.default_partitions} @@ -332,6 +333,11 @@ build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32_Ethernet -D lib_deps = ${esp32.lib_deps} board_build.partitions = ${esp32.default_partitions} +# ESP32 ETH build that fits in old 1M app space (disables Blynk, Cronixie, and Hue sync) +[env:esp32_eth_ota1mapp] +extends = env:esp32_eth +build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32_Ethernet_OTA -D RLYPIN=-1 -D WLED_USE_ETHERNET -D BTNPIN=-1 -D WLED_DISABLE_BLYNK -D WLED_DISABLE_CRONIXIE -D WLED_DISABLE_HUESYNC + [env:esp32s2_saola] board = esp32-s2-saola-1 platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.2.2/platform-tasmota-espressif32-2.0.2.zip diff --git a/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.h b/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.h index 5954eff7..4629f547 100644 --- a/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.h +++ b/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.h @@ -468,7 +468,7 @@ public: void lampUdated() { //call for notifier -> 0: init 1: direct change 2: button 3: notification 4: nightlight 5: other (No notification) // 6: fx changed 7: hue 8: preset cycle 9: blynk 10: alexa - //setValuesFromMainSeg(); //to make transition work on main segment (should no longer be required) + //setValuesFromFirstSelectedSeg(); //to make transition work on main segment (should no longer be required) stateUpdated(CALL_MODE_BUTTON); updateInterfaces(CALL_MODE_BUTTON); } diff --git a/wled00/FX.h b/wled00/FX.h index d92967f3..129bd92e 100644 --- a/wled00/FX.h +++ b/wled00/FX.h @@ -622,6 +622,7 @@ class WS2812FX { setMode(uint8_t segid, uint8_t m), setColor(uint8_t slot, uint8_t r, uint8_t g, uint8_t b, uint8_t w = 0), setColor(uint8_t slot, uint32_t c), + setCCT(uint16_t k), setBrightness(uint8_t b), setRange(uint16_t i, uint16_t i2, uint32_t col), setShowCallback(show_callback cb), @@ -660,6 +661,7 @@ class WS2812FX { getPaletteCount(void), getMaxSegments(void), getActiveSegmentsNum(void), + getFirstSelectedSegId(void), getMainSegmentId(void), getLastActiveSegmentId(void), getTargetFps(void), @@ -689,11 +691,11 @@ class WS2812FX { currentColor(uint32_t colorNew, uint8_t tNr), gamma32(uint32_t), getLastShow(void), - getPixelColor(uint16_t), - getColor(void); + getPixelColor(uint16_t); WS2812FX::Segment &getSegment(uint8_t n), + &getFirstSelectedSeg(void), &getMainSegment(void); WS2812FX::Segment* diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index ccc0f6e7..93538938 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -409,6 +409,15 @@ void WS2812FX::setColor(uint8_t slot, uint32_t c) { } } +void WS2812FX::setCCT(uint16_t k) { + for (uint8_t i = 0; i < MAX_NUM_SEGMENTS; i++) + { + if (_segments[i].isActive() && _segments[i].isSelected()) { + _segments[i].setCCT(k, i); + } + } +} + void WS2812FX::setBrightness(uint8_t b) { if (gammaCorrectBri) b = gamma8(b); if (_brightness == b) return; @@ -431,18 +440,19 @@ uint8_t WS2812FX::getMaxSegments(void) { return MAX_NUM_SEGMENTS; } -void WS2812FX::setMainSegmentId(uint8_t n) { - if (n >= MAX_NUM_SEGMENTS) return; - if (_segments[n].isActive() && _segments[n].isSelected()) { - _mainSegment = n; return; - } +uint8_t WS2812FX::getFirstSelectedSegId(void) +{ for (uint8_t i = 0; i < MAX_NUM_SEGMENTS; i++) { - if (_segments[i].isActive() && _segments[i].isSelected()) { - _mainSegment = i; return; - } + if (_segments[i].isActive() && _segments[i].isSelected()) return i; } - //if none selected, use supplied n if active, or first active + // if none selected, use the main segment + return getMainSegmentId(); +} + +void WS2812FX::setMainSegmentId(uint8_t n) { + if (n >= MAX_NUM_SEGMENTS) return; + //use supplied n if active, or first active if (_segments[n].isActive()) { _mainSegment = n; return; } @@ -476,10 +486,6 @@ uint8_t WS2812FX::getActiveSegmentsNum(void) { return c; } -uint32_t WS2812FX::getColor(void) { - return _segments[getMainSegmentId()].colors[0]; -} - uint32_t WS2812FX::getPixelColor(uint16_t i) { i = realPixelIndex(i); @@ -501,6 +507,10 @@ WS2812FX::Segment& WS2812FX::getSegment(uint8_t id) { return _segments[id]; } +WS2812FX::Segment& WS2812FX::getFirstSelectedSeg(void) { + return _segments[getFirstSelectedSegId()]; +} + WS2812FX::Segment& WS2812FX::getMainSegment(void) { return _segments[getMainSegmentId()]; } @@ -629,7 +639,7 @@ void WS2812FX::setSegment(uint8_t n, uint16_t i1, uint16_t i2, uint8_t grouping, delete[] seg.name; seg.name = nullptr; } - //if main segment is deleted, set first selected/active as main segment + // if main segment is deleted, set first active as main segment if (n == _mainSegment) setMainSegmentId(0); return; } diff --git a/wled00/alexa.cpp b/wled00/alexa.cpp index 8f04f016..e41b7e3f 100644 --- a/wled00/alexa.cpp +++ b/wled00/alexa.cpp @@ -72,36 +72,32 @@ void onAlexaChange(EspalexaDevice* dev) { if (espalexaDevice->getColorMode() == EspalexaColorMode::ct) //shade of white { + byte rgbw[4]; uint16_t ct = espalexaDevice->getCt(); if (!ct) return; uint16_t k = 1000000 / ct; //mireds to kelvin if (strip.hasCCTBus()) { - uint8_t segid = strip.getMainSegmentId(); - WS2812FX::Segment& seg = strip.getSegment(segid); - seg.setCCT(k, segid); - col[0]= 0; col[1]= 0; col[2]= 0; col[3]= 255; + strip.setCCT(k); + rgbw[0]= 0; rgbw[1]= 0; rgbw[2]= 0; rgbw[3]= 255; } else if (strip.hasWhiteChannel()) { switch (ct) { //these values empirically look good on RGBW - case 199: col[0]=255; col[1]=255; col[2]=255; col[3]=255; break; - case 234: col[0]=127; col[1]=127; col[2]=127; col[3]=255; break; - case 284: col[0]= 0; col[1]= 0; col[2]= 0; col[3]=255; break; - case 350: col[0]=130; col[1]= 90; col[2]= 0; col[3]=255; break; - case 383: col[0]=255; col[1]=153; col[2]= 0; col[3]=255; break; - default : colorKtoRGB(k, col); + case 199: rgbw[0]=255; rgbw[1]=255; rgbw[2]=255; rgbw[3]=255; break; + case 234: rgbw[0]=127; rgbw[1]=127; rgbw[2]=127; rgbw[3]=255; break; + case 284: rgbw[0]= 0; rgbw[1]= 0; rgbw[2]= 0; rgbw[3]=255; break; + case 350: rgbw[0]=130; rgbw[1]= 90; rgbw[2]= 0; rgbw[3]=255; break; + case 383: rgbw[0]=255; rgbw[1]=153; rgbw[2]= 0; rgbw[3]=255; break; + default : colorKtoRGB(k, rgbw); } } else { - colorKtoRGB(k, col); + colorKtoRGB(k, rgbw); } + strip.setColor(0, rgbw[0], rgbw[1], rgbw[2], rgbw[3]); } else { uint32_t color = espalexaDevice->getRGB(); - - col[0] = ((color >> 16) & 0xFF); - col[1] = ((color >> 8) & 0xFF); - col[2] = ( color & 0xFF); - col[3] = 0; + strip.setColor(0, color); } - colorUpdated(CALL_MODE_ALEXA); + stateUpdated(CALL_MODE_ALEXA); } } diff --git a/wled00/fcn_declare.h b/wled00/fcn_declare.h index fae99a3c..a91f00b7 100644 --- a/wled00/fcn_declare.h +++ b/wled00/fcn_declare.h @@ -144,7 +144,7 @@ bool serveLiveLeds(AsyncWebServerRequest* request, uint32_t wsClient = 0); #endif //led.cpp -void setValuesFromMainSeg(); +void setValuesFromFirstSelectedSeg(); void resetTimebase(); void toggleOnOff(); void applyBri(); diff --git a/wled00/html_other.h b/wled00/html_other.h index 65b2139c..72a0b224 100644 --- a/wled00/html_other.h +++ b/wled00/html_other.h @@ -42,7 +42,7 @@ function B(){window.history.back()}function U(){document.getElementById("uf").st .bt{background:#333;color:#fff;font-family:Verdana,sans-serif;border:.3ch solid #333;display:inline-block;font-size:20px;margin:8px;margin-top:12px}input[type=file]{font-size:16px}body{font-family:Verdana,sans-serif;text-align:center;background:#222;color:#fff;line-height:200%}#msg{display:none}