Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zjeffer opened this issue Jul 2, 2021 · 2 comments

Comments

@zjeffer
Copy link

zjeffer commented Jul 2, 2021

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.

@astiak
Copy link
Contributor

astiak commented Mar 27, 2023

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.

@zjeffer
Copy link
Author

zjeffer commented Mar 27, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants