mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-04-16 11:56:56 -04:00
[FAN Controller] Initial implementation for Asus TUF Fan controller
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <string>
|
||||
#include "Detector.h"
|
||||
#include "FanController_AsusTUFLaptop_Windows.h"
|
||||
#include "RGBController_AsusTUFLaptop_Windows.h"
|
||||
#include "wmi.h"
|
||||
|
||||
@@ -44,8 +45,10 @@ static void DetectAsusTUFLaptopWMIControllers()
|
||||
if(controller)
|
||||
{
|
||||
RGBController* new_controller = new RGBController_AsusTUFLaptopWMI(controller);
|
||||
FanController* fan_controller = new FanController_AsusTUFLaptopWMI(controller);
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(new_controller);
|
||||
ResourceManager::get()->RegisterFanController(fan_controller);
|
||||
}
|
||||
} /* DetectAsusTUFLaptopWMIControllers() */
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
#include "FanController_AsusTUFLaptop_Windows.h"
|
||||
|
||||
|
||||
FanController_AsusTUFLaptopWMI::FanController_AsusTUFLaptopWMI(AsusTUFLaptopController* dev)
|
||||
{
|
||||
controller = dev;
|
||||
name = "ASUS TUF Laptop";
|
||||
description = "WMI Device";
|
||||
location = "\\\\.\\ATKACPI";
|
||||
|
||||
// Coolers RPM reading & current mode retrieval is still WIP
|
||||
fans.resize(2);
|
||||
fans[0].name = "CPU Cooler";
|
||||
fans[0].speed_min = 0;
|
||||
fans[0].speed_max = 2;
|
||||
fans[0].speed_cmd = 1;
|
||||
fans[0].prev_speed_cmd = 1;
|
||||
fans[0].rpm_rdg = 0; // We don't have it, but we don't want an unitialized value either
|
||||
}
|
||||
|
||||
void FanController_AsusTUFLaptopWMI::UpdateControl()
|
||||
{
|
||||
int mode = fans[0].speed_cmd;
|
||||
switch(mode)
|
||||
{
|
||||
case 0:
|
||||
mode = ASUS_WMI_FAN_SPEED_SILENT;
|
||||
break;
|
||||
case 1:
|
||||
mode = ASUS_WMI_FAN_SPEED_NORMAL;
|
||||
break;
|
||||
case 2:
|
||||
mode = ASUS_WMI_FAN_SPEED_TURBO;
|
||||
break;
|
||||
}
|
||||
|
||||
controller->setFanMode(mode);
|
||||
}
|
||||
|
||||
void FanController_AsusTUFLaptopWMI::UpdateReading()
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
#ifndef FANCONTROLLER_ASUSTUFLAPTOPWMI_H
|
||||
#define FANCONTROLLER_ASUSTUFLAPTOPWMI_H
|
||||
|
||||
#include "FanController.h"
|
||||
#include "AsusTUFLaptopController_Windows.h"
|
||||
|
||||
class FanController_AsusTUFLaptopWMI : public FanController
|
||||
{
|
||||
private:
|
||||
AsusTUFLaptopController* controller;
|
||||
|
||||
public:
|
||||
FanController_AsusTUFLaptopWMI(AsusTUFLaptopController* dev);
|
||||
void UpdateControl() override;
|
||||
void UpdateReading() override;
|
||||
};
|
||||
|
||||
#endif // FANCONTROLLER_ASUSTUFLAPTOPWMI_H
|
||||
Reference in New Issue
Block a user