forked from NHJim/OpenWeather
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathData_Point_Set.h
201 lines (167 loc) · 5.76 KB
/
Data_Point_Set.h
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
// The structures below are the repository for the data values extracted from the
// JSON message. The structures are popolated with the extracted data by the "value()"
// member function in the main OpenWeather.cpp file.
// Some structs contain arrays so watch out for memory consumption. You can
// request a subset of the full weather report but this library grabs all values with
// one GET request to avoid exceeding the 1000 free request count per day (count reset
// at 00:00 UTC). 1000 per day means ~40 per hour. As the weather forcast changes slowly
// the example requests the forecast every 15 minutes, so adapting to reduce memory
// by requesting current, daily, hourly etc forescasts individually can be done.
// The content is zero or "" when first created.
/***************************************************************************************
** Description: Structure for current weather
***************************************************************************************/
typedef struct OW_current {
// current
uint32_t dt = 0;
uint32_t sunrise = 0;
uint32_t sunset = 0;
float temp = 0;
float feels_like = 0;
float pressure = 0;
uint8_t humidity = 0;
float dew_point = 0;
uint8_t clouds = 0;
float uvi = 0;
uint32_t visibility = 0;
float wind_speed = 0;
float wind_gust = 0;
uint16_t wind_deg = 0;
float rain = 0;
float snow = 0;
// current.weather
uint16_t id = 0;
String main;
String description;
String icon;
} OW_current;
/***************************************************************************************
** Description: Structure for hourly weather
***************************************************************************************/
typedef struct OW_hourly {
// hourly
uint32_t dt[MAX_HOURS] = { 0 };
float temp[MAX_HOURS] = { 0 };
float feels_like[MAX_HOURS] = { 0 };
float pressure[MAX_HOURS] = { 0 };
uint8_t humidity[MAX_HOURS] = { 0 };
float dew_point[MAX_HOURS] = { 0 };
uint8_t clouds[MAX_HOURS] = { 0 };
float wind_speed[MAX_HOURS] = { 0 };
float wind_gust[MAX_HOURS] = { 0 };
uint16_t wind_deg[MAX_HOURS] = { 0 };
float rain[MAX_HOURS] = { 0 };
float snow[MAX_HOURS] = { 0 };
// hourly.weather
uint16_t id[MAX_HOURS] = { 0 };
String main[MAX_HOURS];
String description[MAX_HOURS];
String icon[MAX_HOURS];
float pop[MAX_HOURS];
} OW_hourly;
/***************************************************************************************
** Description: Structure for daily weather
***************************************************************************************/
typedef struct OW_daily {
// daily
uint32_t dt[MAX_DAYS] = { 0 }; // dt
uint32_t sunrise[MAX_DAYS] = { 0 };
uint32_t sunset[MAX_DAYS] = { 0 };
// daily.temp
float temp_morn[MAX_DAYS] = { 0 };
float temp_day[MAX_DAYS] = { 0 };
float temp_eve[MAX_DAYS] = { 0 };
float temp_night[MAX_DAYS] = { 0 };
float temp_min[MAX_DAYS] = { 0 };
float temp_max[MAX_DAYS] = { 0 };
// daily.feels_like
float feels_like_morn[MAX_DAYS] = { 0 };
float feels_like_day[MAX_DAYS] = { 0 };
float feels_like_eve[MAX_DAYS] = { 0 };
float feels_like_night[MAX_DAYS] = { 0 };
// daily
float pressure[MAX_DAYS] = { 0 };
uint8_t humidity[MAX_DAYS] = { 0 };
float dew_point[MAX_DAYS] = { 0 };
float wind_speed[MAX_DAYS] = { 0 };
float wind_gust[MAX_DAYS] = { 0 };
uint16_t wind_deg[MAX_DAYS] = { 0 };
uint8_t clouds[MAX_DAYS] = { 0 };
float uvi[MAX_DAYS] = { 0 };
uint32_t visibility[MAX_DAYS] = { 0 };
float rain[MAX_DAYS] = { 0 };
float snow[MAX_DAYS] = { 0 };
// hourly.weather
uint16_t id[MAX_DAYS] = { 0 };
String main[MAX_DAYS];
String description[MAX_DAYS];
String icon[MAX_DAYS];
float pop[MAX_DAYS];
} OW_daily;
// Structures for minimal set of data points for TFT_eSPI examples to reduce RAM needs
/*
typedef struct OW_current {
//float lat = 0;
//float lon = 0;
//String timezone;
// current
uint32_t dt = 0;
uint32_t sunrise = 0;
uint32_t sunset = 0;
float temp = 0;
//float feels_like = 0;
float pressure = 0;
uint8_t humidity = 0;
//float dew_point = 0;
uint8_t clouds = 0;
//uint8_t uvi = 0;
//uint32_t visibility = 0;
float wind_speed = 0;
//float wind_gust = 0;
uint16_t wind_deg = 0;
//float rain = 0;
//float snow = 0;
// current.weather
uint16_t id = 0;
String main;
//String description;
//String icon;
} OW_current;
typedef struct OW_hourly {
} OW_hourly;
typedef struct OW_daily {
// daily
uint32_t dt[MAX_DAYS] = { 0 }; // dt
//uint32_t sunrise = 0;
//uint32_t sunset = 0;
// daily.temp
//float temp_morn[MAX_DAYS] = { 0 };
//float temp_day[MAX_DAYS] = { 0 };
//float temp_eve[MAX_DAYS] = { 0 };
//float temp_night[MAX_DAYS] = { 0 };
float temp_min[MAX_DAYS] = { 0 };
float temp_max[MAX_DAYS] = { 0 };
// daily.feels_like
//float feels_like_morn[MAX_DAYS] = { 0 };
//float feels_like_day[MAX_DAYS] = { 0 };
//float feels_like_eve[MAX_DAYS] = { 0 };
//float feels_like_night[MAX_DAYS] = { 0 };
// daily
//float pressure[MAX_DAYS] = { 0 };
//uint8_t humidity[MAX_DAYS] = { 0 };
//float dew_point[MAX_DAYS] = { 0 };
//float wind_speed[MAX_DAYS] = { 0 };
//float wind_gust[MAX_DAYS] = { 0 };
//uint16_t wind_deg[MAX_DAYS] = { 0 };
//uint8_t clouds[MAX_DAYS] = { 0 };
//uint8_t uvi[MAX_DAYS] = { 0 };
//uint32_t visibility[MAX_DAYS] = { 0 };
//float rain[MAX_DAYS] = { 0 };
//float snow[MAX_DAYS] = { 0 };
// hourly.weather
uint16_t id[MAX_DAYS] = { 0 };
//String main[MAX_DAYS];
//String description[MAX_DAYS];
//String icon[MAX_DAYS];
} OW_daily;
*/