logi-fix.js aktualisiert

This commit is contained in:
s-mendyka 2024-06-05 00:33:22 +02:00
parent a1ed0a34b0
commit bda888d41c

View File

@ -136,15 +136,15 @@ function sendColors(overrideColor) {
device.pause(1); device.pause(1);
const packet = []; const packet1 = [];
packet[0] = 0x12; packet1[0] = 0x12;
packet[1] = 0xFF; packet1[1] = 0xFF;
packet[2] = 0x0F; packet1[2] = 0x0F;
packet[3] = 0x3F; packet1[3] = 0x3F;
packet[4] = 0x00; packet1[4] = 0x00;
packet[5] = 4; packet1[5] = 4;
packet[6] = 0x00; packet1[6] = 0x00;
packet[7] = 9; // led count packet1[7] = 9; // led count
for(let iIdx = 0; iIdx < vGkeyPositions.length; iIdx++){ for(let iIdx = 0; iIdx < vGkeyPositions.length; iIdx++){
const iLedIdx = (iIdx * 4) + 8; const iLedIdx = (iIdx * 4) + 8;
@ -160,15 +160,15 @@ function sendColors(overrideColor) {
color = device.color(iKeyPosX, iKeyPosY); color = device.color(iKeyPosX, iKeyPosY);
} }
packet[iLedIdx] = iIdx; packet1[iLedIdx] = iIdx;
packet[iLedIdx+1] = color[0]; packet1[iLedIdx+1] = color[0];
packet[iLedIdx+2] = color[1]; packet1[iLedIdx+2] = color[1];
packet[iLedIdx+3] = color[2]; packet1[iLedIdx+3] = color[2];
} }
device.set_endpoint(1, 0x0604, 0xff43); // Lighting IF device.set_endpoint(1, 0x0604, 0xff43); // Lighting IF
device.write(packet, 20); device.write(packet1, 20);
device.pause(1); device.pause(1);