|
15 | 15 | #include "TimeStr.h" |
16 | 16 | #include "Translations.h" |
17 | 17 |
|
18 | | -OpenWeatherMapClient::OpenWeatherMapClient(const String &ApiKey, bool isMetric) { |
| 18 | +OpenWeatherMapClient::OpenWeatherMapClient() { |
19 | 19 | myGeoLocation = ""; |
20 | 20 | myGeoLocation_CityID = 0; |
21 | 21 | myGeoLocationType = LOC_UNSET; |
22 | | - myApiKey = ApiKey; |
23 | | - //this->isMetric = isMetric; // Deprecated! |
24 | | - (void)isMetric; // suppress unused parameter warning |
| 22 | + myApiKey = ""; |
25 | 23 | dataGetRetryCount = 0; |
26 | 24 | weather.isValid = false; |
27 | 25 | } |
@@ -144,8 +142,6 @@ void OpenWeatherMapClient::updateWeather() { |
144 | 142 | } |
145 | 143 | apiGetData += F("&units=metric&lang="); |
146 | 144 | apiGetData += myLanguage; |
147 | | - //apiGetData += F("&units="); |
148 | | - //apiGetData += String((isMetric) ? F("metric") : F("imperial")); |
149 | 145 | apiGetData += F("&APPID="); |
150 | 146 | apiGetData += myApiKey + F(" HTTP/1.1"); |
151 | 147 | Serial.println(F("Getting Weather Data")); |
@@ -276,30 +272,6 @@ void OpenWeatherMapClient::updateWeather() { |
276 | 272 | #endif |
277 | 273 | } |
278 | 274 |
|
279 | | -/* deprecated; shall be language specific |
280 | | -String OpenWeatherMapClient::getWindDirectionText() { |
281 | | - //int val = floor((weather.windDirection / 22.5) + 0.5); |
282 | | - //int val = int((weather.windDirection*16 + 180) / 360) % 16; |
283 | | - // N, NNE, NE, ENE, E, ESE, SE, SSE, S, SSW, SW, WSW, W, WNW, NW, NNW ; |
284 | | - //String arr[] = {"N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"}; |
285 | | - //return arr[(val % 16)]; |
286 | | - return getWindDirectionString(weather.windDirection); |
287 | | -}*/ |
288 | | - |
289 | | -/* deprecated; shall be language specific |
290 | | -String OpenWeatherMapClient::getWeekDay() { |
291 | | - String rtnValue = ""; |
292 | | - long timestamp = weather.reportTimestamp; |
293 | | - long day = 0; |
294 | | - if (timestamp != 0) { |
295 | | - // Add timezone from OWM |
296 | | - timestamp += weather.timeZone; |
297 | | - day = ((timestamp / 86400) + 4) % 7; |
298 | | - rtnValue = getDayName(day); |
299 | | - } |
300 | | - return rtnValue; |
301 | | -}*/ |
302 | | - |
303 | 275 | String OpenWeatherMapClient::getWeatherIcon() { |
304 | 276 | // match weather condition codes to OLED icon in the weatherstation font |
305 | 277 | // see https://openweathermap.org/weather-conditions |
|
0 commit comments