Add mapping logic, refactor stuff

This commit is contained in:
2022-09-19 20:02:18 +02:00
parent dccd6f2773
commit f507912623
19 changed files with 275 additions and 187 deletions

11
app/src/fan/HwmonFan.cxx Normal file
View File

@@ -0,0 +1,11 @@
#include <fan/HwmonFan.h>
using namespace std;
HwmonFan::HwmonFan(shared_ptr<PwmControl> pwmControl,
shared_ptr<Sensor> rpmSensor)
: mPwmControl(pwmControl), mRpmSensor(rpmSensor) {}
void HwmonFan::pwm(int percent) { mPwmControl->pwm(percent); }
int HwmonFan::rpm() { return mRpmSensor->value(); }

View File

@@ -64,3 +64,7 @@ void PwmControl::reset() {
ostrm.close();
}
const string PwmControl::toString() const {
return fs::path(mControlPath).filename();
}