mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
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 <ol@infoserver.lv>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user