1
0
Эх сурвалжийг харах

Fix RGBW strips not using dedicated white LED

On RGBW strips (e.g. SK6812), setting color to #FFFFFF would only
illuminate the RGB LEDs to create mixed white, ignoring the dedicated
W LED. Add auto white balance calculation that extracts min(R,G,B)
as the W channel, matching WLED's "Accurate" white mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tuanchris 4 сар өмнө
parent
commit
06f128f365

+ 7 - 0
modules/led/dw_leds/segment.py

@@ -71,6 +71,13 @@ class Segment:
         b = get_b(color)
         if self.is_rgbw:
             w = get_w(color)
+            if w == 0 and (r > 0 and g > 0 and b > 0):
+                # Auto white balance: extract white component from RGB
+                # This uses the dedicated white LED for better color accuracy
+                w = min(r, g, b)
+                r -= w
+                g -= w
+                b -= w
             self.pixels[actual_idx] = (r, g, b, w)
         else:
             self.pixels[actual_idx] = (r, g, b)