Add *args to the LEDBoard on(), off() and toggle() methods.

Implements #125
This commit is contained in:
Andrew Scheller
2016-02-10 13:23:53 +00:00
parent 05560f64c7
commit 0089b5225c

View File

@@ -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(