summaryrefslogtreecommitdiff
path: root/kvmd/aiogp.py
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-11-12 21:03:28 +0300
committerDevaev Maxim <[email protected]>2020-11-12 21:03:28 +0300
commit87cc8cf7b0e00f7f0a9badf551067aafad6da4ce (patch)
treecdd802d124236ded6969dc5d80c764deec357e02 /kvmd/aiogp.py
parent79ef26e2f441f6c742a5da78b08ea2d5a4cc6e18 (diff)
parent0984f0cb36c5881669010c62e986cc8bc7fe019a (diff)
Merge branch 'spi'
Diffstat (limited to 'kvmd/aiogp.py')
-rw-r--r--kvmd/aiogp.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/kvmd/aiogp.py b/kvmd/aiogp.py
index ba406e8d..46252914 100644
--- a/kvmd/aiogp.py
+++ b/kvmd/aiogp.py
@@ -34,12 +34,12 @@ from . import aiotools
# =====
-async def pulse(line: gpiod.Line, delay: float, final: float) -> None:
+async def pulse(line: gpiod.Line, delay: float, final: float, inverted: bool=False) -> None:
try:
- line.set_value(1)
+ line.set_value(int(not inverted))
await asyncio.sleep(delay)
finally:
- line.set_value(0)
+ line.set_value(int(inverted))
await asyncio.sleep(final)