logi-fix.js aktualisiert
This commit is contained in:
parent
a1ed0a34b0
commit
bda888d41c
28
logi-fix.js
28
logi-fix.js
@ -136,15 +136,15 @@ function sendColors(overrideColor) {
|
||||
device.pause(1);
|
||||
|
||||
|
||||
const packet = [];
|
||||
packet[0] = 0x12;
|
||||
packet[1] = 0xFF;
|
||||
packet[2] = 0x0F;
|
||||
packet[3] = 0x3F;
|
||||
packet[4] = 0x00;
|
||||
packet[5] = 4;
|
||||
packet[6] = 0x00;
|
||||
packet[7] = 9; // led count
|
||||
const packet1 = [];
|
||||
packet1[0] = 0x12;
|
||||
packet1[1] = 0xFF;
|
||||
packet1[2] = 0x0F;
|
||||
packet1[3] = 0x3F;
|
||||
packet1[4] = 0x00;
|
||||
packet1[5] = 4;
|
||||
packet1[6] = 0x00;
|
||||
packet1[7] = 9; // led count
|
||||
|
||||
for(let iIdx = 0; iIdx < vGkeyPositions.length; iIdx++){
|
||||
const iLedIdx = (iIdx * 4) + 8;
|
||||
@ -160,15 +160,15 @@ function sendColors(overrideColor) {
|
||||
color = device.color(iKeyPosX, iKeyPosY);
|
||||
}
|
||||
|
||||
packet[iLedIdx] = iIdx;
|
||||
packet[iLedIdx+1] = color[0];
|
||||
packet[iLedIdx+2] = color[1];
|
||||
packet[iLedIdx+3] = color[2];
|
||||
packet1[iLedIdx] = iIdx;
|
||||
packet1[iLedIdx+1] = color[0];
|
||||
packet1[iLedIdx+2] = color[1];
|
||||
packet1[iLedIdx+3] = color[2];
|
||||
}
|
||||
|
||||
|
||||
device.set_endpoint(1, 0x0604, 0xff43); // Lighting IF
|
||||
device.write(packet, 20);
|
||||
device.write(packet1, 20);
|
||||
device.pause(1);
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user