Skip to content

Commit

Permalink
Merge pull request #405 from DarthAffe/LogitechMultipleDevicesFix
Browse files Browse the repository at this point in the history
Fixed crash in logitech device provider, when multiple lightspeed dev…
  • Loading branch information
DarthAffe authored Oct 20, 2024
2 parents 5c864a0 + f249103 commit a0198e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion RGB.NET.Devices.Logitech/HID/LightspeedHidLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ private IEnumerable<int> Detect(int pid)
Dictionary<byte, HidDevice> deviceUsages = DeviceList.Local
.GetHidDevices(VendorId, pid)
.Where(d => d.DevicePath.Contains("mi_02"))
.ToDictionary(x => (byte)x.GetUsage(), x => x);
.Select(x => ((byte)x.GetUsage(), x))
.DistinctBy(x => x.Item1)
.ToDictionary(x => x.Item1, x => x.x);

foreach ((int wirelessPid, byte _) in GetWirelessDevices(deviceUsages))
yield return wirelessPid;
Expand Down

0 comments on commit a0198e3

Please sign in to comment.