Skip to content

Commit

Permalink
fix: turn off led when inactive
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesmitty committed Sep 12, 2024
1 parent 15d9493 commit 81dfc89
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions firmware/charger-module/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,10 @@ def set_voltage(self, voltage, pps=False):
if pps:
pattern = self.PULSE
self.set_pattern(pattern)
if voltage <= 6:
self.set_color(RED)
if voltage <= 1:
self.set_color(BLACK)
elif voltage <= 6:
self.set_color(ORANGE)
elif voltage <= 11:
self.set_color(YELLOW)
elif voltage <= 12:
Expand All @@ -454,7 +456,7 @@ def set_voltage(self, voltage, pps=False):
elif voltage > 16:
self.set_color(WHITE)
else:
self.set_color(BLACK)
self.set_color(RED)

def set_color(self, new_color):
logger.debug(f"Setting color to {new_color}")
Expand Down

0 comments on commit 81dfc89

Please sign in to comment.