Hide LEDs with leading underscores (#1145)

This commit is contained in:
Chad Condon 2023-10-15 06:45:18 -07:00 committed by GitHub
parent a84b91a40b
commit 422363ebb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -273,11 +273,12 @@ class Printer:
return data return data
def get_leds(self): def get_leds(self):
leds = [] return [
led_types = ["dotstar", "led", "neopixel", "pca9533", "pca9632"] led
for led_type in led_types: for led_type in ["dotstar", "led", "neopixel", "pca9533", "pca9632"]
leds.extend(iter(self.get_config_section_list(f"{led_type} "))) for led in self.get_config_section_list(f"{led_type} ")
return leds if not led.split()[1].startswith("_")
]
def get_led_color_order(self, led): def get_led_color_order(self, led):
if led not in self.config or led not in self.data: if led not in self.config or led not in self.data: