Skip to content

Commit 704b1c1

Browse files
committed
Added setter for PM mode and metric mode
1 parent a979b7a commit 704b1c1

File tree

6 files changed

+13
-2
lines changed

6 files changed

+13
-2
lines changed

src/WundergroundAstronomy.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ See more at http://blog.squix.ch
3232
WundergroundAstronomy::WundergroundAstronomy(boolean _usePM) {
3333
usePM = _usePM;
3434
}
35+
void WundergroundAstronomy::setPM(boolean usePM) {
36+
this->usePM = usePM;
37+
}
3538
void WundergroundAstronomy::updateAstronomy(WGAstronomy *astronomy, String apiKey, String language, String country, String city) {
3639
doUpdate(astronomy, "http://api.wunderground.com/api/" + apiKey + "/astronomy/lang:" + language + "/q/" + country + "/" + city + ".json");
3740
}

src/WundergroundAstronomy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class WundergroundAstronomy: public JsonListener {
6161
WundergroundAstronomy(boolean usePM);
6262
void updateAstronomy(WGAstronomy *astronomy, String apiKey, String language, String country, String city);
6363
void updateAstronomyPWS(WGAstronomy *astronomy, String apiKey, String language, String pws);
64-
64+
void setPM(boolean usePM);
6565
virtual void whitespace(char c);
6666

6767
virtual void startDocument();

src/WundergroundConditions.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ WundergroundConditions::WundergroundConditions(boolean _isMetric) {
3232
isMetric = _isMetric;
3333
}
3434

35+
void WundergroundConditions::setMetric(boolean isMetric) {
36+
this->isMetric = isMetric;
37+
}
3538

3639
void WundergroundConditions::updateConditions(WGConditions *conditions, String apiKey, String language, String country, String city) {
3740
doUpdate(conditions, "http://api.wunderground.com/api/" + apiKey + "/conditions/lang:" + language + "/q/" + country + "/" + city + ".json");

src/WundergroundConditions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class WundergroundConditions: public JsonListener {
6060
void updateConditions(WGConditions *conditions, String apiKey, String language, String country, String city);
6161
void updateConditions(WGConditions *conditions, String apiKey, String language, String zmwCode);
6262
void updateConditionsPWS(WGConditions *conditions, String apiKey, String language, String pws);
63+
void setMetric(boolean isMetric);
6364
String getMeteoconIcon(String icon);
6465
virtual void whitespace(char c);
6566

src/WundergroundForecast.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ WundergroundForecast::WundergroundForecast(boolean _isMetric) {
3232
isMetric = _isMetric;
3333
}
3434

35+
void WundergroundForecast::setMetric(bool isMetric) {
36+
this->isMetric = isMetric;
37+
}
38+
3539
void WundergroundForecast::updateForecast(WGForecast *forecasts, uint8_t maxForecasts, String apiKey, String language, String country, String city) {
3640
doUpdate(forecasts, maxForecasts, "http://api.wunderground.com/api/" + apiKey + "/forecast10day/lang:" + language + "/q/" + country + "/" + city + ".json");
3741
}

src/WundergroundForecast.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class WundergroundForecast: public JsonListener {
6363
void updateForecast(WGForecast *forecasts, uint8_t maxForecasts, String apiKey, String language, String country, String city);
6464
void updateForecastPWS(WGForecast *forecasts, uint8_t maxForecasts, String apiKey, String language, String pws);
6565
void updateForecastZMW(WGForecast *forecasts, uint8_t maxForecasts, String apiKey, String language, String zmwCode);
66-
66+
void setMetric(bool isMetric);
6767
String getMeteoconIcon(String iconText);
6868

6969
virtual void whitespace(char c);

0 commit comments

Comments
 (0)