From bda888d41cd0e810ac0138f29d2248b0a47b081c Mon Sep 17 00:00:00 2001 From: s-mendyka Date: Wed, 5 Jun 2024 00:33:22 +0200 Subject: [PATCH] logi-fix.js aktualisiert --- logi-fix.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/logi-fix.js b/logi-fix.js index 5f0fc42..46038e1 100644 --- a/logi-fix.js +++ b/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);