Update the corsair device-provider to make use of the new features in the 3.0.217 SDK

This commit is contained in:
DarthAffe committed 2018-12-25 18:57:45 +01:00
1 parent fce3dfaeb9
commit 586d20936e
3 files changed
+237 -2

No files matched your search

@@ -36,7 +36,7 @@ namespace RGB.NET.Devices.Corsair
/// <inheritdoc />
protected override void InitializeLayout()
{
LedId referenceId = (DeviceInfo.DeviceType == RGBDeviceType.LedStripe ? LedId.LedStripe1 : (DeviceInfo.DeviceType == RGBDeviceType.Fan ? LedId.Fan1 : LedId.Custom1));
LedId referenceId = GetReferenceLed(DeviceInfo.DeviceType);
for (int i = 0; i < DeviceInfo.LedCount; i++)
{
@@ -52,6 +52,24 @@ namespace RGB.NET.Devices.Corsair
/// <inheritdoc />
protected override object CreateLedCustomData(LedId ledId) => _idMapping.TryGetValue(ledId, out CorsairLedId id) ? id : CorsairLedId.Invalid;
protected virtual LedId GetReferenceLed(RGBDeviceType deviceType)
{
switch (deviceType)
{
case RGBDeviceType.LedStripe:
return LedId.LedStripe1;
case RGBDeviceType.Fan:
return LedId.Fan1;
case RGBDeviceType.Cooler:
return LedId.Cooler1;
default:
return LedId.Custom1;
}
}
#endregion
}
}