Implement HwmonTemperatureSensor, add serialization

This commit is contained in:
2022-09-07 23:11:57 +02:00
parent f152f1471d
commit 20cb22de01
4 changed files with 46 additions and 1 deletions

View File

@@ -1,11 +1,18 @@
#ifndef HWMONTEMPERATURESENSOR_H_
#define HWMONTEMPERATURESENSOR_H_
#include <sensors/sensors.h>
#include <TemperatureSensor.h>
class HwmonTemperatureSensor : public TemperatureSensor {
public:
int getTemperature() override;
std::string toJson() override;
private:
sensors_chip_name mChipName;
sensors_subfeature mSubFeature;
};
#endif // HWMONTEMPERATURESENSOR_H_

View File

@@ -1,9 +1,12 @@
#ifndef TEMPERATURESENSOR_H_
#define TEMPERATURESENSOR_H_
#include <iostream>
class TemperatureSensor {
public:
virtual int getTemperature() = 0;
virtual std::string toJson() = 0;
};
#endif // TEMPERATURESENSOR_H_