From 72daf4293851fdf44da49ddd488d474ed1de49de Mon Sep 17 00:00:00 2001 From: Tim Kluge Date: Fri, 20 Dec 2024 17:00:09 +0100 Subject: [PATCH] fix #17: Reset weather forecast hour offset on weather data update --- .../kotlin/de/timklge/karooheadwind/KarooHeadwindExtension.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/kotlin/de/timklge/karooheadwind/KarooHeadwindExtension.kt b/app/src/main/kotlin/de/timklge/karooheadwind/KarooHeadwindExtension.kt index 77728c2..d289248 100644 --- a/app/src/main/kotlin/de/timklge/karooheadwind/KarooHeadwindExtension.kt +++ b/app/src/main/kotlin/de/timklge/karooheadwind/KarooHeadwindExtension.kt @@ -131,6 +131,8 @@ class KarooHeadwindExtension : KarooExtension("karoo-headwind", "1.1.1") { val data = jsonWithUnknownKeys.decodeFromString(responseString) saveCurrentData(applicationContext, data) + saveWidgetSettings(applicationContext, HeadwindWidgetSettings(currentForecastHourOffset = 0)) + Log.d(TAG, "Got updated weather info: $data") } catch(e: Exception){ Log.e(TAG, "Failed to read current weather data", e)