summaryrefslogtreecommitdiff
path: root/kvmd/plugins/ugpio/__init__.py
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-09-10 09:31:05 +0300
committerDevaev Maxim <[email protected]>2020-09-10 09:31:05 +0300
commit9cb5582565aa2301a238ca382a32dc80106f6c15 (patch)
treeb0e06d9cb15c88f72a8a42e0c02a97a7b0965663 /kvmd/plugins/ugpio/__init__.py
parent967afb2d9a0f4a94026ec612801b6291db5c6a72 (diff)
only available gpio modes
Diffstat (limited to 'kvmd/plugins/ugpio/__init__.py')
-rw-r--r--kvmd/plugins/ugpio/__init__.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/kvmd/plugins/ugpio/__init__.py b/kvmd/plugins/ugpio/__init__.py
index 1e7725e8..9ed48a5f 100644
--- a/kvmd/plugins/ugpio/__init__.py
+++ b/kvmd/plugins/ugpio/__init__.py
@@ -20,6 +20,7 @@
# ========================================================================== #
+from typing import Set
from typing import Type
from typing import Optional
from typing import Any
@@ -47,6 +48,14 @@ class GpioDriverOfflineError(GpioOperationError):
# =====
+class UserGpioModes:
+ INPUT = "input"
+ OUTPUT = "output"
+
+ ALL = set([INPUT, OUTPUT])
+
+
+# =====
class BaseUserGpioDriver(BasePlugin):
def __init__( # pylint: disable=super-init-not-called
self,
@@ -61,6 +70,10 @@ class BaseUserGpioDriver(BasePlugin):
def get_instance_id(self) -> str:
return self._instance_name
+ @classmethod
+ def get_modes(cls) -> Set[str]:
+ return set(UserGpioModes.ALL)
+
def register_input(self, pin: int) -> None:
raise NotImplementedError