summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kvmd/apps/kvmd/ugpio.py9
-rw-r--r--kvmd/plugins/ugpio/__init__.py3
2 files changed, 10 insertions, 2 deletions
diff --git a/kvmd/apps/kvmd/ugpio.py b/kvmd/apps/kvmd/ugpio.py
index ab034365..b678cd0b 100644
--- a/kvmd/apps/kvmd/ugpio.py
+++ b/kvmd/apps/kvmd/ugpio.py
@@ -81,7 +81,12 @@ class _GpioInput:
self.__driver.register_input(self.__pin)
def get_scheme(self) -> Dict:
- return {}
+ return {
+ "hw": {
+ "driver": self.__driver.get_instance_id(),
+ "pin": self.__pin,
+ },
+ }
def get_state(self) -> Dict:
(online, state) = (True, False)
@@ -136,7 +141,7 @@ class _GpioOutput: # pylint: disable=too-many-instance-attributes
"max_delay": (self.__max_pulse_delay if self.__pulse_delay else 0),
},
"hw": {
- "driver": str(self.__driver),
+ "driver": self.__driver.get_instance_id(),
"pin": self.__pin,
},
}
diff --git a/kvmd/plugins/ugpio/__init__.py b/kvmd/plugins/ugpio/__init__.py
index 0cc8662a..96195d30 100644
--- a/kvmd/plugins/ugpio/__init__.py
+++ b/kvmd/plugins/ugpio/__init__.py
@@ -58,6 +58,9 @@ class BaseUserGpioDriver(BasePlugin):
self._instance_name = instance_name
self._notifier = notifier
+ def get_instance_id(self) -> str:
+ return self._instance_name
+
def register_input(self, pin: int) -> None:
raise NotImplementedError