[weather] Add optional "Observation Timestamp" to dataengine data

parent a451cb11
......@@ -903,6 +903,9 @@ void UKMETIon::updateWeather(const QString& source)
data.insert(QStringLiteral("Place"), weatherData.stationName);
data.insert(QStringLiteral("Station"), weatherData.stationName);
if (weatherData.observationDateTime.isValid()) {
data.insert(QStringLiteral("Observation Timestamp"), weatherData.observationDateTime);
}
if (!weatherData.obsTime.isEmpty()) {
data.insert(QStringLiteral("Observation Period"), weatherData.obsTime);
}
......
......@@ -1436,7 +1436,12 @@ void EnvCanadaIon::updateWeather(const QString& source)
}
// Real weather - Current conditions
if (weatherData.observationDateTime.isValid()) {
data.insert(QStringLiteral("Observation Timestamp"), weatherData.observationDateTime);
}
data.insert(QStringLiteral("Observation Period"), weatherData.obsTimestamp);
if (!weatherData.condition.isEmpty()) {
data.insert(QStringLiteral("Current Conditions"), i18nc("weather condition", weatherData.condition.toUtf8().data()));
}
......
......@@ -44,7 +44,8 @@
* "Longitude": float, longitude of the weather station in decimal degrees, optional
*
* Data about last observation:
* "Observation Period": string, free text string for time of observation, optional, TODO: get standardized datetime
* "Observation Period": string, free text string for time of observation, optional
* "Observation Timestamp": datetime (with timezone), time of observation, optional
* "Current Conditions": string, free text string for current weather observation, optional
* "Condition Icon": string, xdg icon name for current weather observation, optional
* "Temperature": float, using general temperature unit, optional
......
......@@ -564,7 +564,12 @@ void NOAAIon::updateWeather(const QString& source)
}
// Real weather - Current conditions
if (weatherData.observationDateTime.isValid()) {
data.insert(QStringLiteral("Observation Timestamp"), weatherData.observationDateTime);
}
data.insert(QStringLiteral("Observation Period"), weatherData.observationTime);
const QString conditionI18n = weatherData.weather == QLatin1String("N/A") ? i18n("N/A") : i18nc("weather condition", weatherData.weather.toUtf8().data());
data.insert(QStringLiteral("Current Conditions"), conditionI18n);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment