mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-31 10:01: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:
@@ -111,10 +111,10 @@ class Plugin(BaseAtx): # pylint: disable=too-many-instance-attributes
|
||||
self.__chip = gpiod.Chip(aiogp.DEVICE_PATH)
|
||||
|
||||
self.__power_switch_line = self.__chip.get_line(self.__power_switch_pin)
|
||||
self.__power_switch_line.request("kvmd::atx-gpio::power_switch", gpiod.LINE_REQ_DIR_OUT, default_val=0)
|
||||
self.__power_switch_line.request("kvmd::atx-gpio::power_switch", gpiod.LINE_REQ_DIR_OUT, default_vals=[0])
|
||||
|
||||
self.__reset_switch_line = self.__chip.get_line(self.__reset_switch_pin)
|
||||
self.__reset_switch_line.request("kvmd::atx-gpio::reset_switch", gpiod.LINE_REQ_DIR_OUT, default_val=0)
|
||||
self.__reset_switch_line.request("kvmd::atx-gpio::reset_switch", gpiod.LINE_REQ_DIR_OUT, default_vals=[0])
|
||||
|
||||
async def get_state(self) -> Dict:
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user