Allow the creation of remote pins easily with PiGPIOPin. Also changes
DefaultPin to a pin_factory callable which accepts the input pin number.
This commit is contained in:
Dave Jones
2016-04-16 00:21:51 +01:00
parent 8426c68040
commit 79a0fd2a27
5 changed files with 75 additions and 67 deletions

View File

@@ -19,9 +19,9 @@ 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'):
gpiozero.devices.DefaultPin = MockPWMPin
gpiozero.devices.pin_factory = MockPWMPin
else:
gpiozero.devices.DefaultPin = MockPin
gpiozero.devices.pin_factory = MockPin
def teardown_function(function):
MockPin.clear_pins()