hidapi: rationalize DeviceInfo structure
This commit is contained in:
parent
3e90c3bc8a
commit
d1572b0c02
|
@ -52,15 +52,15 @@ fileopen = open
|
||||||
DeviceInfo = namedtuple(
|
DeviceInfo = namedtuple(
|
||||||
'DeviceInfo', [
|
'DeviceInfo', [
|
||||||
'path',
|
'path',
|
||||||
|
'bus_id',
|
||||||
'vendor_id',
|
'vendor_id',
|
||||||
'product_id',
|
'product_id',
|
||||||
'serial',
|
|
||||||
'release',
|
|
||||||
'manufacturer',
|
|
||||||
'product',
|
|
||||||
'interface',
|
'interface',
|
||||||
'driver',
|
'driver',
|
||||||
'bus_id',
|
'manufacturer',
|
||||||
|
'product',
|
||||||
|
'serial',
|
||||||
|
'release',
|
||||||
'isDevice',
|
'isDevice',
|
||||||
'hidpp_short',
|
'hidpp_short',
|
||||||
'hidpp_long',
|
'hidpp_long',
|
||||||
|
@ -160,13 +160,13 @@ def _match(action, device, filterfn):
|
||||||
bus_id=int(bid, 16),
|
bus_id=int(bid, 16),
|
||||||
vendor_id=vid[-4:],
|
vendor_id=vid[-4:],
|
||||||
product_id=pid[-4:],
|
product_id=pid[-4:],
|
||||||
driver=hid_driver_name,
|
|
||||||
interface=usb_interface,
|
interface=usb_interface,
|
||||||
isDevice=isDevice,
|
driver=hid_driver_name,
|
||||||
serial=hid_device.get('HID_UNIQ'),
|
|
||||||
release=attrs.get('bcdDevice') if attrs else None,
|
|
||||||
manufacturer=attrs.get('manufacturer') if attrs else None,
|
manufacturer=attrs.get('manufacturer') if attrs else None,
|
||||||
product=attrs.get('product') 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_short=hidpp_short,
|
||||||
hidpp_long=hidpp_long,
|
hidpp_long=hidpp_long,
|
||||||
)
|
)
|
||||||
|
@ -180,13 +180,13 @@ def _match(action, device, filterfn):
|
||||||
bus_id=None,
|
bus_id=None,
|
||||||
vendor_id=vid[-4:],
|
vendor_id=vid[-4:],
|
||||||
product_id=pid[-4:],
|
product_id=pid[-4:],
|
||||||
driver=None,
|
|
||||||
interface=None,
|
interface=None,
|
||||||
isDevice=isDevice,
|
driver=None,
|
||||||
serial=None,
|
|
||||||
release=None,
|
|
||||||
manufacturer=None,
|
manufacturer=None,
|
||||||
product=None,
|
product=None,
|
||||||
|
serial=None,
|
||||||
|
release=None,
|
||||||
|
isDevice=isDevice,
|
||||||
hidpp_short=None,
|
hidpp_short=None,
|
||||||
hidpp_long=None,
|
hidpp_long=None,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue