Fix inverted temperature unit in forecast widget (#78)

This commit is contained in:
timklge 2025-03-23 22:39:03 +01:00 committed by GitHub
parent d17bf507d4
commit 31610773cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -298,7 +298,7 @@ abstract class ForecastDataType(private val karooSystem: KarooSystemService, typ
precipitation = data.current.precipitation, precipitation = data.current.precipitation,
precipitationProbability = null, precipitationProbability = null,
temperature = data.current.temperature.roundToInt(), temperature = data.current.temperature.roundToInt(),
temperatureUnit = if (settingsAndProfile.isImperialTemperature) TemperatureUnit.CELSIUS else TemperatureUnit.FAHRENHEIT, temperatureUnit = if (settingsAndProfile.isImperialTemperature) TemperatureUnit.FAHRENHEIT else TemperatureUnit.CELSIUS,
timeLabel = formattedTime, timeLabel = formattedTime,
dateLabel = if (hasNewDate) formattedDate else null, dateLabel = if (hasNewDate) formattedDate else null,
distance = null, distance = null,
@ -333,7 +333,7 @@ abstract class ForecastDataType(private val karooSystem: KarooSystemService, typ
) ?: 0, ) ?: 0,
temperature = data?.forecastData?.temperature?.get(baseIndex) temperature = data?.forecastData?.temperature?.get(baseIndex)
?.roundToInt() ?: 0, ?.roundToInt() ?: 0,
temperatureUnit = if (settingsAndProfile.isImperialTemperature) TemperatureUnit.CELSIUS else TemperatureUnit.FAHRENHEIT, temperatureUnit = if (settingsAndProfile.isImperialTemperature) TemperatureUnit.FAHRENHEIT else TemperatureUnit.CELSIUS,
timeLabel = formattedTime, timeLabel = formattedTime,
dateLabel = if (hasNewDate) formattedDate else null, dateLabel = if (hasNewDate) formattedDate else null,
distance = if (settingsAndProfile.settings.showDistanceInForecast) distanceFromCurrent else null, distance = if (settingsAndProfile.settings.showDistanceInForecast) distanceFromCurrent else null,