From a8589e48abb9853b0b3ccec31fc6898f6393de3e Mon Sep 17 00:00:00 2001 From: Oleg Girko Date: Sun, 20 Sep 2020 14:53:03 +0100 Subject: 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 --- kvmd/plugins/msd/relay.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'kvmd/plugins/msd/relay.py') diff --git a/kvmd/plugins/msd/relay.py b/kvmd/plugins/msd/relay.py index ac09b5c9..f4ecc6ab 100644 --- a/kvmd/plugins/msd/relay.py +++ b/kvmd/plugins/msd/relay.py @@ -177,10 +177,10 @@ class _Gpio: self.__chip = gpiod.Chip(aiogp.DEVICE_PATH) self.__target_line = self.__chip.get_line(self.__target_pin) - self.__target_line.request("kvmd::msd-relay::target", gpiod.LINE_REQ_DIR_OUT, default_val=0) + self.__target_line.request("kvmd::msd-relay::target", gpiod.LINE_REQ_DIR_OUT, default_vals=[0]) self.__reset_line = self.__chip.get_line(self.__reset_pin) - self.__reset_line.request("kvmd::msd-relay::reset", gpiod.LINE_REQ_DIR_OUT, default_val=0) + self.__reset_line.request("kvmd::msd-relay::reset", gpiod.LINE_REQ_DIR_OUT, default_vals=[0]) def close(self) -> None: if self.__chip: -- cgit v1.2.3