summaryrefslogtreecommitdiff
path: root/kvmd
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-12-01 10:36:48 +0300
committerDevaev Maxim <[email protected]>2020-12-01 10:36:48 +0300
commit5eff81061bce75d15a3e8634ec38be2481c8b4ef (patch)
treef132aec2f2086c5c5230c90279474a27c094c436 /kvmd
parentf4a8a117c73dc21db0960c3353184d3698484ed0 (diff)
simplified outputs api
Diffstat (limited to 'kvmd')
-rw-r--r--kvmd/plugins/hid/_mcu/__init__.py13
-rw-r--r--kvmd/plugins/hid/bt/__init__.py2
-rw-r--r--kvmd/plugins/hid/otg/__init__.py2
3 files changed, 8 insertions, 9 deletions
diff --git a/kvmd/plugins/hid/_mcu/__init__.py b/kvmd/plugins/hid/_mcu/__init__.py
index 52d9912d..38707572 100644
--- a/kvmd/plugins/hid/_mcu/__init__.py
+++ b/kvmd/plugins/hid/_mcu/__init__.py
@@ -174,18 +174,17 @@ class BaseMcuHid(BaseHid, multiprocessing.Process): # pylint: disable=too-many-
if online and active_mouse in ["usb_rel", "ps2"]:
absolute = False
- keyboard_outputs: Dict = {"available": {}, "active": ""}
- mouse_outputs: Dict = {"available": {}, "active": ""}
+ keyboard_outputs: Dict = {"available": [], "active": ""}
+ mouse_outputs: Dict = {"available": [], "active": ""}
if outputs & 0b10000000: # Dynamic
if features & 0b00000001: # USB
- keyboard_outputs["available"]["usb"] = {"name": "USB"}
- mouse_outputs["available"]["usb"] = {"name": "USB", "absolute": True}
- mouse_outputs["available"]["usb_rel"] = {"name": "USB Relative", "absolute": False}
+ keyboard_outputs["available"].extend(["usb"])
+ mouse_outputs["available"].extend(["usb", "usb_rel"])
if features & 0b00000010: # PS/2
- keyboard_outputs["available"]["ps2"] = {"name": "PS/2"}
- mouse_outputs["available"]["ps2"] = {"name": "PS/2"}
+ keyboard_outputs["available"].extend(["ps2"])
+ mouse_outputs["available"].extend(["ps2"])
active_keyboard = get_active_keyboard(outputs)
if active_keyboard in keyboard_outputs["available"]:
diff --git a/kvmd/plugins/hid/bt/__init__.py b/kvmd/plugins/hid/bt/__init__.py
index c13e2a34..55c4c979 100644
--- a/kvmd/plugins/hid/bt/__init__.py
+++ b/kvmd/plugins/hid/bt/__init__.py
@@ -131,7 +131,7 @@ class Plugin(BaseHid): # pylint: disable=too-many-instance-attributes
async def get_state(self) -> Dict:
state = await self.__server.get_state()
- outputs: Dict = {"available": {}, "active": ""}
+ outputs: Dict = {"available": [], "active": ""}
return {
"online": True,
"keyboard": {
diff --git a/kvmd/plugins/hid/otg/__init__.py b/kvmd/plugins/hid/otg/__init__.py
index e685226b..49fec56c 100644
--- a/kvmd/plugins/hid/otg/__init__.py
+++ b/kvmd/plugins/hid/otg/__init__.py
@@ -89,7 +89,7 @@ class Plugin(BaseHid):
async def get_state(self) -> Dict:
keyboard_state = await self.__keyboard_proc.get_state()
mouse_state = await self.__mouse_proc.get_state()
- outputs: Dict = {"available": {}, "active": ""}
+ outputs: Dict = {"available": [], "active": ""}
return {
"online": True,
"keyboard": {