-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig_manager.h
More file actions
52 lines (43 loc) · 1.47 KB
/
config_manager.h
File metadata and controls
52 lines (43 loc) · 1.47 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#pragma once
#include <Arduino.h>
#ifdef ESP32
#include <Preferences.h>
#else
#include "Preferences.h"
#endif
#include "bin_type.h"
class ConfigManager {
public:
static void begin();
static void processSetupFlag();
static bool isConfigured();
static bool isInForcedSetupMode();
static void setForcedSetupFlag(const String& flag);
static String getCalendarId();
static bool setCalendarId(const String& id);
static int getState();
static bool setState(int state);
static time_t getCompletedTime();
static bool setCompletedTime(time_t time);
static String getWifiSSID();
static String getWifiPassword();
static bool setWifiCredentials(const String& ssid, const String& password);
static time_t getBinTakenOutTime();
static bool setBinTakenOutTime(time_t time);
static BinType getBinType();
static bool setBinType(BinType type);
#ifdef TESTING
static void clearForTesting();
#endif
private:
static Preferences preferences;
static const char* PREF_NAMESPACE;
static const char* KEY_CALENDAR_ID;
static const char* KEY_STATE;
static const char* KEY_COMPLETED_TIME;
static const char* KEY_FORCE_SETUP;
static const char* KEY_WIFI_SSID;
static const char* KEY_WIFI_PASS;
static const char* KEY_BIN_TAKEN_OUT;
static const char* KEY_BIN_TYPE;
};