-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSmartConfig.h
More file actions
57 lines (44 loc) · 1.59 KB
/
SmartConfig.h
File metadata and controls
57 lines (44 loc) · 1.59 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
53
54
55
56
57
#ifndef _SMART_CONFIG
#define _SMART_CONFIG
#include "Arduino.h"
#include <EEPROM.h>
#include <ESP8266WiFi.h>
#include <SpritzCipher.h>
#include <ESP8266httpUpdate.h>
#include <ArduinoJson.h>
#include "types.h"
class SmartConfig {
private:
configStruct c;
char OTAIPAddress[16];
float latitude;
float longitude;
int dstOffset;
int rawOffset;
bool timezoneStatus;
bool locationStatus;
unsigned char key[32] = {'k','a','u','o','k','2','9','u','a','9','$','3','8','7','a','8','9','d','a','8','n','w','?','u','l','s','U','9','3','4','n','o'};
void getLatLong();
public:
SmartConfig();
// getters
unsigned char getRoomNumber() { return c.roomNumber; };
bool getTimezoneStatus() { return timezoneStatus; };
unsigned char getFloorNumber() { return c.floorNumber; };
char *getSSID() { return c.ssid; };
long getTimezoneOffset() { return dstOffset + rawOffset; };
char getAutoHeatTemperature() { return c.autoHeatTemperature; };
char getAutoCoolTemperature() { return c.autoCoolTemperature; };
char *getZipcode() { return c.zipcode; };
char *getGoogleMapsAPIKey() { return c.googleMapsAPIKey; };
char *getOpenWeatherMapAPIKey() { return c.openWeatherMapAPIKey; };
bool hasTempSensor() { return c.hasTempSensor; };
// setters - because this should only be used in initial setup (or reset) of a device, I didn't go out of my way here
void setConfig(configStruct);
// methods
void queryTimezone(long int);
void setup();
void setup(const char *);
void OTAUpdate(const char *, const char *);
};
#endif