Skip to content

Commit

Permalink
Merge pull request #54 from JHershey69/Upgrade-3.3.3
Browse files Browse the repository at this point in the history
Upgrade 3.3.3
  • Loading branch information
JHershey69 authored Jul 30, 2024
2 parents 7ebb155 + f30b277 commit 258f720
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 206 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# OpenWeatherOneCall v3.3.2 ![IMAGE OF LIGHTNING](https://github.com/JHershey69/OpenWeatherOneCall/blob/master/images/lightning.jpg)
# OpenWeatherOneCall v3.3.3 ![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
##This is an upgrade for OpenWeatherMap API 3.0 and Air Pollution API 2.5

**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 90 seconds and that is A LOT for free)
Expand Down Expand Up @@ -55,5 +55,6 @@ v3.0.0 has a **Legacy Mode** to maintain ease of use for previous versions
<br>--Minor fix to update API change.
<br>**v3.3.2**
<br>--Minor fix to update API change for Air Quality.

<br>**v3.3.3**
<br>--Minor fix to update API change for Air Quality and Example scripts.

Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
/*
Open Weather One Call Library
v3.3.1
v3.0.4
Copyright 2020 - Jessica Hershey
www.github.com/JHershey69
Sample Simple Longitude Latitude Weather Call updated 7/30/2024 to show Air Quality calls example
One Call API key at www.openweathermap.org
Google Developer Key no longer required.
Expand All @@ -32,9 +30,9 @@ TFT_eSPI tft = TFT_eSPI(); // Invoke custom library
//========= End TFT Library =============================


#define HOMESSID "SSID HERE"
#define HOMEPW "PASSWORD HERE"
#define ONECALLKEY "OPENWEATHER ONE CALL API KEY HERE"
#define HOMESSID "YOUR SSID HERE"
#define HOMEPW "YOUR SSID PW HERE"
#define ONECALLKEY "YOUR ONE CALL API KEY HERE"

// Only needed if WiFiTri installed for Triangulation may have fee from Google
#define GOOGLEKEY "YOUR GOOGLE DEVELOPER API KEY""
Expand All @@ -43,7 +41,7 @@ TFT_eSPI tft = TFT_eSPI(); // Invoke custom library
// OpenWeatherOneCall variables
//For Latitude and Longitude Location setting if used
float myLATITUDE = 39.9537; //<-----Toms River, NJ
float myLATITUDE = 39.9537; //<-----This is Toms River, NJ
float myLONGITUDE = -74.1979;
//For City ID Location setting if used
Expand All @@ -55,7 +53,7 @@ int myUNITS = IMPERIAL; //<-----METRIC, IMPERIAL, KELVIN (IMPERIAL is d
int myHISTORY = NULL; //<-----Only required for historical data up to 5 days
//See manual for excludes, only CURRENT Data allows 1,000,000 calls a month
int myEXCLUDES = EXCL_A+EXCL_D+EXCL_H+EXCL_M; //<-----0 Excludes is default
int myEXCLUDES = EXCL_D+EXCL_H+EXCL_M; //<-----0 Excludes is default
//for debugging loop counting
Expand Down Expand Up @@ -159,7 +157,7 @@ void setup() {
if(OWOC.quality) //See Addendum for complete list of Air Quality Variables
{
printf("\nAir Quality\n");
printf("\nAir Quality : % d\n", OWOC.quality->aqi);
printf("Carbon : % .2f\n", OWOC.quality->co);
printf("Nitrogen : % .2f\n", OWOC.quality->no);
printf("Ozone : % .2f\n", OWOC.quality->o3);
Expand All @@ -172,10 +170,11 @@ void setup() {
if (OWOC.alert) //Only if ALERTS aren't excluded
{
printf("ALERT *** ALERT *** ALERT\n");
printf("\nALERT *** ALERT *** ALERT\n");
printf("Sender : % s\n", OWOC.alert->senderName);
printf("Event : % s\n", OWOC.alert->event);
printf("ALERT : % s\n", OWOC.alert->summary);
} else {printf("\nNo Alerts For Area\n");
}
}
Expand Down
186 changes: 0 additions & 186 deletions examples/v2 Examples/SerialMonitorWeatherExample.ino

This file was deleted.

4 changes: 2 additions & 2 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "OpenWeatherOneCall",
"version": "3.3.2",
"version": "3.3.3",
"keywords": "openweather, darksky, weather, esp32, arduino",
"description": "OpenWeatherMap Library to use One Call on the ESP32. This library allows the ESP32 to receive and parse the json from OpenWeathermap",
"description": "OpenWeatherMap Library to use One Call on the ESP32. This library allows the ESP32 to receive and parse the json from OpenWeatherMap",
"dependencies":
[
{
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=OpenWeatherOneCall
version=3.3.2
version=3.3.3
author=JHershey69
maintainer=JHershey69 <jamiehershey2@gmail.com>
sentence=Current and Seven Day Weather Forecast Library for ESP32.
Expand Down
8 changes: 5 additions & 3 deletions src/OpenWeatherOneCall.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
OpenWeatherOneCall.cpp v3.3.2
OpenWeatherOneCall.cpp v3.3.3
copyright 2020 - Jessica Hershey
www.github.com/JHershey69
Expand Down Expand Up @@ -47,10 +47,12 @@ int OpenWeatherOneCall::parseWeather(void)
{
int error_code = 0;

// WiFi.status not declared in this scope error
if (WiFi.status() != WL_CONNECTED)
{
return 25;
}
// End WiFi error

unsigned int SIZE_CAPACITY = 32768;

Expand Down Expand Up @@ -661,7 +663,7 @@ int OpenWeatherOneCall::createAQ(int sizeCap)
char getURL[200] = {0};

sprintf(getURL,"%s%.6f%s%.6f%s%s",AQ_URL1,USER_PARAM.OPEN_WEATHER_LATITUDE,AQ_URL2,USER_PARAM.OPEN_WEATHER_LONGITUDE,AQ_URL3,USER_PARAM.OPEN_WEATHER_DKEY);
printf("%s\n",getURL);
// printf("%s\n",getURL);

HTTPClient http;
http.begin(getURL);
Expand Down Expand Up @@ -719,7 +721,7 @@ int OpenWeatherOneCall::createCurrent(int sizeCap)
int alertz = 0;

sprintf(getURL,"%s?lat=%.6f&lon=%.6f&lang=%s%s&units=%s%s%s",DS_URL1,USER_PARAM.OPEN_WEATHER_LATITUDE,USER_PARAM.OPEN_WEATHER_LONGITUDE,USER_PARAM.OPEN_WEATHER_LANGUAGE,DS_URL2,units,DS_URL3,USER_PARAM.OPEN_WEATHER_DKEY);

// printf("\n%s\n",getURL);

HTTPClient http;
http.begin(getURL);
Expand Down
2 changes: 1 addition & 1 deletion src/OpenWeatherOneCall.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
OpenWeatherOnecall.h
Upgrade v3.1.8
Upgrade v3.3.3
copyright 2020 - Jessica Hershey
www.github.com/jHershey69
Expand Down

0 comments on commit 258f720

Please sign in to comment.