summaryrefslogtreecommitdiff
path: root/kvmd/plugins/ugpio
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-10-03 03:34:55 +0300
committerDevaev Maxim <[email protected]>2020-10-03 05:02:14 +0300
commitcccf44655aadc80d2d535033951e7af9ac65a271 (patch)
tree1ea9607e91e0189a0d73e87bed39b14c29213585 /kvmd/plugins/ugpio
parent872145590a3227b799ae7f5e7731dfc15967d63c (diff)
common env variables
Diffstat (limited to 'kvmd/plugins/ugpio')
-rw-r--r--kvmd/plugins/ugpio/gpio.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/kvmd/plugins/ugpio/gpio.py b/kvmd/plugins/ugpio/gpio.py
index 7c3f317c..4d50d4fc 100644
--- a/kvmd/plugins/ugpio/gpio.py
+++ b/kvmd/plugins/ugpio/gpio.py
@@ -25,6 +25,7 @@ from typing import Optional
import gpiod
+from ... import env
from ... import aiotools
from ... import aiogp
@@ -58,13 +59,13 @@ class Plugin(BaseUserGpioDriver):
def prepare(self) -> None:
assert self.__reader is None
self.__reader = aiogp.AioReader(
- path=aiogp.DEVICE_PATH,
+ path=env.GPIO_DEVICE_PATH,
consumer="kvmd::ugpio-gpio::inputs",
pins=self.__input_pins,
notifier=self._notifier,
)
- self.__chip = gpiod.Chip(aiogp.DEVICE_PATH)
+ self.__chip = gpiod.Chip(env.GPIO_DEVICE_PATH)
for (pin, initial) in self.__output_pins.items():
line = self.__chip.get_line(pin)
line.request("kvmd::ugpio-gpio::outputs", gpiod.LINE_REQ_DIR_OUT, default_vals=[int(initial or False)])