diff options
author | Devaev Maxim <[email protected]> | 2020-12-25 11:08:56 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-12-25 11:08:56 +0300 |
commit | 0adfe17f70051f1061bcb0b40dcaa5593091a67e (patch) | |
tree | a69522e60103ff11f8c3d9ad662dbed0bd1b6939 /kvmd/plugins/msd/relay/gpio.py | |
parent | 4447e49abb518a4da83d6adc16ca1bb5dcba5fae (diff) |
configurable gpio devices
Diffstat (limited to 'kvmd/plugins/msd/relay/gpio.py')
-rw-r--r-- | kvmd/plugins/msd/relay/gpio.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kvmd/plugins/msd/relay/gpio.py b/kvmd/plugins/msd/relay/gpio.py index 0950c1d6..cca13d07 100644 --- a/kvmd/plugins/msd/relay/gpio.py +++ b/kvmd/plugins/msd/relay/gpio.py @@ -24,7 +24,6 @@ from typing import Optional import gpiod -from .... import env from .... import aiogp @@ -32,11 +31,13 @@ from .... import aiogp class Gpio: def __init__( self, + device_path: str, target_pin: int, reset_pin: int, reset_delay: float, ) -> None: + self.__device_path = device_path self.__target_pin = target_pin self.__reset_pin = reset_pin self.__reset_delay = reset_delay @@ -50,7 +51,7 @@ class Gpio: assert self.__target_line is None assert self.__reset_line is None - self.__chip = gpiod.Chip(env.GPIO_DEVICE_PATH) + self.__chip = gpiod.Chip(self.__device_path) self.__target_line = self.__chip.get_line(self.__target_pin) self.__target_line.request("kvmd::msd::target", gpiod.LINE_REQ_DIR_OUT, default_vals=[0]) |