-
Notifications
You must be signed in to change notification settings - Fork 1
/
NzxtKrakenPlugin.cs
60 lines (53 loc) · 1.82 KB
/
NzxtKrakenPlugin.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;
using System.Collections.Generic;
using System.Linq;
using FanControl.Plugins;
using HidSharp;
namespace FanControl.NzxtKraken
{
public class NzxtKrakenPlugin : IPlugin2
{
internal List<NzxtKrakenDevice> devices = new List<NzxtKrakenDevice>();
internal IPluginLogger logger;
public string Name => "NzxtKrakenPlugin";
public NzxtKrakenPlugin(IPluginLogger pluginLogger)
{
logger = pluginLogger;
}
public void Initialize() {}
public void Load(IPluginSensorsContainer _container)
{
var hidDevices = DeviceList.Local.GetHidDevices(0x1E71);
foreach (var hidDevice in hidDevices)
{
if(NzxtKrakenX3.SupportsDevice(hidDevice))
{
devices.Add(new NzxtKrakenX3(hidDevice, logger, _container));
} else if (NzxtKrakenZ3.SupportsDevice(hidDevice))
{
devices.Add(new NzxtKrakenZ3(hidDevice, logger, _container));
} else if (NzxtKrakenX2.SupportsDevice(hidDevice))
{
devices.Add(new NzxtKrakenX2(hidDevice, logger, _container));
} else if (NzxtKrakenElite.SupportsDevice(hidDevice))
{
devices.Add(new NzxtKrakenElite(hidDevice, logger, _container));
} else if (NzxtKraken2023.SupportsDevice(hidDevice))
{
devices.Add(new NzxtKraken2023(hidDevice, logger, _container));
}
}
}
public void Close()
{
devices.Clear();
}
public void Update()
{
foreach (NzxtKrakenDevice device in devices)
{
device.Update();
}
}
}
}