Added memory- and cooler-support introduced with the new corsair-SDK-version

This commit is contained in:
DarthAffe committed 2018-10-06 10:20:34 +02:00
1 parent 6995259ea8
commit 6c225bbfc4
10 files changed
+425 -3

No files matched your search

@@ -34,7 +34,7 @@ namespace RGB.NET.Devices.Corsair
/// <param name="referenceCorsairLed">The id of the first led of this device.</param>
internal CorsairCustomRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo, _CorsairChannelDeviceInfo channelDeviceInfo,
CorsairLedId referenceCorsairLed, Dictionary<string, int> modelCounter)
: base(deviceIndex, channelDeviceInfo.type == CorsairChannelDeviceType.Strip ? RGBDeviceType.LedStripe : RGBDeviceType.Fan, nativeInfo,
: base(deviceIndex, GetDeviceType(channelDeviceInfo.type), nativeInfo,
GetModelName(channelDeviceInfo.type), modelCounter)
{
this.ReferenceCorsairLed = referenceCorsairLed;
@@ -46,6 +46,31 @@ namespace RGB.NET.Devices.Corsair
#region Methods
private static RGBDeviceType GetDeviceType(CorsairChannelDeviceType deviceType)
{
switch (deviceType)
{
case CorsairChannelDeviceType.Invalid:
return RGBDeviceType.Unknown;
case CorsairChannelDeviceType.FanHD:
case CorsairChannelDeviceType.FanSP:
case CorsairChannelDeviceType.FanLL:
case CorsairChannelDeviceType.FanML:
case CorsairChannelDeviceType.DAP:
return RGBDeviceType.Fan;
case CorsairChannelDeviceType.Strip:
return RGBDeviceType.LedStripe;
case CorsairChannelDeviceType.Pump:
return RGBDeviceType.Cooler;
default:
throw new ArgumentOutOfRangeException(nameof(deviceType), deviceType, null);
}
}
private static string GetModelName(CorsairChannelDeviceType deviceType)
{
switch (deviceType)
@@ -71,6 +96,9 @@ namespace RGB.NET.Devices.Corsair
case CorsairChannelDeviceType.DAP:
return "DAP Fan";
case CorsairChannelDeviceType.Pump:
return "Pump";
default:
throw new ArgumentOutOfRangeException(nameof(deviceType), deviceType, null);
}