From 12f880fb381cb2ff5f245215e47ca9118df57ed4 Mon Sep 17 00:00:00 2001 From: Nikola <1388673+jurkovic-nikola@users.noreply.github.com> Date: Sat, 9 Nov 2024 10:58:51 +0100 Subject: [PATCH] only if 0xff --- src/devices/k65plusW/k65plusW.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/devices/k65plusW/k65plusW.go b/src/devices/k65plusW/k65plusW.go index ae01a28..2ede55d 100644 --- a/src/devices/k65plusW/k65plusW.go +++ b/src/devices/k65plusW/k65plusW.go @@ -912,9 +912,11 @@ func (d *Device) writeColor(data []byte) { binary.LittleEndian.PutUint16(buffer[0:2], uint16(len(data))) copy(buffer[headerWriteSize:headerWriteSize+len(dataTypeSetColor)], dataTypeSetColor) copy(buffer[headerWriteSize+len(dataTypeSetColor):], data) + // Split packet into chunks chunks := common.ProcessMultiChunkPacket(buffer, maxBufferSizePerRequest) for i, chunk := range chunks { + fmt.Println(fmt.Sprintf("% 2x", chunk)) if i == 0 { // Initial packet is using cmdWriteColor _, err := d.transfer(cmdWriteColor, chunk, byte(cmdKeyboard)) @@ -1037,7 +1039,7 @@ func (d *Device) controlDialListener() { } else { brightness += 100 } - } else { + } else if value == 255 { if brightness <= 0 { brightness = 0 } else {