hidapi: rationalize DeviceInfo structure
This commit is contained in:
parent
3e90c3bc8a
commit
d1572b0c02
|
@ -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,
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue