Skip to content

Commit

Permalink
Fix LED ID checks
Browse files Browse the repository at this point in the history
  • Loading branch information
gbaman authored and thinkl33t committed Jun 2, 2024
1 parent dbfce9a commit 180eb36
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/lib/simple_tildagon.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ def _setup_leds():

@staticmethod
def set(led_number, state):
if not isinstance(led_number, int) or led_number < 0 or led_number > 7:
raise ValueError("led_number must be an integer between 0 and 7")
if not isinstance(led_number, int) or led_number < 1 or led_number > 12:
raise ValueError("led_number must be an integer between 1 and 12")

# TODO : Ideally shouldn't need to run _setup_leds each use of set_led
led._setup_leds()

tildagonos.leds[led_number] = state
tildagonos.leds[led_number-1] = state
tildagonos.leds.write()


Expand Down

0 comments on commit 180eb36

Please sign in to comment.