summaryrefslogtreecommitdiff
path: root/kvmd/plugins/ugpio/__init__.py
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2021-09-08 05:43:36 +0300
committerMaxim Devaev <[email protected]>2021-09-08 05:43:36 +0300
commit98ad1145a8782d3b82516dd9f81c86d9e80391c5 (patch)
treeb8f348f0815e8ee72236bf9879af779c95727755 /kvmd/plugins/ugpio/__init__.py
parent939c63fe7daf2ddc9a05c9e0fbeab63cb5c6f0c1 (diff)
string pins
Diffstat (limited to 'kvmd/plugins/ugpio/__init__.py')
-rw-r--r--kvmd/plugins/ugpio/__init__.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/kvmd/plugins/ugpio/__init__.py b/kvmd/plugins/ugpio/__init__.py
index eae65891..f63df5e4 100644
--- a/kvmd/plugins/ugpio/__init__.py
+++ b/kvmd/plugins/ugpio/__init__.py
@@ -22,6 +22,7 @@
from typing import Set
from typing import Type
+from typing import Callable
from typing import Optional
from typing import Any
@@ -51,7 +52,6 @@ class GpioDriverOfflineError(GpioOperationError):
class UserGpioModes:
INPUT = "input"
OUTPUT = "output"
-
ALL = set([INPUT, OUTPUT])
@@ -74,11 +74,15 @@ class BaseUserGpioDriver(BasePlugin):
def get_modes(cls) -> Set[str]:
return set(UserGpioModes.ALL)
- def register_input(self, pin: int, debounce: float) -> None:
+ @classmethod
+ def get_pin_validator(cls) -> Callable[[Any], str]:
+ raise NotImplementedError
+
+ def register_input(self, pin: str, debounce: float) -> None:
_ = pin
_ = debounce
- def register_output(self, pin: int, initial: Optional[bool]) -> None:
+ def register_output(self, pin: str, initial: Optional[bool]) -> None:
_ = pin
_ = initial
@@ -91,10 +95,10 @@ class BaseUserGpioDriver(BasePlugin):
async def cleanup(self) -> None:
pass
- async def read(self, pin: int) -> bool:
+ async def read(self, pin: str) -> bool:
raise NotImplementedError
- async def write(self, pin: int, state: bool) -> None:
+ async def write(self, pin: str, state: bool) -> None:
raise NotImplementedError