diff --git a/marquee/OpenWeatherMapClient.cpp b/marquee/OpenWeatherMapClient.cpp index 9a9608b..8d4e05b 100644 --- a/marquee/OpenWeatherMapClient.cpp +++ b/marquee/OpenWeatherMapClient.cpp @@ -114,6 +114,8 @@ void OpenWeatherMapClient::updateWeather() { weathers[inx].icon = (const char*)root["list"][inx]["weather"][0]["icon"]; weathers[inx].pressure = (const char*)root["list"][inx]["main"]["pressure"]; weathers[inx].direction = (const char*)root["list"][inx]["wind"]["deg"]; + weathers[inx].high = (const char*)root["list"][inx]["main"]["temp_max"]; + weathers[inx].low = (const char*)root["list"][inx]["main"]["temp_min"]; if (units == "metric") { // convert to kph from m/s @@ -121,6 +123,12 @@ void OpenWeatherMapClient::updateWeather() { weathers[inx].wind = String(f); } + if (units != "metric") + { + float p = (weathers[inx].pressure.toFloat() * 0.0295301); //convert millibars to inches + weathers[inx].pressure = String(p); + } + Serial.println("lat: " + weathers[inx].lat); Serial.println("lon: " + weathers[inx].lon); Serial.println("dt: " + weathers[inx].dt); @@ -236,6 +244,16 @@ String OpenWeatherMapClient::getPressure(int index) return weathers[index].pressure; } +String OpenWeatherMapClient::getHigh(int index) +{ + return weathers[index].high; +} + +String OpenWeatherMapClient::getLow(int index) +{ + return weathers[index].low; +} + String OpenWeatherMapClient::getIcon(int index) { return weathers[index].icon; } diff --git a/marquee/OpenWeatherMapClient.h b/marquee/OpenWeatherMapClient.h index 2b34a97..636acd0 100644 --- a/marquee/OpenWeatherMapClient.h +++ b/marquee/OpenWeatherMapClient.h @@ -51,6 +51,8 @@ class OpenWeatherMapClient { String error; String pressure; String direction; + String high; + String low; } weather; weather weathers[5]; @@ -79,6 +81,8 @@ class OpenWeatherMapClient { String getDirection(int index); String getDirectionRounded(int index); String getPressure(int index); + String getHigh(int index); + String getLow(int index); String getWeatherId(int index); String getDescription(int index); String getIcon(int index); diff --git a/marquee/marquee.ino b/marquee/marquee.ino index ec4828f..6f615d3 100644 --- a/marquee/marquee.ino +++ b/marquee/marquee.ino @@ -81,6 +81,7 @@ boolean SHOW_HUMIDITY = true; boolean SHOW_WIND = true; boolean SHOW_WINDDIR = true; boolean SHOW_PRESSURE = true; +boolean SHOW_HIGHLOW = true; // OctoPrint Client OctoPrintClient printerClient(OctoPrintApiKey, OctoPrintServer, OctoPrintPort, OctoAuthUser, OctoAuthPass); @@ -124,6 +125,7 @@ static const char CHANGE_FORM1[] PROGMEM = "