Implement cloud cover
This commit is contained in:
parent
5ffc1b8b0c
commit
e9114275ae
3 changed files with 75 additions and 10 deletions
22
Weather.h
22
Weather.h
|
@ -1,9 +1,25 @@
|
|||
#define WEATHER_URL "https://api.openweathermap.org/data/2.5/weather?lat=%s&lon=%s&appid=%s"
|
||||
#include <Arduino.h>
|
||||
|
||||
#define WEATHER_URL "http://api.openweathermap.org/data/2.5/weather?lat=%s&lon=%s&appid=%s"
|
||||
|
||||
enum WeatherCondition
|
||||
{
|
||||
Clear,
|
||||
Rain,
|
||||
Thunder,
|
||||
Other
|
||||
};
|
||||
|
||||
class Weather{
|
||||
char _url[100];
|
||||
char _url[120];
|
||||
int _cloudCover;
|
||||
WeatherCondition _condition;
|
||||
String getWeatherJson();
|
||||
WeatherCondition parseCondition(int weatherId);
|
||||
|
||||
public:
|
||||
public:
|
||||
Weather(char *lat, char *lon);
|
||||
void update();
|
||||
int getCloudCover() { return _cloudCover; }
|
||||
WeatherCondition getCondition() { return _condition; }
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue