avell-unofficial-control-center icon indicating copy to clipboard operation
avell-unofficial-control-center copied to clipboard

[Improvement] Automatically get the correct device_id and product_id before creating the ControlCenter object

Open zjeffer opened this issue 3 years ago • 2 comments

At first this software didn't work on my laptop (TongFang GM5ZG7W) until I looked at the code and realized it used a different product_id at this line in the main method :

control = ControlCenter(vendor_id=0x048d, product_id=0xce00)

Using lsusb, I found that the product_id for my laptop is not 0xce00, but 0x6004: Bus 003 Device 005: ID 048d:6004 Integrated Technology Express, Inc. ITE Device(8291)

Changing this parameter made the script work.

This seems to be a common problem for many people (#55, #48, #44, #20).

A way to fix this would be to automatically find the correct device_id and product_id, which shouldn't be that hard to implement. The show_devices() method from PyUSB doesn't seem to be able to get the correct description, but lsusb has no problem finding ITE Device(8291). You could make a function that enumerates all lines generated by lsusb, and then get the device_id and product_id from the line containing the ITE Device(8291) string.

zjeffer avatar Jul 02 '21 12:07 zjeffer

Hi @zjeffer

I know I'm replying almost 2 years later, but if you still have this laptop - would you mind trying https://github.com/astiak/avell-unofficial-control-center/tree/detect-keyboard

I've added a small bit of code in there to detect the IDs.

astiak avatar Mar 27 '23 19:03 astiak

Hi, sadly I don't have that laptop anymore, I returned it because of the shitty keyboard. The code looks good, though!

zjeffer avatar Mar 27 '23 19:03 zjeffer