Skip to content

Commit

Permalink
Added is_led_on to Yukon
Browse files Browse the repository at this point in the history
  • Loading branch information
ZodiusInfuser committed Nov 7, 2023
1 parent 8eeb8e2 commit 335a2ad
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/pimoroni_yukon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,16 @@ def set_led(self, switch, value):

self.__leds[switch].value(value)

def is_led_on(self, switch):
if switch is self.SWITCH_A_NAME:
switch = self.SWITCH_A
elif switch is self.SWITCH_B_NAME:
switch = self.SWITCH_B
elif switch < 0 or switch > 1:
raise ValueError("switch out of range. Expected 'A' or 'B', or SWITCH_A (0) or SWITCH_B (1)")

return self.__leds[switch].value() == 1

def enable_main_output(self):
if self.is_main_output_enabled() is False:
logging.info("> Checking input voltage ...")
Expand Down

0 comments on commit 335a2ad

Please sign in to comment.