cli: print each device's direct path

This commit is contained in:
effective-light 2020-08-18 15:38:11 -04:00 committed by Peter F. Patel-Schneider
parent bf3aeff7d8
commit 35114490d3
2 changed files with 3 additions and 0 deletions

View File

@ -83,6 +83,7 @@ class PairedDevice(object):
self._power_switch = None
self.handle = None
self.path = None
# if _log.isEnabledFor(_DEBUG):
# _log.debug("new PairedDevice(%s, %s, %s)", receiver, number, link_notification)
@ -140,6 +141,7 @@ class PairedDevice(object):
for dev in _hid.enumerate({'vendor_id': 0x046d}):
if dev.product_id == self.receiver.product_id and dev.serial \
and dev.serial.startswith(self.wpid):
self.path = dev.path
self.handle = _hid.open_path(dev.path)
break

View File

@ -70,6 +70,7 @@ def _print_device(dev):
dev.ping()
print(' %d: %s' % (dev.number, dev.name))
print(' Device path :', dev.path)
print(' Codename :', dev.codename)
print(' Kind :', dev.kind)
print(' Wireless PID :', dev.wpid)