mirror of
https://github.com/Lemonochrme/clover.git
synced 2025-06-08 08:40:50 +02:00
31 lines
No EOL
629 B
C++
31 lines
No EOL
629 B
C++
#ifndef DATAHANDLER_HPP
|
|
#define DATAHANDLER_HPP
|
|
|
|
#include <ArduinoJson.h>
|
|
|
|
class DataHandler {
|
|
public:
|
|
// Singleton
|
|
static DataHandler& GetInstance()
|
|
{
|
|
static DataHandler instance;
|
|
return instance;
|
|
}
|
|
|
|
// Public functions
|
|
String getJsonData();
|
|
void updateTemperatureData(float temperature);
|
|
void updateHumidityData(float humidity);
|
|
|
|
private:
|
|
// Singleton
|
|
DataHandler();
|
|
~DataHandler();
|
|
DataHandler(const DataHandler&) = delete;
|
|
DataHandler& operator=(const DataHandler&) = delete;
|
|
float temperature;
|
|
float humidity;
|
|
String buildJson();
|
|
};
|
|
|
|
#endif |