Document transport_hid class

pull/1/head
Timothy 10 years ago
parent 78e9afae6e
commit e7cb1d474a

@ -10,6 +10,6 @@ To get a list of TREZORs that are currently plugged into our computer, we use th
We can now interact with our TREZORs by creating a :doc:`TrezorClient <client>` object.
.. automodule:: trezorlib.transport_hid
.. autoclass:: trezorlib.transport_hid.HidTransport
:members:
:undoc-members:

@ -54,6 +54,9 @@ class HidTransport(Transport):
@classmethod
def enumerate(cls):
"""
Return a list of available TREZOR devices.
"""
devices = {}
for d in hid.enumerate(0, 0):
vendor_id = d['vendor_id']
@ -74,7 +77,9 @@ class HidTransport(Transport):
return devices.values()
def is_connected(self):
# Check if the device is still connected
"""
Check if the device is still connected.
"""
for d in hid.enumerate(0, 0):
if d['path'] == self.device:
return True

Loading…
Cancel
Save