mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Hide humidity, pressure and wind weather widgets if the value is <= 0
This commit is contained in:
parent
386e7fa898
commit
723ee25108
1 changed files with 9 additions and 3 deletions
|
|
@ -169,9 +169,15 @@ struct NodeDetail: View {
|
|||
.padding(.vertical)
|
||||
LazyVGrid(columns: gridItemLayout) {
|
||||
WeatherConditionsCompactWidget(temperature: String(node.latestEnvironmentMetrics?.temperature.shortFormattedTemperature() ?? "99°"), symbolName: "cloud.sun", description: "TEMP")
|
||||
HumidityCompactWidget(humidity: Int(node.latestEnvironmentMetrics?.relativeHumidity ?? 0.0), dewPoint: String(format: "%.0f", calculateDewPoint(temp: node.latestEnvironmentMetrics?.temperature ?? 0.0, relativeHumidity: node.latestEnvironmentMetrics?.relativeHumidity ?? 0.0)) + "°")
|
||||
PressureCompactWidget(pressure: String(format: "%.2f", node.latestEnvironmentMetrics?.barometricPressure ?? 0.0), unit: "mbar", low: node.latestEnvironmentMetrics?.barometricPressure ?? 0.0 <= 1009.144) // hectopascal
|
||||
WindCompactWidget(speed: String(node.latestEnvironmentMetrics?.windSpeed ?? 0.0), gust: String(node.latestEnvironmentMetrics?.windGust ?? 0.0), direction: "")
|
||||
if node.latestEnvironmentMetrics?.relativeHumidity ?? 0.0 > 0.0 {
|
||||
HumidityCompactWidget(humidity: Int(node.latestEnvironmentMetrics?.relativeHumidity ?? 0.0), dewPoint: String(format: "%.0f", calculateDewPoint(temp: node.latestEnvironmentMetrics?.temperature ?? 0.0, relativeHumidity: node.latestEnvironmentMetrics?.relativeHumidity ?? 0.0)) + "°")
|
||||
}
|
||||
if node.latestEnvironmentMetrics?.barometricPressure ?? 0.0 > 0.0 {
|
||||
PressureCompactWidget(pressure: String(format: "%.2f", node.latestEnvironmentMetrics?.barometricPressure ?? 0.0), unit: "mbar", low: node.latestEnvironmentMetrics?.barometricPressure ?? 0.0 <= 1009.144)
|
||||
}
|
||||
if node.latestEnvironmentMetrics?.windSpeed ?? 0.0 > 0.0 {
|
||||
WindCompactWidget(speed: String(node.latestEnvironmentMetrics?.windSpeed ?? 0.0), gust: String(node.latestEnvironmentMetrics?.windGust ?? 0.0), direction: "")
|
||||
}
|
||||
}
|
||||
.padding(.bottom)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue