weather/lcd4l: add some more weather data

Origin commit data
------------------
Commit: e7dd97e151
Author: vanhofen <vanhofen@gmx.de>
Date: 2019-03-23 (Sat, 23 Mar 2019)

Origin message was:
------------------
- weather/lcd4l: add some more weather data
This commit is contained in:
vanhofen
2019-03-23 11:04:46 +01:00
parent ba576b4a7e
commit b00722e264
4 changed files with 75 additions and 3 deletions

View File

@@ -125,7 +125,10 @@ bool CWeather::GetWeatherDetails()
if (found > 0)
{
timezone = DataValues["timezone"].asString();
current.timestamp = DataValues["currently"].get("time", 0).asDouble();
current.temperature = DataValues["currently"].get("temperature", "").asFloat();
current.windSpeed = DataValues["currently"].get("windSpeed", 0).asFloat();
current.windBearing = DataValues["currently"].get("windBearing", 0).asDouble();
current.icon = DataValues["currently"].get("icon", "").asString();
if (current.icon.empty())
current.icon = "unknown.png";
@@ -145,6 +148,8 @@ bool CWeather::GetWeatherDetails()
daily_data.icon = daily_data.icon + ".png";
daily_data.temperatureMin = elements[i].get("temperatureMin", "").asFloat();
daily_data.temperatureMax = elements[i].get("temperatureMax", "").asFloat();
daily_data.windSpeed = elements[i].get("windSpeed", 0).asFloat();
daily_data.windBearing = elements[i].get("windBearing", 0).asDouble();
struct tm *timeinfo;
timeinfo = localtime(&daily_data.timestamp);