Skip to content
Snippets Groups Projects
Verified Commit d3bc8224 authored by TheJoeCoder's avatar TheJoeCoder
Browse files

Add env toggle for LED state

parent 6c112ec0
Branches
No related tags found
No related merge requests found
import os
from absled import ILedString
......@@ -7,6 +9,7 @@ class DummyLedString(ILedString):
self.location = location
self.leds = [(0, 0, 0)] * length
self.real_leds = [(0, 0, 0)] * length
self.log_led_state = os.environ.get("LOG_LED_STATE", 0) == 1
def set_led(self, color: tuple[int, int, int], index: int):
self.leds[index] = color
......@@ -26,4 +29,5 @@ class DummyLedString(ILedString):
def show(self):
self.real_leds = self.leds.copy()
if self.log_led_state:
print("LED State:", self.leds)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment