Skip to content

Commit

Permalink
Fixed crash in logitech device provider, when multiple lightspeed dev…
Browse files Browse the repository at this point in the history
…ices with the same usage are connected
  • Loading branch information
DarthAffe committed Oct 20, 2024
1 parent 5c864a0 commit f249103
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 f249103

Please sign in to comment.