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
Brightness not working with monocolor #9
Comments
I modified self.__send_ctrl(commands.SET_BRIGHTNESS, 0x02, brightness) to (copied from aucc): self.__send_ctrl(commands.SET_EFFECT, 0x02, 0x33, 0x00, brightness) It works now when using the ite8291r3-ctl monocolor --name red -b 50 # this works now
ite8291r3-ctl query -b
50
ite8291r3-ctl monocolor --name red -b 30 # this works now
ite8291r3-ctl query -b
30
ite8291r3-ctl brightness 20 # This doesn't work
ite8291r3-ctl query -b # It returns the correct brightness but it's not applied to the keyboard yet
20
ite8291r3-ctl monocolor --name red # Now is applied with brightness 20 |
Can you post the output of
These work as expected. Please correct me if I misunderstood what you're trying to do. |
Could you also apply this patch to the current master, and try the commands that didn't work, then send the output? diff --git a/ite8291r3_ctl/ite8291r3.py b/ite8291r3_ctl/ite8291r3.py
index 4512d47..513e2df 100644
--- a/ite8291r3_ctl/ite8291r3.py
+++ b/ite8291r3_ctl/ite8291r3.py
@@ -144,14 +144,14 @@ class ite8291r3:
self.channel = channel
def __send_data(self, payload):
- #print(f"sending data ({len(payload)} bytes) {payload} to device")
+ print(f"sending data ({len(payload)} bytes) {payload} to device")
return self.channel.write(payload)
def __send_ctrl(self, *payload):
if len(payload) < 8:
payload += (0, ) * (8 - len(payload))
- #print(f"sending ctrl {payload} to device")
+ print(f"sending ctrl {payload} to device")
# https://github.com/libusb/hidapi/blob/533dd9229a846d6ab00c4dced1cbddf66b576258/libusb/hid.c#L1180
self.channel.ctrl_transfer( |
It looks like that it is working in your example. This is the result of $ ite8291r3_ctl query --devices
048d:ce00 bus 1 addr 3 rev 0.03 product 'ITE Device(8291)' manufacturer 'ITE Tech. Inc.' The result of the same commands you executed: $ ite8291r3_ctl monocolor --brightness 50 --name yellow
sending ctrl (9, 2, 50, 0, 0, 0, 0, 0) to device
sending ctrl (136, 0, 0, 0, 0, 0, 0, 0) to device
sending ctrl (8, 2, 51, 0, 36, 0, 0, 0) to device
sending ctrl (22, 0, 0, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00wwwwwwwwwwwwwwwwwwwww\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00') to device
sending ctrl (22, 0, 1, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00wwwwwwwwwwwwwwwwwwwww\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00') to device
sending ctrl (22, 0, 2, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00wwwwwwwwwwwwwwwwwwwww\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00') to device
sending ctrl (22, 0, 3, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00wwwwwwwwwwwwwwwwwwwww\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00') to device
sending ctrl (22, 0, 4, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00wwwwwwwwwwwwwwwwwwwww\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00') to device
sending ctrl (22, 0, 5, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00wwwwwwwwwwwwwwwwwwwww\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00') to device
$ ite8291r3_ctl query --brightness
sending ctrl (136, 0, 0, 0, 0, 0, 0, 0) to device
36
$ ite8291r3_ctl monocolor --brightness 25 --name blue
sending ctrl (9, 2, 25, 0, 0, 0, 0, 0) to device
sending ctrl (136, 0, 0, 0, 0, 0, 0, 0) to device
sending ctrl (8, 2, 51, 0, 36, 0, 0, 0) to device
sending ctrl (22, 0, 0, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') to device
sending ctrl (22, 0, 1, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') to device
sending ctrl (22, 0, 2, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') to device
sending ctrl (22, 0, 3, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') to device
sending ctrl (22, 0, 4, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') to device
sending ctrl (22, 0, 5, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') to device
$ ite8291r3_ctl query --brightness
sending ctrl (136, 0, 0, 0, 0, 0, 0, 0) to device
36
ite8291r3_ctl monocolor --brightness 10 --name red
sending ctrl (9, 2, 10, 0, 0, 0, 0, 0) to device
sending ctrl (136, 0, 0, 0, 0, 0, 0, 0) to device
sending ctrl (8, 2, 51, 0, 36, 0, 0, 0) to device
sending ctrl (22, 0, 0, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00') to device
sending ctrl (22, 0, 1, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00') to device
sending ctrl (22, 0, 2, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00') to device
sending ctrl (22, 0, 3, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00') to device
sending ctrl (22, 0, 4, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00') to device
sending ctrl (22, 0, 5, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00') to device
$ ite8291r3_ctl query --brightness
sending ctrl (136, 0, 0, 0, 0, 0, 0, 0) to device
36 Brightness doesn't change in my computer. |
Please run the following with the prints still in the code: ite8291r3_ctl monocolor -b 50 --name yellow
ite8291r3_ctl brightness 40 && ite8291r3_ctl query --brightness
ite8291r3_ctl brightness 30 && sleep 1 && ite8291r3_ctl query --brightness
ite8291r3_ctl query --fw-version |
$ ite8291r3_ctl monocolor -b 50 --name yellow
sending ctrl (9, 2, 50, 0, 0, 0, 0, 0) to device
sending ctrl (136, 0, 0, 0, 0, 0, 0, 0) to device
sending ctrl (8, 2, 51, 0, 36, 0, 0, 0) to device
sending ctrl (22, 0, 0, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00wwwwwwwwwwwwwwwwwwwww\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00') to device
sending ctrl (22, 0, 1, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00wwwwwwwwwwwwwwwwwwwww\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00') to device
sending ctrl (22, 0, 2, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00wwwwwwwwwwwwwwwwwwwww\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00') to device
sending ctrl (22, 0, 3, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00wwwwwwwwwwwwwwwwwwwww\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00') to device
sending ctrl (22, 0, 4, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00wwwwwwwwwwwwwwwwwwwww\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00') to device
sending ctrl (22, 0, 5, 0, 0, 0, 0, 0) to device
sending data (65 bytes) bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00wwwwwwwwwwwwwwwwwwwww\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00') to device
$ ite8291r3_ctl brightness 40 && ite8291r3_ctl query --brightness
sending ctrl (9, 2, 40, 0, 0, 0, 0, 0) to device
sending ctrl (136, 0, 0, 0, 0, 0, 0, 0) to device
36
$ ite8291r3_ctl brightness 30 && sleep 1 && ite8291r3_ctl query --brightness
sending ctrl (9, 2, 30, 0, 0, 0, 0, 0) to device
sending ctrl (136, 0, 0, 0, 0, 0, 0, 0) to device
36
$ ite8291r3_ctl query --fw-version
sending ctrl (128, 0, 0, 0, 0, 0, 0, 0) to device
18.3.0.1 |
It seems the firmware version is different from what I have. It possibly doesn't support setting only the brightness. |
Could you please try the current master and see if it works? If it doesn't, please attach the output when called with the
|
I'm trying to set the brightness of the monocolor option, but it doesn't seem to be working.
I'm using the following command:
I added a
print(args)
line onhandle_monocolor_args
function and it gives me the following output, so I guess this is not the problem.I also tried to set the color first and then, call the brightness option, but it doesn't work either.
I noticed that the brightness applied is the last effect brightness used.
Also, the
brightness
option doesn't work for effects:My guess it that
ite8291r3.set_brightness()
doesn't work as expected (or I don't understand it).The text was updated successfully, but these errors were encountered: