mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2025-10-29 17:50:37 +00:00
Add *args to the LEDBoard on(), off() and toggle() methods.
Implements #125
This commit is contained in:
@@ -173,16 +173,28 @@ class LEDBoard(LEDCollection):
|
||||
self._stop_blink()
|
||||
super(LEDBoard, self).close()
|
||||
|
||||
def on(self):
|
||||
def on(self, *args):
|
||||
self._stop_blink()
|
||||
if args:
|
||||
for index in args:
|
||||
self[index].on()
|
||||
else:
|
||||
super(LEDBoard, self).on()
|
||||
|
||||
def off(self):
|
||||
def off(self, *args):
|
||||
self._stop_blink()
|
||||
if args:
|
||||
for index in args:
|
||||
self[index].off()
|
||||
else:
|
||||
super(LEDBoard, self).off()
|
||||
|
||||
def toggle(self):
|
||||
def toggle(self, *args):
|
||||
self._stop_blink()
|
||||
if args:
|
||||
for index in args:
|
||||
self[index].toggle()
|
||||
else:
|
||||
super(LEDBoard, self).toggle()
|
||||
|
||||
def blink(
|
||||
|
||||
Reference in New Issue
Block a user