-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweatherdisplay.go
425 lines (422 loc) · 12.3 KB
/
weatherdisplay.go
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
// SPDX-License-Identifier: AGPL-3.0-or-later
package gowihi
// https://saratoga-weather.org/wdparser/index.php?site=https%3A%2F%2Fvreme.in.rs%2Fsubotica%2F&submit=Submit
type WeatherDisplayRawData struct {
// knots
Wind_speed_avg float64 // current
// knots
Wind_speed float64
// compass; 169 degrees (S)
Wind_direction float64
// celsius
// by default we refer to the outside temperature simply as temperature
Temperature float64
// percent
// similarly "outside humidity" is simply humidity
Humidity float64
// hPa
Barometer float64
// millimeters
Cum_rain_daily float64
Cum_rain_month float64
Cum_rain_year float64
// rain rate mm/min
Rain_rate float64
Rain_rate_max float64
// celsius
Indoor_temperature float64
// percentage
Indoor_humidity float64
// icon (integer)
Forecast_icon int16
// celsius
Extra_temp_wmr968 float64
// percentage
Extra_hum_wmr968 float64
// millimeters
Cum_rain_yest float64
// celsius (optional)
Extra_temp_sensor_1 float64
Extra_temp_sensor_2 float64
Extra_temp_sensor_3 float64
Extra_temp_sensor_4 float64
Extra_temp_sensor_5 float64
Extra_temp_sensor_6 float64
Extra_hum_sensor_1 float64
Extra_hum_sensor_2 float64
Extra_hum_sensor_3 float64
// time
Hour int16
Minute int16
Seconds int16 // string
Station_name_time string
// integer
Lightning_count_since_noon int8
// percentage
Solar_percentage_of_max float64
// time
Day int8
Month int8
// percentage
Batt_1 float64
Batt_2 float64
Batt_3 float64
Batt_4 float64
Batt_5 float64
Batt_6 float64
Batt_7 float64
// celsius
Wind_chill float64
Humidex float64
Temperature_max float64
Temperature_min float64
// icon (integer)
Curr_condition_icon int16
// weather description
Weather_descrip string
// hPa
Baro_trend_last_hr float64
// knots
Windspeed_hr_1 float64
Windspeed_hr_2 float64
Windspeed_hr_3 float64
Windspeed_hr_4 float64
Windspeed_hr_5 float64
Windspeed_hr_6 float64
Windspeed_hr_7 float64
Windspeed_hr_8 float64
Windspeed_hr_9 float64
Windspeed_hr_10 float64
Windspeed_hr_11 float64
Windspeed_hr_12 float64
Windspeed_hr_13 float64
Windspeed_hr_14 float64
Windspeed_hr_15 float64
Windspeed_hr_16 float64
Windspeed_hr_17 float64
Windspeed_hr_18 float64
Windspeed_hr_19 float64
Windspeed_hr_20 float64
Wind_gust_max float64
// celsius
Dewpoint float64
// feet
Cloud_height float64
// date (string)
Date string
// celsius
Humidex_max float64
Humidex_min float64
Max_windchill float64
Min_windchill float64
// number (float)
Uv float64
// knots
Hr_windspeed_1 float64
Hr_windspeed_2 float64
Hr_windspeed_3 float64
Hr_windspeed_4 float64
Hr_windspeed_5 float64
Hr_windspeed_6 float64
Hr_windspeed_7 float64
Hr_windspeed_8 float64
Hr_windspeed_9 float64
Hr_windspeed_10 float64
// celsius
Hr_temp_1 float64
Hr_temp_2 float64
Hr_temp_3 float64
Hr_temp_4 float64
Hr_temp_5 float64
Hr_temp_6 float64
Hr_temp_7 float64
Hr_temp_8 float64
Hr_temp_9 float64
Hr_temp_10 float64
// mm
Hr_rain_1 float64
Hr_rain_2 float64
Hr_rain_3 float64
Hr_rain_4 float64
Hr_rain_5 float64
Hr_rain_6 float64
Hr_rain_7 float64
Hr_rain_8 float64
Hr_rain_9 float64
Hr_rain_10 float64
// celsius
Heat_index_max float64
Heat_index_min float64
Heat_index float64
// knots
Max_avg_windspeed_today float64
Lightning_counts_last_min int8
Time_of_last_lighting_count string
Date_of_last_lighting_count string
Wind_avg_direction float64
// number
Nexstorm_distance_last_strike float64
// compass
Nexstorm_bearing_last_strike float64
// celsius
Extra_temp_sensor_7 float64
Extra_temp_sensor_8 float64
// percentage
Extra_hum_sensor_4 float64
Extra_hum_sensor_5 float64
Extra_hum_sensor_6 float64
Extra_hum_sensor_7 float64
Extra_hum_sensor_8 float64
// number (float)
Vp_solar_vm2 float64
// celsius
Indoor_temperature_max float64
Indoor_temperature_min float64
// apparent temp
Apparent_temp float64
// hPa
Barometer_max float64
Barometer_min float64
// knots
Max_gust_last_hr float64
// time
Max_gust_last_hr_time string
Max_gust_today_time string
// celsius
Apparent_temp_max float64
Apparent_temp_min float64
Dewpoint_max float64
Dewpoint_min float64
// knots
Max_gust_in_last_min float64
// year (int)
Current_year string
// celsius
Thsw_index float64
// "bool" but (-1/0/1)
Temp_trend int8
Humidity_trend int8
Humidex_trend int8
// compass
Hr_wind_direction_1 int8
Hr_wind_direction_2 int8
Hr_wind_direction_3 int8
Hr_wind_direction_4 int8
Hr_wind_direction_5 int8
Hr_wind_direction_6 int8
Hr_wind_direction_7 int8
Hr_wind_direction_8 int8
Hr_wind_direction_9 int8
Hr_wind_direction_10 int8
// number (0-15)
Vp_leaf_wetness int8
// number (centibars)
Vp_soil_moisture float64
// knots
Ten_minute_avg_wind_speed float64
// celsius
Wet_bulb_temp float64
// time
Latitude float64
Longitude float64
// millimeters
Nine_am_reset_rain_total float64
// percent
Daily_high_humditiy float64
Daily_low_humidity float64
// mm
Midnight_reset_rain_total float64
// time
Time_of_daily_low_windchill string
// watts
Current_cost_channel_1 float64
Current_cost_channel_2 float64
Current_cost_channel_3 float64
Current_cost_channel_4 float64
Current_cost_channel_5 float64
Current_cost_channel_6 float64
// number (km) (9am or midnight reset)
Daily_wind_run float64
Time_daily_max_temp string
Time_daily_min_temp string
// compass
Ten_minute_avg_wind_direction int8
}
func NewRawWeatherDisplayData() *WeatherDisplayRawData {
return &WeatherDisplayRawData{
Wind_speed_avg: -1.0, // current
Wind_speed: -1.0,
Wind_direction: -1.0,
Temperature: -1.0,
Humidity: -1.0,
Barometer: -1.0,
Cum_rain_daily: -1.0,
Cum_rain_month: -1.0,
Cum_rain_year: -1.0,
Rain_rate: -1.0,
Rain_rate_max: -1.0,
Indoor_temperature: -1.0,
Indoor_humidity: -1.0,
Forecast_icon: -1,
Extra_temp_wmr968: -1.0,
Extra_hum_wmr968: -1.0,
Cum_rain_yest: -1.0,
Extra_temp_sensor_1: -1.0,
Extra_temp_sensor_2: -1.0,
Extra_temp_sensor_3: -1.0,
Extra_temp_sensor_4: -1.0,
Extra_temp_sensor_5: -1.0,
Extra_temp_sensor_6: -1.0,
Extra_hum_sensor_1: -1.0,
Extra_hum_sensor_2: -1.0,
Extra_hum_sensor_3: -1.0,
Hour: -1,
Minute: -1,
Seconds: -1,
Station_name_time: "uninitialized",
Lightning_count_since_noon: -1,
Solar_percentage_of_max: -1.0,
Day: -1,
Month: -1,
Batt_1: -1.0,
Batt_2: -1.0,
Batt_3: -1.0,
Batt_4: -1.0,
Batt_5: -1.0,
Batt_6: -1.0,
Batt_7: -1.0,
Wind_chill: -1.0,
Humidex: -1.0,
Temperature_max: -1.0,
Temperature_min: -1.0,
Curr_condition_icon: -1,
Weather_descrip: "uninitialized",
Baro_trend_last_hr: -1.0,
Windspeed_hr_1: -1.0,
Windspeed_hr_2: -1.0,
Windspeed_hr_3: -1.0,
Windspeed_hr_4: -1.0,
Windspeed_hr_5: -1.0,
Windspeed_hr_6: -1.0,
Windspeed_hr_7: -1.0,
Windspeed_hr_8: -1.0,
Windspeed_hr_9: -1.0,
Windspeed_hr_10: -1.0,
Windspeed_hr_11: -1.0,
Windspeed_hr_12: -1.0,
Windspeed_hr_13: -1.0,
Windspeed_hr_14: -1.0,
Windspeed_hr_15: -1.0,
Windspeed_hr_16: -1.0,
Windspeed_hr_17: -1.0,
Windspeed_hr_18: -1.0,
Windspeed_hr_19: -1.0,
Windspeed_hr_20: -1.0,
Wind_gust_max: -1.0,
Dewpoint: -1.0,
Cloud_height: -1.0,
Date: "uninitialized",
Humidex_max: -1.0,
Humidex_min: -1.0,
Max_windchill: -1.0,
Min_windchill: -1.0,
Uv: -1.0,
Hr_windspeed_1: -1.0,
Hr_windspeed_2: -1.0,
Hr_windspeed_3: -1.0,
Hr_windspeed_4: -1.0,
Hr_windspeed_5: -1.0,
Hr_windspeed_6: -1.0,
Hr_windspeed_7: -1.0,
Hr_windspeed_8: -1.0,
Hr_windspeed_9: -1.0,
Hr_windspeed_10: -1.0,
Hr_temp_1: -1.0,
Hr_temp_2: -1.0,
Hr_temp_3: -1.0,
Hr_temp_4: -1.0,
Hr_temp_5: -1.0,
Hr_temp_6: -1.0,
Hr_temp_7: -1.0,
Hr_temp_8: -1.0,
Hr_temp_9: -1.0,
Hr_temp_10: -1.0,
Hr_rain_1: -1.0,
Hr_rain_2: -1.0,
Hr_rain_3: -1.0,
Hr_rain_4: -1.0,
Hr_rain_5: -1.0,
Hr_rain_6: -1.0,
Hr_rain_7: -1.0,
Hr_rain_8: -1.0,
Hr_rain_9: -1.0,
Hr_rain_10: -1.0,
Heat_index_max: -1.0,
Heat_index_min: -1.0,
Heat_index: -1.0,
Max_avg_windspeed_today: -1.0,
Lightning_counts_last_min: -1,
Time_of_last_lighting_count: "uninitialized",
Date_of_last_lighting_count: "uninitialized",
Wind_avg_direction: -1.0,
Nexstorm_distance_last_strike: -1.0,
Nexstorm_bearing_last_strike: -1.0,
Extra_temp_sensor_7: -1.0,
Extra_temp_sensor_8: -1.0,
Extra_hum_sensor_4: -1.0,
Extra_hum_sensor_5: -1.0,
Extra_hum_sensor_6: -1.0,
Extra_hum_sensor_7: -1.0,
Extra_hum_sensor_8: -1.0,
Vp_solar_vm2: -1.0,
Indoor_temperature_max: -1.0,
Indoor_temperature_min: -1.0,
Apparent_temp: -1.0,
Barometer_max: -1.0,
Barometer_min: -1.0,
Max_gust_last_hr: -1.0,
Max_gust_last_hr_time: "uninitialized",
Max_gust_today_time: "uninitialized",
Apparent_temp_max: -1.0,
Apparent_temp_min: -1.0,
Dewpoint_max: -1.0,
Dewpoint_min: -1.0,
Max_gust_in_last_min: -1.0,
Current_year: "uninitialized",
Thsw_index: -1.0,
Temp_trend: -1,
Humidity_trend: -1,
Humidex_trend: -1,
Hr_wind_direction_1: -1,
Hr_wind_direction_2: -1,
Hr_wind_direction_3: -1,
Hr_wind_direction_4: -1,
Hr_wind_direction_5: -1,
Hr_wind_direction_6: -1,
Hr_wind_direction_7: -1,
Hr_wind_direction_8: -1,
Hr_wind_direction_9: -1,
Hr_wind_direction_10: -1,
Vp_leaf_wetness: -1,
Vp_soil_moisture: -1.0,
Ten_minute_avg_wind_speed: -1.0,
Wet_bulb_temp: -1.0,
Latitude: -1.0,
Longitude: -1.0,
Nine_am_reset_rain_total: -1.0,
Daily_high_humditiy: -1.0,
Daily_low_humidity: -1.0,
Midnight_reset_rain_total: -1.0,
Time_of_daily_low_windchill: "uninitialized",
Current_cost_channel_1: -1.0,
Current_cost_channel_2: -1.0,
Current_cost_channel_3: -1.0,
Current_cost_channel_4: -1.0,
Current_cost_channel_5: -1.0,
Current_cost_channel_6: -1.0,
Daily_wind_run: -1.0,
Time_daily_max_temp: "uninitialized",
Time_daily_min_temp: "uninitialized",
Ten_minute_avg_wind_direction: -1,
}
}