Add LedBorg as a subclass of RGBLED

This commit is contained in:
Andrew Scheller
2016-05-26 18:34:51 +00:00
committed by Andrew Scheller
parent 9278a2f857
commit 3a7acbf89d
8 changed files with 75 additions and 14 deletions

View File

@@ -18,7 +18,7 @@ from gpiozero import *
def setup_function(function):
import gpiozero.devices
# dirty, but it does the job
if function.__name__ in ('test_robot', 'test_ryanteck_robot', 'test_camjam_kit_robot'):
if function.__name__ in ('test_robot', 'test_ryanteck_robot', 'test_camjam_kit_robot', 'test_led_borg'):
gpiozero.devices.pin_factory = MockPWMPin
else:
gpiozero.devices.pin_factory = MockPin
@@ -524,6 +524,11 @@ def test_led_bar_graph_pwm_initial_value():
assert graph.value == -0.5
assert (pin1.state, pin2.state, pin3.state) == (0, 0.5, 1)
def test_led_borg():
pins = [MockPWMPin(n) for n in (17, 27, 22)]
with LedBorg() as board:
assert [device.pin for device in board._leds] == pins
def test_pi_liter():
pins = [MockPin(n) for n in (4, 17, 27, 18, 22, 23, 24, 25)]
with PiLiter() as board: