Remove aggregator, fix changing HWMON paths

Add logic to use actual device paths for the PWM sensors instead of their
standart HWMON paths.

This was done after noticing that due to the load order of kernel modules,
the index of HWMON paths could change.
This commit is contained in:
Tabascl
2024-07-07 22:19:27 +02:00
parent e2509cea8b
commit 78b2a62643
7 changed files with 37 additions and 21 deletions

View File

@@ -23,7 +23,6 @@ public:
void DoFanControl();
private:
int AggregateTemperature();
void PrintInfo();
bool ExceedsHysteresis(int temperature);
void ApplyFanPower(std::shared_ptr<Fan> fan, int targetFanPower);

View File

@@ -12,7 +12,7 @@ enum class PWM_MODE { DC = 0, PWM };
class PWMControl : public Printable, public Serializable {
public:
PWMControl(std::string controlPath);
PWMControl(std::string controlPath, int deviceIndex);
~PWMControl();
void SetPower(int percent);
@@ -26,9 +26,11 @@ public:
json toJson() const override;
private:
std::string mConfigPath;
std::string mControlPath;
std::string mEnablePath;
std::string mModePath;
int mDeviceIndex;
std::string mInitialEnable;
std::string mInitialMode;