From d1572b0c02753f07649f49e6f3d93d7104a59051 Mon Sep 17 00:00:00 2001 From: "Peter F. Patel-Schneider" Date: Tue, 11 Oct 2022 08:42:54 -0400 Subject: [PATCH] hidapi: rationalize DeviceInfo structure --- lib/hidapi/udev.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/hidapi/udev.py b/lib/hidapi/udev.py index 22e129fa..1a5ee83d 100644 --- a/lib/hidapi/udev.py +++ b/lib/hidapi/udev.py @@ -52,15 +52,15 @@ fileopen = open DeviceInfo = namedtuple( 'DeviceInfo', [ 'path', + 'bus_id', 'vendor_id', 'product_id', - 'serial', - 'release', - 'manufacturer', - 'product', 'interface', 'driver', - 'bus_id', + 'manufacturer', + 'product', + 'serial', + 'release', 'isDevice', 'hidpp_short', 'hidpp_long', @@ -160,13 +160,13 @@ def _match(action, device, filterfn): bus_id=int(bid, 16), vendor_id=vid[-4:], product_id=pid[-4:], - driver=hid_driver_name, interface=usb_interface, - isDevice=isDevice, - serial=hid_device.get('HID_UNIQ'), - release=attrs.get('bcdDevice') if attrs else None, + driver=hid_driver_name, manufacturer=attrs.get('manufacturer') if attrs else None, product=attrs.get('product') if attrs else None, + serial=hid_device.get('HID_UNIQ'), + release=attrs.get('bcdDevice') if attrs else None, + isDevice=isDevice, hidpp_short=hidpp_short, hidpp_long=hidpp_long, ) @@ -180,13 +180,13 @@ def _match(action, device, filterfn): bus_id=None, vendor_id=vid[-4:], product_id=pid[-4:], - driver=None, interface=None, - isDevice=isDevice, - serial=None, - release=None, + driver=None, manufacturer=None, product=None, + serial=None, + release=None, + isDevice=isDevice, hidpp_short=None, hidpp_long=None, )