From f49e1a5fab28c52347af85cc8c6c1053a52b73b3 Mon Sep 17 00:00:00 2001 From: Kenneth Henderick Date: Thu, 29 Dec 2022 14:08:24 +0100 Subject: [PATCH] Keep track on whether weather data was fetched from external source --- src/Watchy.cpp | 2 ++ src/Watchy.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/Watchy.cpp b/src/Watchy.cpp index 778b9e2..1cc30f5 100644 --- a/src/Watchy.cpp +++ b/src/Watchy.cpp @@ -618,6 +618,7 @@ weatherData Watchy::getWeatherData(String cityID, String units, String lang, int(responseObject["weather"][0]["id"]); currentWeather.weatherDescription = JSONVar::stringify(responseObject["weather"][0]["main"]); + currentWeather.external = true; // sync NTP during weather API call and use timezone of city syncNTP(long(responseObject["timezone"])); } else { @@ -634,6 +635,7 @@ weatherData Watchy::getWeatherData(String cityID, String units, String lang, } currentWeather.temperature = temperature; currentWeather.weatherConditionCode = 800; + currentWeather.external = false; } weatherIntervalCounter = 0; } else { diff --git a/src/Watchy.h b/src/Watchy.h index 5aaab44..47b5a99 100644 --- a/src/Watchy.h +++ b/src/Watchy.h @@ -22,6 +22,7 @@ typedef struct weatherData { int16_t weatherConditionCode; bool isMetric; String weatherDescription; + bool external; } weatherData; typedef struct watchySettings {