mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
- weather: allow to get forecast temp and forecast icon
Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -124,8 +124,8 @@ bool CWeather::GetWeatherDetails()
|
|||||||
|
|
||||||
if (found > 0)
|
if (found > 0)
|
||||||
{
|
{
|
||||||
act_temp = DataValues["currently"].get("temperature", "").asFloat();
|
|
||||||
timezone = DataValues["timezone"].asString();
|
timezone = DataValues["timezone"].asString();
|
||||||
|
act_temp = DataValues["currently"].get("temperature", "").asFloat();
|
||||||
act_wicon = DataValues["currently"].get("icon", "").asString();
|
act_wicon = DataValues["currently"].get("icon", "").asString();
|
||||||
if (act_wicon.empty())
|
if (act_wicon.empty())
|
||||||
act_wicon = "unknown.png";
|
act_wicon = "unknown.png";
|
||||||
|
@@ -68,10 +68,18 @@ class CWeather
|
|||||||
{
|
{
|
||||||
return to_string((int)(act_temp + 0.5)) + "°C";
|
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()
|
std::string getActIcon()
|
||||||
{
|
{
|
||||||
return ICONSDIR"/weather/" + act_wicon;
|
return ICONSDIR"/weather/" + act_wicon;
|
||||||
};
|
};
|
||||||
|
std::string getForecastIcon(int i = 0)
|
||||||
|
{
|
||||||
|
return ICONSDIR"/weather/" + v_forecast[i].wicon;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user