summaryrefslogtreecommitdiff
path: root/kvmd/plugins/ugpio/otgbind.py
diff options
context:
space:
mode:
Diffstat (limited to 'kvmd/plugins/ugpio/otgbind.py')
-rw-r--r--kvmd/plugins/ugpio/otgbind.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/kvmd/plugins/ugpio/otgbind.py b/kvmd/plugins/ugpio/otgbind.py
index 6dec46c9..600c8488 100644
--- a/kvmd/plugins/ugpio/otgbind.py
+++ b/kvmd/plugins/ugpio/otgbind.py
@@ -23,6 +23,9 @@
import os
import asyncio
+from typing import Callable
+from typing import Any
+
from ...logging import get_logger
from ...inotify import InotifyMask
@@ -50,6 +53,10 @@ class Plugin(BaseUserGpioDriver):
self.__udc = udc
self.__driver = ""
+ @classmethod
+ def get_pin_validator(cls) -> Callable[[Any], str]:
+ return str
+
def prepare(self) -> None:
(self.__udc, self.__driver) = usb.find_udc(self.__udc)
get_logger().info("Using UDC %s", self.__udc)
@@ -83,11 +90,11 @@ class Plugin(BaseUserGpioDriver):
except Exception:
logger.exception("Unexpected OTG-bind watcher error")
- async def read(self, pin: int) -> bool:
+ async def read(self, pin: str) -> bool:
_ = pin
return os.path.islink(self.__get_driver_path(self.__udc))
- async def write(self, pin: int, state: bool) -> None:
+ async def write(self, pin: str, state: bool) -> None:
_ = pin
with open(self.__get_driver_path("bind" if state else "unbind"), "w") as ctl_file:
ctl_file.write(f"{self.__udc}\n")