common gpio path variable

This commit is contained in:
Devaev Maxim
2020-09-14 01:34:15 +03:00
parent 91eb257f3d
commit ee10435b81
6 changed files with 14 additions and 6 deletions

View File

@@ -20,6 +20,7 @@
# ========================================================================== #
import os
import asyncio
import threading
@@ -31,6 +32,12 @@ import gpiod
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: