From 2c5eba335f74c13351efea3a6b9e20e6b995cd9c Mon Sep 17 00:00:00 2001 From: cschwinne Date: Wed, 26 Jan 2022 13:26:57 +0100 Subject: [PATCH] Added white channel to Peek (closes #1716) --- CHANGELOG.md | 7 +++++++ wled00/json.cpp | 6 +++++- wled00/wled.h | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2ef83e6..d83f625f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ ### Builds after release 0.12.0 +#### Build 2201260 + +- Initial ESP32-C3 and ESP32-S2 support (PRs #2452, ) +- Full segment sync (PR #2427) +- Allow overriding of color order by ranges (PR #2463) +- Added white channel to Peek + #### Build 2112080 - Version bump to 0.13.0-b6 "Toki" diff --git a/wled00/json.cpp b/wled00/json.cpp index 4dad36a0..06a526f6 100644 --- a/wled00/json.cpp +++ b/wled00/json.cpp @@ -909,7 +909,11 @@ bool serveLiveLeds(AsyncWebServerRequest* request, uint32_t wsClient) for (uint16_t i= 0; i < used; i += n) { - olen += sprintf(obuf + olen, "\"%06X\",", strip.getPixelColor(i) & 0xFFFFFF); + uint32_t c = strip.getPixelColor(i); + uint8_t r = qadd8(W(c), R(c)); //add white channel to RGB channels as a simple RGBW -> RGB map + uint8_t g = qadd8(W(c), G(c)); + uint8_t b = qadd8(W(c), B(c)); + olen += sprintf(obuf + olen, "\"%06X\",", RGBW32(r,g,b,0)); } olen -= 1; oappend((const char*)F("],\"n\":")); diff --git a/wled00/wled.h b/wled00/wled.h index f172cb0a..281562c4 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2112080 +#define VERSION 2201260 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG