Switch to OWM xxxById functions
Requires weather station library 1.6.1+. Fixes #81
This commit is contained in:
@@ -286,7 +286,7 @@ void updateData() {
|
|||||||
OpenWeatherMapCurrent *currentWeatherClient = new OpenWeatherMapCurrent();
|
OpenWeatherMapCurrent *currentWeatherClient = new OpenWeatherMapCurrent();
|
||||||
currentWeatherClient->setMetric(IS_METRIC);
|
currentWeatherClient->setMetric(IS_METRIC);
|
||||||
currentWeatherClient->setLanguage(OPEN_WEATHER_MAP_LANGUAGE);
|
currentWeatherClient->setLanguage(OPEN_WEATHER_MAP_LANGUAGE);
|
||||||
currentWeatherClient->updateCurrent(¤tWeather, OPEN_WEATHER_MAP_APP_ID, OPEN_WEATHER_MAP_LOCATION);
|
currentWeatherClient->updateCurrentById(¤tWeather, OPEN_WEATHER_MAP_APP_ID, OPEN_WEATHER_MAP_LOCATION_ID);
|
||||||
delete currentWeatherClient;
|
delete currentWeatherClient;
|
||||||
currentWeatherClient = nullptr;
|
currentWeatherClient = nullptr;
|
||||||
|
|
||||||
@@ -296,7 +296,7 @@ void updateData() {
|
|||||||
forecastClient->setLanguage(OPEN_WEATHER_MAP_LANGUAGE);
|
forecastClient->setLanguage(OPEN_WEATHER_MAP_LANGUAGE);
|
||||||
uint8_t allowedHours[] = {12, 0};
|
uint8_t allowedHours[] = {12, 0};
|
||||||
forecastClient->setAllowedHours(allowedHours, sizeof(allowedHours));
|
forecastClient->setAllowedHours(allowedHours, sizeof(allowedHours));
|
||||||
forecastClient->updateForecasts(forecasts, OPEN_WEATHER_MAP_APP_ID, OPEN_WEATHER_MAP_LOCATION, MAX_FORECASTS);
|
forecastClient->updateForecastsById(forecasts, OPEN_WEATHER_MAP_APP_ID, OPEN_WEATHER_MAP_LOCATION_ID, MAX_FORECASTS);
|
||||||
delete forecastClient;
|
delete forecastClient;
|
||||||
forecastClient = nullptr;
|
forecastClient = nullptr;
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,13 @@ const int SLEEP_INTERVAL_SECS = 0; // Going to Sleep after idle times, set 0 f
|
|||||||
// OpenWeatherMap Settings
|
// OpenWeatherMap Settings
|
||||||
// Sign up here to get an API key: https://docs.thingpulse.com/how-tos/openweathermap-key/
|
// Sign up here to get an API key: https://docs.thingpulse.com/how-tos/openweathermap-key/
|
||||||
String OPEN_WEATHER_MAP_APP_ID = "";
|
String OPEN_WEATHER_MAP_APP_ID = "";
|
||||||
String OPEN_WEATHER_MAP_LOCATION = "Zurich,CH";
|
/*
|
||||||
|
Go to https://openweathermap.org/find?q= and search for a location. Go through the
|
||||||
|
result set and select the entry closest to the actual location you want to display
|
||||||
|
data for. It'll be a URL like https://openweathermap.org/city/2657896. The number
|
||||||
|
at the end is what you assign to the constant below.
|
||||||
|
*/
|
||||||
|
String OPEN_WEATHER_MAP_LOCATION_ID = "2657896";
|
||||||
/*
|
/*
|
||||||
Arabic -> ar, Bulgarian -> bg, Catalan -> ca, Czech -> cz, German -> de, Greek -> el,
|
Arabic -> ar, Bulgarian -> bg, Catalan -> ca, Czech -> cz, German -> de, Greek -> el,
|
||||||
English -> en, Persian (Farsi) -> fa, Finnish -> fi, French -> fr, Galician -> gl,
|
English -> en, Persian (Farsi) -> fa, Finnish -> fi, French -> fr, Galician -> gl,
|
||||||
|
|||||||
Reference in New Issue
Block a user