Cleanup, rename
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
#include <sensors/sensors.h>
|
||||
|
||||
#include <HwmonTemperatureSensor.h>
|
||||
#include <Nvidia.h>
|
||||
#include <NvidiaTemperatureSensor.h>
|
||||
#include <Pwm.h>
|
||||
|
||||
#define CONFIG_FILE "/etc/conf.d/sensors"
|
||||
@@ -29,19 +29,17 @@ std::vector<std::shared_ptr<TemperatureSensor>> sensors() {
|
||||
auto tempFeature = sensors_get_subfeature(chipName, feature,
|
||||
SENSORS_SUBFEATURE_TEMP_INPUT);
|
||||
if (tempFeature)
|
||||
sensors.push_back(
|
||||
std::make_shared<HwmonTemperatureSensor>(chipName, tempFeature));
|
||||
sensors.push_back(std::make_shared<HwmonTemperatureSensor>(
|
||||
chipName, feature, tempFeature));
|
||||
}
|
||||
}
|
||||
|
||||
sensors.push_back(std::make_shared<NvidiaTemperatureSensor>());
|
||||
|
||||
return sensors;
|
||||
}
|
||||
|
||||
int main() {
|
||||
Nvidia nv;
|
||||
auto temp = nv.get_gpu_temperature();
|
||||
std::cout << "\nGPU Temp: " << temp << std::endl;
|
||||
|
||||
class PWM pwm;
|
||||
std::cout << '\n';
|
||||
pwm.dumpValues();
|
||||
@@ -53,7 +51,7 @@ int main() {
|
||||
auto tempSensors = sensors();
|
||||
|
||||
for (auto s : tempSensors) {
|
||||
std::cout << s->getTemperature() << std::endl;
|
||||
std::cout << s->name() << ": " << s->temperature() << std::endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user