first commit
This commit is contained in:
commit
0ef2017d18
28 files changed
+1882
No files matched your search
@@ -0,0 +1,32 @@
|
||||
#ifndef AMBIENT_WEATHER_H
|
||||
#define AMBIENT_WEATHER_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "esp_err.h"
|
||||
|
||||
/*
|
||||
* Fields mirror the Ambient Weather device data spec:
|
||||
* https://github.com/ambient-weather/api-docs/wiki/Device-Data-Specs
|
||||
*
|
||||
* Note the API reports no textual "condition" or "icon" -- it is a personal
|
||||
* weather station feed, not a forecast service.
|
||||
*/
|
||||
typedef struct {
|
||||
float temp_f;
|
||||
float humidity; /* percent */
|
||||
float wind_mph;
|
||||
bool has_temp;
|
||||
bool has_humidity;
|
||||
bool has_wind;
|
||||
time_t last_update;
|
||||
} weather_data_t;
|
||||
|
||||
esp_err_t weather_init(void);
|
||||
esp_err_t weather_update(weather_data_t *data);
|
||||
void weather_get_string(const weather_data_t *data, char *buf, size_t len);
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user