From 3df061b1bdf643f33100953f35f85738a87b6e29 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Tue, 22 Sep 2015 15:05:11 +0100 Subject: [PATCH] Minor cleanup in boards super calls weren't specified correctly, and there's no need to convert to lists for adding tuples - tuples add to tuples just fine, just not lists. --- gpiozero/boards.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gpiozero/boards.py b/gpiozero/boards.py index a2c34f7..8710ecd 100644 --- a/gpiozero/boards.py +++ b/gpiozero/boards.py @@ -32,7 +32,7 @@ class FishDish(TrafficLights): super(FishDish, self).__init__(red, amber, green) self.buzzer = Buzzer(8) self.button = Button(pin=7, pull_up=False) - self._all = tuple(list(self._leds) + [self.buzzer]) + self._all = self._leds + (self.buzzer,) def on(self): for thing in self._all: @@ -43,10 +43,10 @@ class FishDish(TrafficLights): thing.off() def lights_on(self): - super.on() + super(FishDish, self).on() def lights_off(self): - super.off() + super(FishDish, self).off() class TrafficHat(FishDish): @@ -55,13 +55,13 @@ class TrafficHat(FishDish): super(PiTraffic, self).__init__(red, amber, green) self.buzzer = Buzzer(5) self.button = Button(25) - self._all = tuple(list(self._leds) + [self.buzzer]) + self._all = self._leds + (self.buzzer,) class PiLiter(object): def __init__(self): leds = (4, 17, 27, 18, 22, 23, 24, 25) - self._leds = tuple([LED(led) for led in leds]) + self._leds = tuple(LED(led) for led in leds) def on(self): for led in self._leds: @@ -74,3 +74,4 @@ class PiLiter(object): def blink(self, on_time=1, off_time=1): for led in self._leds: led.blink(on_time, off_time) +