From 99bb8610aea7a9cedb4e35fc29196e85218b73cc Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Mon, 20 Feb 2023 22:15:35 -0800 Subject: [PATCH] Humidity --- Meshtastic/Views/Nodes/NodeDetail.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Meshtastic/Views/Nodes/NodeDetail.swift b/Meshtastic/Views/Nodes/NodeDetail.swift index 97785de0..652852e0 100644 --- a/Meshtastic/Views/Nodes/NodeDetail.swift +++ b/Meshtastic/Views/Nodes/NodeDetail.swift @@ -40,6 +40,7 @@ struct NodeDetail: View { /// The current weather condition for the city. @State private var condition: WeatherCondition? @State private var temperature: Measurement? + @State private var humidity: Int? @State private var symbolName: String = "cloud.fill" @State private var attributionLink: URL? @@ -87,6 +88,10 @@ struct NodeDetail: View { VStack { Label(temperature?.formatted(.measurement(width: .narrow)) ?? "??", systemImage: symbolName) .font(.caption) + + + Label("\(humidity ?? 0)%", systemImage: "humidity") + .font(.caption2) } .padding(10) .background(.thinMaterial, in: RoundedRectangle(cornerRadius: 12, style: .continuous)) @@ -469,6 +474,7 @@ struct NodeDetail: View { let weather = try await WeatherService.shared.weather(for: mostRecent.nodeLocation!) condition = weather.currentWeather.condition temperature = weather.currentWeather.temperature + humidity = Int(weather.currentWeather.humidity * 100) symbolName = weather.currentWeather.symbolName let attribution = try await WeatherService.shared.attribution