2020-09-19 17:24:34 +00:00
|
|
|
/*
|
|
|
|
* ESP8266 RGBW controller
|
|
|
|
* Copyright 2020 (c) Mark van Renswoude
|
|
|
|
*
|
|
|
|
* https://git.x2software.net/pub/RGBWifi
|
|
|
|
*/
|
|
|
|
#ifndef __settingsjson
|
|
|
|
#define __settingsjson
|
|
|
|
|
2020-09-20 09:08:20 +00:00
|
|
|
#include <ArduinoJson.h>
|
2020-09-19 17:24:34 +00:00
|
|
|
#include "../debug.h"
|
|
|
|
|
|
|
|
class AbstractJsonSettings
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
virtual const char* getFilename() = 0;
|
|
|
|
virtual const char* getDebugPrefix() = 0;
|
|
|
|
|
|
|
|
public:
|
|
|
|
void read();
|
|
|
|
void write();
|
|
|
|
|
|
|
|
virtual void toJson(Print &print) = 0;
|
2020-09-20 09:08:20 +00:00
|
|
|
virtual bool fromJson(JsonVariant &jsonDocument, bool* changed) = 0;
|
2020-09-19 17:24:34 +00:00
|
|
|
|
2020-09-20 09:08:20 +00:00
|
|
|
bool fromJson(char* data, bool* changed);
|
2020-09-19 17:24:34 +00:00
|
|
|
bool fromJson(char* data);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|