From 0ddb3f88513c8cc27807a8f28491023e98f112ad Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 20 Mar 2019 22:19:17 +0100 Subject: [PATCH] weather: allow to get forecast temp and forecast icon Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7f5529c0674019dbc7ea9743ada560e291a0d322 Author: vanhofen Date: 2019-03-20 (Wed, 20 Mar 2019) Origin message was: ------------------ - weather: allow to get forecast temp and forecast icon ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/weather.cpp | 2 +- src/gui/weather.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/weather.cpp b/src/gui/weather.cpp index 1e6363b70..b57a55c0a 100644 --- a/src/gui/weather.cpp +++ b/src/gui/weather.cpp @@ -125,8 +125,8 @@ bool CWeather::GetWeatherDetails() if (found > 0) { - act_temp = DataValues["currently"].get("temperature", "").asFloat(); timezone = DataValues["timezone"].asString(); + act_temp = DataValues["currently"].get("temperature", "").asFloat(); act_wicon = DataValues["currently"].get("icon", "").asString(); if (act_wicon.empty()) act_wicon = "unknown.png"; diff --git a/src/gui/weather.h b/src/gui/weather.h index 0cf337a6c..fbe39040e 100644 --- a/src/gui/weather.h +++ b/src/gui/weather.h @@ -69,10 +69,18 @@ class CWeather { return to_string((int)(act_temp + 0.5)) + "°C"; }; + std::string getForecastTemp(int i = 0) + { + return to_string((int)(v_forecast[i].max_temp + 0.5)) + "°C"; + }; std::string getActIcon() { return ICONSDIR"/weather/" + act_wicon; }; + std::string getForecastIcon(int i = 0) + { + return ICONSDIR"/weather/" + v_forecast[i].wicon; + }; }; #endif