rgbwifi/src/settings/system.h

51 lines
1.2 KiB
C++

/*
* ESP8266 RGBW controller
* Copyright 2020 (c) Mark van Renswoude
*
* https://git.x2software.net/pub/RGBWifi
*/
#ifndef __settingssystem
#define __settingssystem
#include <Arduino.h>
#include <stdint.h>
#include <stdbool.h>
#include "../charproperties.h"
#include "./abstractjson.h"
class SystemSettings : public AbstractJsonSettings
{
private:
uint8_t mPinLEDAP = 4;
uint8_t mPinLEDSTA = 5;
uint8_t mPinAPButton = 2;
uint16_t mLEDCount = 60;
protected:
virtual const char* getFilename() { return SystemSettingsFile; };
virtual const char* getDebugPrefix() { return "SystemSettings"; };
public:
SystemSettings()
{
}
void toJson(Print &print);
bool fromJson(JsonVariant &jsonDocument, bool* changed);
uint8_t pinLEDAP() { return mPinLEDAP; }
void pinLEDAP(uint8_t value) { mPinLEDAP = value; }
uint8_t pinLEDSTA() { return mPinLEDSTA; }
void pinLEDSTA(uint8_t value) { mPinLEDSTA = value; }
uint8_t pinAPButton() { return mPinAPButton; }
void pinAPButton(uint8_t value) { mPinAPButton = value; }
uint16_t ledCount() { return mLEDCount; }
void ledCount(uint16_t value) { mLEDCount = value; }
};
#endif