logi-fix.js aktualisiert
This commit is contained in:
parent
fec70269b7
commit
b44752458d
30
logi-fix.js
30
logi-fix.js
@ -31,7 +31,7 @@ const vLedNames = [
|
||||
|
||||
const vLeds = [
|
||||
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,
|
||||
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,
|
||||
@ -92,6 +92,7 @@ function sendColors(overrideColor) {
|
||||
}else{
|
||||
color = device.color(iPxX, iPxY);
|
||||
}
|
||||
|
||||
if ([ 213, 156, 183, 184, 185, 186, 187, 161, 158, 160, 159 ].includes(vLeds[idx])) {
|
||||
RGBDataExtra.push(vLeds[idx]);
|
||||
RGBDataExtra.push(color[0]);
|
||||
@ -120,27 +121,12 @@ function sendColors(overrideColor) {
|
||||
while(RGBDataExtra.length > 0) {
|
||||
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.write(packettest, 20);
|
||||
//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
|
||||
device.write(packet, 20);
|
||||
device.pause(1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -152,10 +138,10 @@ function apply() {
|
||||
}
|
||||
|
||||
function applyExtra() {
|
||||
const packet = [0x11, 0xFF, 0x10, 0x7E];
|
||||
const packet = [0x11, 0xFF, 0x10, 0x7A];
|
||||
|
||||
device.set_endpoint(1, 0x0602, 0xff43); // System IF
|
||||
device.write(packet, 4);
|
||||
device.write(packet, 20);
|
||||
}
|
||||
|
||||
function hexToRgb(hex) {
|
||||
|
Loading…
Reference in New Issue
Block a user