mirror of
https://github.com/Lemonochrme/clover.git
synced 2025-06-08 16:50:50 +02:00
38 lines
No EOL
801 B
C++
38 lines
No EOL
801 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 updateSoilMoistureData(float humidity);
|
|
void updateAirTemperatureData(float temperature);
|
|
void updateAirHumidityData(float humidity);
|
|
void updateLightData(float light);
|
|
private:
|
|
// Singleton
|
|
DataHandler();
|
|
~DataHandler();
|
|
DataHandler(const DataHandler&) = delete;
|
|
DataHandler& operator=(const DataHandler&) = delete;
|
|
|
|
// Variables
|
|
float soilMoisture;
|
|
float airTemperature;
|
|
float airHumidity;
|
|
float light;
|
|
|
|
// Fonctions
|
|
String buildJson();
|
|
};
|
|
|
|
#endif |