Skip to content

Commit d5e43ea

Browse files
committed
Revert "Added percentage of precipitation"
This reverts commit a6a8b41.
1 parent a6a8b41 commit d5e43ea

File tree

2 files changed

+44
-56
lines changed

2 files changed

+44
-56
lines changed

WundergroundClient.cpp

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ void WundergroundClient::key(String key) {
151151
isForecast = false;
152152
isAlerts = true;
153153
}
154-
// end fowlerk add
154+
// end fowlerk add
155155
}
156156

157157
void WundergroundClient::value(String value) {
@@ -252,12 +252,12 @@ void WundergroundClient::value(String value) {
252252
if (currentKey == "observation_time_rfc822") {
253253
date = value.substring(0, 16);
254254
}
255-
// Begin add, fowlerk...04-Dec-2016
255+
// Begin add, fowlerk...04-Dec-2016
256256
if (currentKey == "observation_time") {
257257
observationTime = value;
258258
}
259-
// end add, fowlerk
260-
259+
// end add, fowlerk
260+
261261
if (currentKey == "temp_f" && !isMetric) {
262262
currentTemp = value;
263263
}
@@ -290,17 +290,17 @@ void WundergroundClient::value(String value) {
290290
if (currentKey == "feelslike_f" && !isMetric) {
291291
feelslike = value;
292292
}
293-
293+
294294
if (currentKey == "feelslike_c" && isMetric) {
295295
feelslike = value;
296296
}
297-
297+
298298
if (currentKey == "UV") {
299299
UV = value;
300300
}
301-
301+
302302
// end fowlerk add
303-
303+
304304
if (currentKey == "dewpoint_f" && !isMetric) {
305305
dewPoint = value;
306306
}
@@ -316,14 +316,10 @@ void WundergroundClient::value(String value) {
316316
if (currentKey == "period") {
317317
currentForecastPeriod = value.toInt();
318318
}
319-
if (currentKey == "pop" && isForecast && currentForecastPeriod < MAX_FORECAST_PERIODS) {
320-
Serial.println("Pop" + String(currentForecastPeriod) + ": " + value);
321-
forecastPop[currentForecastPeriod] = value;
322-
}
323319
// Modified below line to add check to ensure we are processing the 10-day forecast
324320
// before setting the forecastTitle (day of week of the current forecast day).
325321
// (The keyword title is used in both the current observation and the 10-day forecast.)
326-
// Modified by fowlerk
322+
// Modified by fowlerk
327323
// if (currentKey == "title" && currentForecastPeriod < MAX_FORECAST_PERIODS) { // Removed, fowlerk
328324
if (currentKey == "title" && isForecast && currentForecastPeriod < MAX_FORECAST_PERIODS) {
329325
Serial.println(String(currentForecastPeriod) + ": " + value);
@@ -335,7 +331,7 @@ void WundergroundClient::value(String value) {
335331
forecastText[currentForecastPeriod] = value;
336332
}
337333
// end fowlerk add, 12/3/16
338-
334+
339335
// The detailed forecast period has only one forecast per day with low/high for both
340336
// night and day, starting at index 1.
341337
int dailyForecastPeriod = (currentForecastPeriod - 1) * 2;
@@ -368,19 +364,19 @@ void WundergroundClient::value(String value) {
368364
currentForecastPeriod = 0;
369365
}
370366
forecastMonth[currentForecastPeriod] = value;
371-
}
367+
}
372368

373369
if (currentKey == "day" && isSimpleForecast && currentForecastPeriod < MAX_FORECAST_PERIODS) {
374370
// Added by fowlerk to handle transition from txtforecast to simpleforecast, as
375371
// the key "period" doesn't appear until after some of the key values needed and is
376372
// used as an array index.
377373
if (isSimpleForecast && currentForecastPeriod == 19) {
378374
currentForecastPeriod = 0;
379-
}
375+
}
380376
forecastDay[currentForecastPeriod] = value;
381377
}
382378
// end fowlerk add
383-
379+
384380
}
385381

386382
void WundergroundClient::endArray() {
@@ -547,24 +543,19 @@ String WundergroundClient::getForecastLowTemp(int period) {
547543
String WundergroundClient::getForecastHighTemp(int period) {
548544
return forecastHighTemp[period];
549545
}
550-
551-
String WundergroundClient::getForecastPrecipitationPercentage(int period) {
552-
return forecastPop[period];
553-
}
554-
555546
// fowlerk added...
556547
String WundergroundClient::getForecastDay(int period) {
557-
// Serial.print("Day period: "); Serial.println(period);
548+
// Serial.print("Day period: "); Serial.println(period);
558549
return forecastDay[period];
559550
}
560551

561552
String WundergroundClient::getForecastMonth(int period) {
562-
// Serial.print("Month period: "); Serial.println(period);
553+
// Serial.print("Month period: "); Serial.println(period);
563554
return forecastMonth[period];
564555
}
565556

566557
String WundergroundClient::getForecastText(int period) {
567-
Serial.print("Forecast period: "); Serial.println(period);
558+
Serial.print("Forecast period: "); Serial.println(period);
568559
return forecastText[period];
569560
}
570561
// end fowlerk add

WundergroundClient.h

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -58,38 +58,37 @@ class WundergroundClient: public JsonListener {
5858
String pressure;
5959
String dewPoint;
6060
String precipitationToday;
61-
// fowlerk added...
62-
String feelslike;
63-
String UV;
64-
String observationTime; // fowlerk add, 04-Dec-2016
65-
// end fowlerk add
66-
61+
// fowlerk added...
62+
String feelslike;
63+
String UV;
64+
String observationTime; // fowlerk add, 04-Dec-2016
65+
// end fowlerk add
66+
6767
void doUpdate(String url);
6868

6969
// forecast
7070
boolean isForecast = false;
7171
boolean isSimpleForecast = false; // true; fowlerk
72-
boolean isCurrentObservation = false; // Added by fowlerk
73-
boolean isAlerts = false; // Added by fowlerk
72+
boolean isCurrentObservation = false; // Added by fowlerk
73+
boolean isAlerts = false; // Added by fowlerk
7474
int currentForecastPeriod;
7575
String forecastIcon [MAX_FORECAST_PERIODS];
7676
String forecastTitle [MAX_FORECAST_PERIODS];
7777
String forecastLowTemp [MAX_FORECAST_PERIODS];
7878
String forecastHighTemp [MAX_FORECAST_PERIODS];
79-
String forecastPop[MAX_FORECAST_PERIODS];
80-
// fowlerk added...
81-
String forecastDay [MAX_FORECAST_PERIODS/2];
82-
String forecastMonth [MAX_FORECAST_PERIODS/2];
83-
String forecastText [MAX_FORECAST_PERIODS];
84-
// end fowlerk add
79+
// fowlerk added...
80+
String forecastDay [MAX_FORECAST_PERIODS/2];
81+
String forecastMonth [MAX_FORECAST_PERIODS/2];
82+
String forecastText [MAX_FORECAST_PERIODS];
83+
// end fowlerk add
8584

8685
public:
8786
WundergroundClient(boolean isMetric);
8887
void updateConditions(String apiKey, String language, String country, String city);
8988
void updateConditions(String apiKey, String language, String zmwCode);
9089
void updateForecast(String apiKey, String language, String country, String city);
9190
void updateAstronomy(String apiKey, String language, String country, String city);
92-
void updateAlerts(String apiKey, String language, String country, String city); // Added by fowlerk, 18-Dec-2016
91+
void updateAlerts(String apiKey, String language, String country, String city); // Added by fowlerk, 18-Dec-2016
9392
// JJG added
9493
String getHours();
9594
String getMinutes();
@@ -125,13 +124,13 @@ class WundergroundClient: public JsonListener {
125124
String getDewPoint();
126125

127126
String getPrecipitationToday();
128-
// fowlerk added...
129-
String getFeelsLike();
130-
131-
String getUV();
132-
133-
String getObservationTime(); // fowlerk add, 04-Dec-2016
134-
// end fowlerk add
127+
// fowlerk added...
128+
String getFeelsLike();
129+
130+
String getUV();
131+
132+
String getObservationTime(); // fowlerk add, 04-Dec-2016
133+
// end fowlerk add
135134

136135
String getForecastIcon(int period);
137136

@@ -140,15 +139,13 @@ class WundergroundClient: public JsonListener {
140139
String getForecastLowTemp(int period);
141140

142141
String getForecastHighTemp(int period);
143-
144-
String getForecastPrecipitationPercentage(int period);
145-
// fowlerk added...
146-
String getForecastDay(int period);
147-
148-
String getForecastMonth(int period);
149-
150-
String getForecastText(int period);
151-
// end fowlerk add
142+
// fowlerk added...
143+
String getForecastDay(int period);
144+
145+
String getForecastMonth(int period);
146+
147+
String getForecastText(int period);
148+
// end fowlerk add
152149

153150
virtual void whitespace(char c);
154151

0 commit comments

Comments
 (0)