-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.cpp
34 lines (28 loc) · 1.02 KB
/
config.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* Class to persist the iotFan module configuration data structure to EEPROM
* Xavier Grosjean 2018
* Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License
*/
#include "config.h"
FanConfigClass::FanConfigClass(unsigned int version, const char* name):ModuleConfigClass(version, "iotfan", name, sizeof(FanConfigStruct)) {
}
/**
* Reset the config data structure to the default values.
* This is done each time the data structure version is different from the one saved in EEPROM
* NB: version and name are handled by base class
*/
void FanConfigClass::initFromDefault() {
ModuleConfigClass::initFromDefault(); // handles version and name init, ssid and pwd
setBrightness(60);
}
const char* FanConfigClass::getDefaultUIClassName() {
Serial.println("FanConfigClass::getDefaultUIClassName");
return "fanUIClass";
}
/**
* Return the typed data structure object
*
*/
FanConfigStruct* FanConfigClass::_getDataPtr(void) {
return (FanConfigStruct*)ModuleConfigClass::_getDataPtr();
}