Promote CO2 temperatures to summary if no other temp is present. (#6153)

This commit is contained in:
Dane Evans
2026-07-09 00:55:04 +10:00
committed by GitHub
parent 03ceba2211
commit 0816581b4a

View File

@@ -354,6 +354,7 @@ private fun NodeSignalRow(thatNode: Node, isThisNode: Boolean, contentColor: Col
private fun gatherSensors(node: Node, tempInFahrenheit: Boolean, contentColor: Color): List<@Composable () -> Unit> {
val items = mutableListOf<@Composable () -> Unit>()
val env = node.environmentMetrics
val aq = node.airQualityMetrics
val pax = node.paxcounter
if (pax.ble != 0 || pax.wifi != 0) {
@@ -363,12 +364,21 @@ private fun gatherSensors(node: Node, tempInFahrenheit: Boolean, contentColor: C
if ((env.temperature ?: 0f) != 0f) {
val temp = MetricFormatter.temperature(env.temperature ?: 0f, tempInFahrenheit)
items.add { TemperatureInfo(temp = temp, contentColor = contentColor) }
} else if ((aq.co2_temperature ?: 0f) != 0f) {
val temp = MetricFormatter.temperature(aq.co2_temperature ?: 0f, tempInFahrenheit)
items.add { TemperatureInfo(temp = temp, contentColor = contentColor) }
}
if ((env.relative_humidity ?: 0f) != 0f) {
items.add {
HumidityInfo(humidity = MetricFormatter.humidity(env.relative_humidity ?: 0f), contentColor = contentColor)
}
} else if ((aq.co2_humidity ?: 0f) != 0f) {
items.add {
HumidityInfo(humidity = MetricFormatter.humidity(aq.co2_humidity ?: 0f), contentColor = contentColor)
}
}
if ((env.barometric_pressure ?: 0f) != 0f) {
items.add {
PressureInfo(