diff --git a/lib/face/faceWeather.cpp b/lib/face/faceWeather.cpp index 849c6b7..afb4641 100644 --- a/lib/face/faceWeather.cpp +++ b/lib/face/faceWeather.cpp @@ -19,9 +19,14 @@ unsigned long lastWeatherDataUpdate = 0; void render_current(); void render_forecast(); bool readWeatherData(); +bool isFaceWeatherSetupCompleted(); void setupFaceWeather() { + if (!isFaceWeatherSetupCompleted()) { + Serial.println("weather not configured"); + } + readWeatherData(); lastWeatherDataUpdate = millis(); } @@ -52,6 +57,11 @@ void playlistFaceWeather() displayFlush(); } +bool isFaceWeatherSetupCompleted() +{ + return !(NVS.getString("weather.api").isEmpty() || NVS.getString("weather.lang").isEmpty() || NVS.getString("weather.lang").isEmpty()); +} + void render_current() { GFXcanvas1 *canvas = displayGetCanvas(); @@ -199,11 +209,14 @@ bool downloadWeatherData() */ bool updateWeatherData() { - if (downloadWeatherData()) + if (isFaceWeatherSetupCompleted()) { - readWeatherData(); + if (downloadWeatherData()) + { + readWeatherData(); - return true; + return true; + } } return false;