Skip to content

Commit

Permalink
Fix sealevelPressure is mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
timklge committed Feb 11, 2025
1 parent fa96904 commit 78d9e65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ data class OpenMeteoData(
@SerialName("precipitation") val precipitation: Double,
@SerialName("cloud_cover") val cloudCover: Int,
@SerialName("surface_pressure") val surfacePressure: Double,
@SerialName("pressure_msl") val sealevelPressure: Double,
@SerialName("pressure_msl") val sealevelPressure: Double? = null,
@SerialName("wind_speed_10m") val windSpeed: Double,
@SerialName("wind_direction_10m") val windDirection: Double,
@SerialName("wind_gusts_10m") val windGusts: Double,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import de.timklge.karooheadwind.OpenMeteoCurrentWeatherResponse

class SealevelPressureDataType(context: Context) : BaseDataType(context, "sealevelPressure"){
override fun getValue(data: OpenMeteoCurrentWeatherResponse): Double {
return data.current.sealevelPressure
return data.current.sealevelPressure ?: 0.0
}
}

0 comments on commit 78d9e65

Please sign in to comment.