mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-13 22:05:48 +00:00
add time source
This commit is contained in:
@ -93,9 +93,9 @@ QVariantHash OWMWeatherProvider::parseSingleJson(const QVariantMap &_json) const
|
||||
// main data
|
||||
QVariantMap mainWeather = _json["main"].toMap();
|
||||
if (!weather.isEmpty()) {
|
||||
output[tag("humidity")] = mainWeather["humidity"].toFloat();
|
||||
output[tag("pressure")] = mainWeather["pressure"].toFloat();
|
||||
output[tag("temperature")] = mainWeather["temp"].toFloat();
|
||||
output[tag("humidity")] = mainWeather["humidity"].toDouble();
|
||||
output[tag("pressure")] = mainWeather["pressure"].toDouble();
|
||||
output[tag("temperature")] = mainWeather["temp"].toDouble();
|
||||
}
|
||||
|
||||
// timestamp
|
||||
|
@ -86,7 +86,7 @@ QVariantHash YahooWeatherProvider::parseCurrent(const QVariantMap &_json, const
|
||||
values[tag("timestamp")] = condition["date"].toString();
|
||||
values[tag("humidity")] = _atmosphere["humidity"].toInt();
|
||||
// HACK temporary fix of invalid values on Yahoo! side
|
||||
values[tag("pressure")] = static_cast<int>(_atmosphere["pressure"].toFloat() / 33.863753);
|
||||
values[tag("pressure")] = static_cast<int>(_atmosphere["pressure"].toDouble() / 33.863753);
|
||||
|
||||
return values;
|
||||
}
|
||||
@ -103,7 +103,7 @@ QVariantHash YahooWeatherProvider::parseForecast(const QVariantMap &_json) const
|
||||
values[tag("weatherId")] = id;
|
||||
values[tag("timestamp")] = weatherMap["date"].toString();
|
||||
// yahoo provides high and low temperatures. Lets calculate average one
|
||||
values[tag("temperature")] = (weatherMap["high"].toFloat() + weatherMap["low"].toFloat()) / 2.0;
|
||||
values[tag("temperature")] = (weatherMap["high"].toDouble() + weatherMap["low"].toDouble()) / 2.0;
|
||||
// ... and no forecast data for humidity and pressure
|
||||
values[tag("humidity")] = 0;
|
||||
values[tag("pressure")] = 0.0;
|
||||
|
Reference in New Issue
Block a user