summaryrefslogtreecommitdiff
path: root/kvmd/aiogp.py
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-09-14 01:34:15 +0300
committerDevaev Maxim <[email protected]>2020-09-14 01:34:23 +0300
commitee10435b818e0bf8ebf749a209969166502d78d4 (patch)
tree02db1948ed4a956d0cd2f6c5fd0b12d03804d3b2 /kvmd/aiogp.py
parent91eb257f3df32487d00ca457f9d78eabd354ce54 (diff)
common gpio path variable
Diffstat (limited to 'kvmd/aiogp.py')
-rw-r--r--kvmd/aiogp.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/kvmd/aiogp.py b/kvmd/aiogp.py
index 100bcd4c..2f988e67 100644
--- a/kvmd/aiogp.py
+++ b/kvmd/aiogp.py
@@ -20,6 +20,7 @@
# ========================================================================== #
+import os
import asyncio
import threading
@@ -32,6 +33,12 @@ from . import aiotools
# =====
+# XXX: Do not use this variable for any purpose other than testing.
+# It can be removed at any time.
+DEVICE_PATH = os.getenv("KVMD_GPIO_DEVICE_PATH", "/dev/gpiochip0")
+
+
+# =====
async def pulse(line: gpiod.Line, delay: float, final: float) -> None:
try:
line.set_value(1)