logi-fix.js aktualisiert

This commit is contained in:
s-mendyka 2024-06-05 21:16:00 +02:00
parent fec70269b7
commit b44752458d

View File

@ -31,7 +31,7 @@ const vLedNames = [
const vLeds = [ const vLeds = [
213, 156, 213, 156,
41, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 161, 158, 160, 159, 41, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 168, 158, 160, 159,
183, 53, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 45, 46, 42, 73, 74, 75, 83, 84, 85, 86, 183, 53, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 45, 46, 42, 73, 74, 75, 83, 84, 85, 86,
184, 43, 20, 26, 8, 21, 23, 28, 24, 12, 18, 19, 47, 48, 49, 76, 77, 78, 95, 96, 97, 87, 184, 43, 20, 26, 8, 21, 23, 28, 24, 12, 18, 19, 47, 48, 49, 76, 77, 78, 95, 96, 97, 87,
185, 57, 4, 22, 7, 9, 10, 11, 13, 14, 15, 51, 52, 50, 40, 92, 93, 94, 185, 57, 4, 22, 7, 9, 10, 11, 13, 14, 15, 51, 52, 50, 40, 92, 93, 94,
@ -92,6 +92,7 @@ function sendColors(overrideColor) {
}else{ }else{
color = device.color(iPxX, iPxY); color = device.color(iPxX, iPxY);
} }
if ([ 213, 156, 183, 184, 185, 186, 187, 161, 158, 160, 159 ].includes(vLeds[idx])) { if ([ 213, 156, 183, 184, 185, 186, 187, 161, 158, 160, 159 ].includes(vLeds[idx])) {
RGBDataExtra.push(vLeds[idx]); RGBDataExtra.push(vLeds[idx]);
RGBDataExtra.push(color[0]); RGBDataExtra.push(color[0]);
@ -120,27 +121,12 @@ function sendColors(overrideColor) {
while(RGBDataExtra.length > 0) { while(RGBDataExtra.length > 0) {
const ledsToSend = Math.min(4, RGBDataExtra.length/4); const ledsToSend = Math.min(4, RGBDataExtra.length/4);
packet = [0x11, 0xFF, 0x10, 0x5B].concat(RGBDataExtra.splice(0, ledsToSend*4)); packet = [0x11, 0xFF, 0x10, 0x1A].concat(RGBDataExtra.splice(0, ledsToSend*4));
console.log(packet);
device.set_endpoint(1, 0x0602, 0xff43); // System IF device.set_endpoint(1, 0x0602, 0xff43); // System IF
//device.write(packettest, 20); device.write(packet, 20);
//device.pause(1); device.pause(1);
//device.write(packet, 20);
//device.pause(1);
const packet1 = [
0x11, 0xFF, 0x10, 0x5B, 0xB4, 0xB4, 0x1D, 0xA0,
0x03
];
// Endpoint und andere Parameter wie im Originalcode
const endpoint = 1;
const usage = 0xff43;
// Paket über die USB-Verbindung senden
device.set_endpoint(endpoint, 0x0602, usage); // System IF
device.write(packet1, 20); // Paket senden
device.pause(1); // Kurze Pause nach dem Senden
} }
} }
@ -152,10 +138,10 @@ function apply() {
} }
function applyExtra() { function applyExtra() {
const packet = [0x11, 0xFF, 0x10, 0x7E]; const packet = [0x11, 0xFF, 0x10, 0x7A];
device.set_endpoint(1, 0x0602, 0xff43); // System IF device.set_endpoint(1, 0x0602, 0xff43); // System IF
device.write(packet, 4); device.write(packet, 20);
} }
function hexToRgb(hex) { function hexToRgb(hex) {