aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/neopixel.py
diff options
context:
space:
mode:
Diffstat (limited to 'klippy/extras/neopixel.py')
-rw-r--r--klippy/extras/neopixel.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/klippy/extras/neopixel.py b/klippy/extras/neopixel.py
index ef728fc2..b6daeb4d 100644
--- a/klippy/extras/neopixel.py
+++ b/klippy/extras/neopixel.py
@@ -33,12 +33,9 @@ class PrinterNeoPixel:
raise config.error("color_order does not match chain_count")
color_indexes = []
for lidx, co in enumerate(color_order):
- rgb = "RGB"
- if 'W' in co:
- rgb = "RGBW"
- if sorted(co) != sorted(rgb):
+ if sorted(co) not in (sorted("RGB"), sorted("RGBW")):
raise config.error("Invalid color_order '%s'" % (co,))
- color_indexes.extend([(lidx, rgb.index(c)) for c in co])
+ color_indexes.extend([(lidx, "RGBW".index(c)) for c in co])
self.color_map = list(enumerate(color_indexes))
if len(self.color_map) > MAX_MCU_SIZE:
raise config.error("neopixel chain too long")