-
Notifications
You must be signed in to change notification settings - Fork 1
/
ClevoBridge.cs
43 lines (36 loc) · 1.1 KB
/
ClevoBridge.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
using System;
using Sverto.Clevo.Keyboard;
using Sverto.Clevo.Fans;
using Sverto.Clevo.Sensors;
namespace Sverto.Clevo
{
public class ClevoBridge : IDisposable
{
protected const string _WmiPath = "root\\WMI";
protected const string _WmiQuery = "SELECT * FROM CLEVO_GET";
protected WmiProvider _Wmi;
public KeyboardLedControl KeyboardLed { get; }
public FanControl Fan { get; }
public SensorControl Sensor { get; }
public ClevoBridge()
{
_Wmi = new WmiProvider(_WmiPath, _WmiQuery);
KeyboardLed = new KeyboardLedControl(this);
Fan = new FanControl(this);
Sensor = new SensorControl(); // this);
}
public void RunMethod(string methodName, uint value)
{
_Wmi.RunMethod(methodName, new object[] { value });
}
public uint RunMethod(string methodName)
{
return Convert.ToUInt32(_Wmi.RunMethod(methodName));
}
public void Dispose()
{
_Wmi?.Dispose();
Sensor.Dispose();
}
}
}