This commit is contained in:
Lovro Oreskovic 2025-12-20 11:20:30 +00:00 committed by GitHub
commit 51bd1b1eac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -3422,7 +3422,7 @@ pin:
# Neopixel is connected to the pin).
#color_order: GRB
# Set the pixel order required by the LED hardware (using a string
# containing the letters R, G, B, W with W optional). Alternatively,
# containing the letters R, G, B, W). Alternatively,
# this may be a comma separated list of pixel orders - one for each
# LED in the chain. The default is GRB.
#initial_RED: 0.0

View file

@ -33,7 +33,7 @@ class PrinterNeoPixel:
raise config.error("color_order does not match chain_count")
color_indexes = []
for lidx, co in enumerate(color_order):
if sorted(co) not in (sorted("RGB"), sorted("RGBW")):
if any(c not in "RGBW" for c in co):
raise config.error("Invalid color_order '%s'" % (co,))
color_indexes.extend([(lidx, "RGBW".index(c)) for c in co])
self.color_map = list(enumerate(color_indexes))