apmorton / pyhidapi

hidapi bindings in ctypes
MIT License
112 stars 42 forks source link

hid.Device().serial is broken #34

Closed mayanksuman closed 4 years ago

mayanksuman commented 4 years ago

After opening the device as

h = hid.Device(vid, pid)

The h.serial produces following error trace:

h.serial
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "~/.local/lib/python3.7/site-packages/hid/__init__.py", line 200, in serial
    return self.__readstring(hidapi.hid_get_serial_number_string)
  File "~/.local/lib/python3.7/site-packages/hid/__init__.py", line 145, in __readstring
    self.__hidcall(function, self.__dev, buf, max_length)
  File "~/.local/lib/python3.7/site-packages/hid/__init__.py", line 136, in __hidcall
    ret = function(*args, **kwargs)
TypeError: __init__ expected at most 1 arguments, got 3

Properties like h.manufacturer and h.product works.

apmorton commented 4 years ago

Can you confirm this is fixed by installing from git master?

I will push to pypi if the latest changes resolve this issue.

mayanksuman commented 4 years ago

Yes. It is fixed in git master.

mdkcore0 commented 4 years ago

pypi version is on 1.0.3, so this problem still occuring

apmorton commented 4 years ago

apologies this slipped through the cracks - I have published 1.0.4 to pypi

mdkcore0 commented 4 years ago

no problem, got the update rehe, thanks!