From 92d9c95fc6f355e63e760073f58bea3b89f58f51 Mon Sep 17 00:00:00 2001 From: Jessica Hershey <60907719+JHershey69@users.noreply.github.com> Date: Thu, 22 Feb 2024 20:00:34 -0500 Subject: [PATCH 1/3] Update OpenWeatherOneCall.cpp API change to 3.0 --- src/OpenWeatherOneCall.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/OpenWeatherOneCall.cpp b/src/OpenWeatherOneCall.cpp index 722ae31..a536588 100644 --- a/src/OpenWeatherOneCall.cpp +++ b/src/OpenWeatherOneCall.cpp @@ -20,12 +20,12 @@ OpenWeatherOneCall::OpenWeatherOneCall() } // For Normal Weather calls ************* -#define DS_URL1 "https://api.openweathermap.org/data/2.5/onecall" +#define DS_URL1 "https://api.openweathermap.org/data/3.0/onecall" char DS_URL2[100]; #define DS_URL3 "&appid=" // For Air Quality calls current ************* -#define AQ_URL1 "https://api.openweathermap.org/data/2.5/air_pollution?lat=" +#define AQ_URL1 "https://api.openweathermap.org/data/3.0/air_pollution?lat=" #define AQ_URL2 "&lon=" #define AQ_URL3 "&appid=" @@ -33,11 +33,11 @@ char DS_URL2[100]; // For Historical Weather Calls ********** -#define TS_URL1 "https://api.openweathermap.org/data/2.5/onecall/timemachine" +#define TS_URL1 "https://api.openweathermap.org/data/3.0/onecall/timemachine" #define TS_URL2 "&dt=" // For CITY Id calls -#define CI_URL1 "api.openweathermap.org/data/2.5/weather?id=" +#define CI_URL1 "api.openweathermap.org/data/3.0/weather?id=" #define CI_URL2 "&appid=" #define SIZEOF(a) sizeof(a)/sizeof(*a) @@ -152,7 +152,7 @@ int OpenWeatherOneCall::setLatLon(int _CITY_ID) int error_code = 0; char cityURL[110]; - char* URL1 = "http://api.openweathermap.org/data/2.5/weather?id="; + char* URL1 = "http://api.openweathermap.org/data/3.0/weather?id="; char* URL2 = "&appid="; sprintf(cityURL,"%s%d%s%s",URL1,_CITY_ID,URL2,USER_PARAM.OPEN_WEATHER_DKEY); @@ -421,7 +421,7 @@ int OpenWeatherOneCall::createHistory() //Gets Timestamp for EPOCH calculation below char tempURL[200]; - sprintf(tempURL,"https://api.openweathermap.org/data/2.5/onecall?lat=%.6f&lon=%.6f&exclude=minutely,hourly,daily,alerts&units=IMPERIAL&appid=%s",USER_PARAM.OPEN_WEATHER_LATITUDE,USER_PARAM.OPEN_WEATHER_LONGITUDE,USER_PARAM.OPEN_WEATHER_DKEY); + sprintf(tempURL,"https://api.openweathermap.org/data/3.0/onecall?lat=%.6f&lon=%.6f&exclude=minutely,hourly,daily,alerts&units=IMPERIAL&appid=%s",USER_PARAM.OPEN_WEATHER_LATITUDE,USER_PARAM.OPEN_WEATHER_LONGITUDE,USER_PARAM.OPEN_WEATHER_DKEY); HTTPClient http; http.begin(tempURL); From f2083bc80fecd601f98b1997626f0ea7bd72337c Mon Sep 17 00:00:00 2001 From: Jessica Hershey <60907719+JHershey69@users.noreply.github.com> Date: Thu, 22 Feb 2024 20:10:18 -0500 Subject: [PATCH 2/3] Update OpenWeatherOneCall.cpp --- src/OpenWeatherOneCall.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenWeatherOneCall.cpp b/src/OpenWeatherOneCall.cpp index a536588..3bd151e 100644 --- a/src/OpenWeatherOneCall.cpp +++ b/src/OpenWeatherOneCall.cpp @@ -1,5 +1,5 @@ /* - OpenWeatherOneCall.cpp v3.1.9 + OpenWeatherOneCall.cpp v3.3.0 copyright 2020 - Jessica Hershey www.github.com/JHershey69 From a8327fd3c3bb6cec9c98ec327ac1ad71c33741ae Mon Sep 17 00:00:00 2001 From: Jessica Hershey <60907719+JHershey69@users.noreply.github.com> Date: Thu, 22 Feb 2024 20:17:41 -0500 Subject: [PATCH 3/3] Update README.md --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f804c5b..12d9664 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ -# OpenWeatherOneCall v3.1.9 ![IMAGE OF LIGHTNING](https://github.com/JHershey69/OpenWeatherOneCall/blob/master/images/lightning.jpg) +# OpenWeatherOneCall v3.3.0 ![IMAGE OF LIGHTNING](https://github.com/JHershey69/OpenWeatherOneCall/blob/master/images/lightning.jpg) ## This is for ESP32 only +##This is an upgrade for OpenWeatherMap API 3.0 + **Please be advised** OpenWeather has changed ONE CALL to a subscription service. Signing up is -required to get your KEY, but you get 1000 calls a day for free (this is one call every 15 minutes) +required to get your KEY, but you get 1000 calls a day for free (this is one call every 90 seconds and that is A LOT for free) and you will continue to get all of the features of this library. **OpenWeatherOneCall** library to gather weather information from OpenWeatherMap @@ -49,3 +51,6 @@ v3.0.0 has a **Legacy Mode** to maintain ease of use for previous versions
--Fixed missing code.
**v3.1.9**
--Minor fix to clear old alerts. +
**v3.3.0** +
--Minor fix to update API change. +