summaryrefslogtreecommitdiff
path: root/kvmd/gpio.py
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2019-04-06 05:32:02 +0300
committerDevaev Maxim <[email protected]>2019-04-06 08:04:26 +0300
commit1d75b738a08c98a5d3d8ac3c685e77360f4c1267 (patch)
tree3aa89dc7fd0ab737e9332714a784e9d4dde0a362 /kvmd/gpio.py
parent73e04b71ed55a46c939f12548b31746617af2bca (diff)
validators, tests
Diffstat (limited to 'kvmd/gpio.py')
-rw-r--r--kvmd/gpio.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/kvmd/gpio.py b/kvmd/gpio.py
index 64a1a100..ef9d1c5e 100644
--- a/kvmd/gpio.py
+++ b/kvmd/gpio.py
@@ -43,22 +43,22 @@ def bcm() -> Generator[None, None, None]:
def set_output(pin: int, initial: bool=False) -> int:
- assert pin > 0, pin
+ assert pin >= 0, pin
GPIO.setup(pin, GPIO.OUT, initial=initial)
return pin
def set_input(pin: int) -> int:
- assert pin > 0, pin
+ assert pin >= 0, pin
GPIO.setup(pin, GPIO.IN)
return pin
def read(pin: int) -> bool:
- assert pin > 0, pin
+ assert pin >= 0, pin
return bool(GPIO.input(pin))
def write(pin: int, flag: bool) -> None:
- assert pin > 0, pin
+ assert pin >= 0, pin
GPIO.output(pin, flag)