summaryrefslogtreecommitdiff
path: root/kvmd/plugins/ugpio/gpio.py
diff options
context:
space:
mode:
authorOleg Girko <[email protected]>2020-09-20 14:53:03 +0100
committerOleg Girko <[email protected]>2020-09-20 14:59:33 +0100
commita8589e48abb9853b0b3ccec31fc6898f6393de3e (patch)
treec62ef5545b44c48f2db3391bb1bf949ada02cf8a /kvmd/plugins/ugpio/gpio.py
parentc6b7b58f2d39371f9ec37697abf8248111693b17 (diff)
Make kvmd compatible with libgpiod 1.2.
The singular default_val argument of gpiod.Line.request() method was introduced in libgpiod 1.3. For older versions of libgpiod, defailt_vals argument with list value should be used. This argument is available in newer versions of libgpiod as well for compatibility. This change is needed for Debian / Raspbian 10 that have libgpiod 1.2. Signed-off-by: Oleg Girko <[email protected]>
Diffstat (limited to 'kvmd/plugins/ugpio/gpio.py')
-rw-r--r--kvmd/plugins/ugpio/gpio.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/kvmd/plugins/ugpio/gpio.py b/kvmd/plugins/ugpio/gpio.py
index e7bcc683..7c3f317c 100644
--- a/kvmd/plugins/ugpio/gpio.py
+++ b/kvmd/plugins/ugpio/gpio.py
@@ -67,7 +67,7 @@ class Plugin(BaseUserGpioDriver):
self.__chip = gpiod.Chip(aiogp.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_val=int(initial or False))
+ line.request("kvmd::ugpio-gpio::outputs", gpiod.LINE_REQ_DIR_OUT, default_vals=[int(initial or False)])
self.__output_lines[pin] = line
async def run(self) -> None: