- lcd4l/weather: fix creation of data files for first run

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2019-03-20 15:27:15 +01:00
committed by Thilo Graf
parent 1850fb3692
commit f8e0bf244a
4 changed files with 10 additions and 10 deletions

View File

@@ -78,10 +78,10 @@ void CWeather::setCoords(std::string new_coords, std::string new_city)
}
}
bool CWeather::checkUpdate()
bool CWeather::checkUpdate(bool forceUpdate)
{
time_t current_time = time(NULL);
if (difftime(current_time,last_time) > MINUTES)
if (forceUpdate || (difftime(current_time,last_time) > MINUTES))
return GetWeatherDetails();
else
return false;