mirror of
https://github.com/home-assistant/iOS.git
synced 2026-02-19 17:31:56 -06:00
## Summary Fixed two issues mentioned in #3067; Sensors in the suggested sensors view should be grouped by server now The order of the selected sensors is now respected if they come from two different servers ## Screenshots  ## Any other notes The `for` loop bothers me, Swift feels a lot like Kotlin and a `map` seems more appriopiate. Because an async call happens in it I could not get `map` working that is nice to read, let me know if there is a better option chatgpt gave me this ``` let sensorValues = try await withThrowingTaskGroup(of: WidgetSensorsEntry.SensorData?.self) { group in for sensor in configuration.sensors ?? [] { group.addTask { guard let server = Current.servers.all.first(where: { $0.identifier.rawValue == sensor.serverId }) else { throw WidgetSensorsDataError.noServers } return try await fetchSensorData(for: sensor, server: server) } } return try await group.compactMap { $0 } } ```