Skip to content

Commit

Permalink
Merge pull request #202 from khenderick/feature/weather-source
Browse files Browse the repository at this point in the history
Keep track on weather source
  • Loading branch information
sqfmi authored Dec 29, 2022
2 parents 7333873 + f49e1a5 commit aaa3d91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Watchy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions src/Watchy.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ typedef struct weatherData {
int16_t weatherConditionCode;
bool isMetric;
String weatherDescription;
bool external;
} weatherData;

typedef struct watchySettings {
Expand Down

0 comments on commit aaa3d91

Please sign in to comment.