From e3cd011aeb3943f496f7d8a0ad4da78485647d15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Thu, 5 Jun 2025 16:31:10 +0200 Subject: [PATCH 1/2] Improve device category description Make it nicer, accept that some scanners might be misrepresented as camera, avoid underscore in the human-readable description. --- qubesadmin/device_protocol.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qubesadmin/device_protocol.py b/qubesadmin/device_protocol.py index c72d8a65..c9526ba7 100644 --- a/qubesadmin/device_protocol.py +++ b/qubesadmin/device_protocol.py @@ -647,16 +647,16 @@ class DeviceCategory(Enum): # modems, WiFi and Ethernet adapters Network = ("u02****", "p0703**", "p02****", "ue0****") - Input = ("u03****", "p09****") # HID etc. Keyboard = ("u03**01", "p0900**") Mouse = ("u03**02", "p0902**") + Input = ("u03****", "p09****") # HID etc. Printer = ("u07****",) - Image_Input = ("p0903**", "u06****", "u0e****") # cameras and scanners + Camera = ("p0903**", "u06****", "u0e****") # cameras and scanners + Microphone = ("m******",) Audio = ("p0403**", "p0401**", "p0408**", "u01****", "m******") # Multimedia = Audio, Video, Displays etc. Multimedia = ("u10****", "p03****", "p04****") - Microphone = ("m******",) USB_Storage = ("u08****", ) Block_Storage = ("b******", ) Storage = ("b******", "u08****", "p01****") @@ -1019,7 +1019,7 @@ def description(self) -> str: else: for interface in self.interfaces: if str(interface) != f"{self.devclass.upper()} device": - cat = str(interface) + cat = str(interface).replace("_", " ") break else: cat = f"{self.devclass.upper()} device" From 59023144ad593d23ceefb0413bea3ca776c36e38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Tue, 24 Jun 2025 20:34:25 +0200 Subject: [PATCH 2/2] Fix incorrect parent device serialization --- qubesadmin/device_protocol.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qubesadmin/device_protocol.py b/qubesadmin/device_protocol.py index c9526ba7..06306cda 100644 --- a/qubesadmin/device_protocol.py +++ b/qubesadmin/device_protocol.py @@ -1167,13 +1167,13 @@ def _deserialize( interfaces = properties["interfaces"] properties["interfaces"] = DeviceInterface.from_str_bulk(interfaces) - if "parent_ident" in properties: + if "parent_port_id" in properties: properties["parent"] = Port( backend_domain=expected_device.backend_domain, - port_id=properties["parent_ident"], + port_id=properties["parent_port_id"], devclass=properties["parent_devclass"], ) - del properties["parent_ident"] + del properties["parent_port_id"] del properties["parent_devclass"] return cls(**properties)