mirror of https://github.com/sqfmi/Watchy.git
Keep track on whether weather data was fetched from external source
parent
7333873f08
commit
f49e1a5fab
|
@ -618,6 +618,7 @@ weatherData Watchy::getWeatherData(String cityID, String units, String lang,
|
||||||
int(responseObject["weather"][0]["id"]);
|
int(responseObject["weather"][0]["id"]);
|
||||||
currentWeather.weatherDescription =
|
currentWeather.weatherDescription =
|
||||||
JSONVar::stringify(responseObject["weather"][0]["main"]);
|
JSONVar::stringify(responseObject["weather"][0]["main"]);
|
||||||
|
currentWeather.external = true;
|
||||||
// sync NTP during weather API call and use timezone of city
|
// sync NTP during weather API call and use timezone of city
|
||||||
syncNTP(long(responseObject["timezone"]));
|
syncNTP(long(responseObject["timezone"]));
|
||||||
} else {
|
} else {
|
||||||
|
@ -634,6 +635,7 @@ weatherData Watchy::getWeatherData(String cityID, String units, String lang,
|
||||||
}
|
}
|
||||||
currentWeather.temperature = temperature;
|
currentWeather.temperature = temperature;
|
||||||
currentWeather.weatherConditionCode = 800;
|
currentWeather.weatherConditionCode = 800;
|
||||||
|
currentWeather.external = false;
|
||||||
}
|
}
|
||||||
weatherIntervalCounter = 0;
|
weatherIntervalCounter = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -22,6 +22,7 @@ typedef struct weatherData {
|
||||||
int16_t weatherConditionCode;
|
int16_t weatherConditionCode;
|
||||||
bool isMetric;
|
bool isMetric;
|
||||||
String weatherDescription;
|
String weatherDescription;
|
||||||
|
bool external;
|
||||||
} weatherData;
|
} weatherData;
|
||||||
|
|
||||||
typedef struct watchySettings {
|
typedef struct watchySettings {
|
||||||
|
|
Loading…
Reference in New Issue