fix #17: Reset weather forecast hour offset on weather data update

This commit is contained in:
Tim Kluge 2024-12-20 17:00:09 +01:00
parent 82d9ff41d2
commit 72daf42938

View File

@ -131,6 +131,8 @@ class KarooHeadwindExtension : KarooExtension("karoo-headwind", "1.1.1") {
val data = jsonWithUnknownKeys.decodeFromString<OpenMeteoCurrentWeatherResponse>(responseString) val data = jsonWithUnknownKeys.decodeFromString<OpenMeteoCurrentWeatherResponse>(responseString)
saveCurrentData(applicationContext, data) saveCurrentData(applicationContext, data)
saveWidgetSettings(applicationContext, HeadwindWidgetSettings(currentForecastHourOffset = 0))
Log.d(TAG, "Got updated weather info: $data") Log.d(TAG, "Got updated weather info: $data")
} catch(e: Exception){ } catch(e: Exception){
Log.e(TAG, "Failed to read current weather data", e) Log.e(TAG, "Failed to read current weather data", e)