JnyJny / busylight

Control USB connected presence lights from multiple vendors via the command-line or web API.
Apache License 2.0
244 stars 25 forks source link

Added decorator class busylight.lights.hid.Device #302

Closed JnyJny closed 12 months ago

JnyJny commented 12 months ago

Issue #301 found that pyhidapi and cython-hidapi participate in a python namespace collision for 'hid'. The packge pyhidapi will mask the presence of cython-hidapi if it is installed in the python environment or installed at a later time.

Both packages provide the same basic interface to HIDAPI with some small differences in how devices are instatiated. I decided to write a decorator/adaptor class that detects which flavor of HID API is available and provides a uniform interface modeled on the cython-hidapi implementation.

The pytest suite passes and manual testing against the fleet of test devices was successful.