mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix(ui): Prevent NaN values in environment metrics (#4316)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
847152acd7
commit
50a04a98b8
3 changed files with 18 additions and 8 deletions
|
|
@ -145,15 +145,17 @@ internal fun EnvironmentMetrics(
|
|||
}
|
||||
if (hasTemperature() && hasRelativeHumidity()) {
|
||||
val dewPoint = UnitConversions.calculateDewPoint(temperature, relativeHumidity)
|
||||
add(
|
||||
DrawableMetricInfo(
|
||||
Res.string.dew_point,
|
||||
dewPoint.toTempString(isFahrenheit),
|
||||
org.meshtastic.feature.node.R.drawable.ic_outlined_dew_point_24,
|
||||
),
|
||||
)
|
||||
if (!dewPoint.isNaN()) {
|
||||
add(
|
||||
DrawableMetricInfo(
|
||||
Res.string.dew_point,
|
||||
dewPoint.toTempString(isFahrenheit),
|
||||
org.meshtastic.feature.node.R.drawable.ic_outlined_dew_point_24,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
if (hasSoilTemperature()) {
|
||||
if (hasSoilTemperature() && !soilTemperature.isNaN()) {
|
||||
add(
|
||||
DrawableMetricInfo(
|
||||
Res.string.soil_temperature,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue