diff --git a/Meshtastic/Helpers/BLEManager.swift b/Meshtastic/Helpers/BLEManager.swift index 32940e50..18d9e67e 100644 --- a/Meshtastic/Helpers/BLEManager.swift +++ b/Meshtastic/Helpers/BLEManager.swift @@ -158,12 +158,6 @@ class BLEManager: NSObject, CBPeripheralDelegate, ObservableObject { isConnected = true if userSettings?.preferredPeripheralId.count ?? 0 < 1 { userSettings?.preferredPeripheralId = peripheral.identifier.uuidString - // preferredPeripheral = true - } else if userSettings!.preferredPeripheralId == peripheral.identifier.uuidString { - // preferredPeripheral = true - } else { - // preferredPeripheral = false - print("Trying to connect a non prefered peripheral") } UserDefaults.standard.synchronize() // Invalidate and reset connection timer count diff --git a/Meshtastic/Views/Bluetooth/Connect.swift b/Meshtastic/Views/Bluetooth/Connect.swift index d5826289..6fd4844c 100644 --- a/Meshtastic/Views/Bluetooth/Connect.swift +++ b/Meshtastic/Views/Bluetooth/Connect.swift @@ -162,9 +162,16 @@ struct Connect: View { Section(header: Text("available.radios").font(.title)) { ForEach(bleManager.peripherals.filter({ $0.peripheral.state == CBPeripheralState.disconnected }).sorted(by: { $0.name > $1.name })) { peripheral in HStack { - Image(systemName: "circle.fill") - .imageScale(.large).foregroundColor(.gray) - .padding(.trailing) + if userSettings.preferredPeripheralId == peripheral.peripheral.identifier.uuidString { + Image(systemName: "star.fill") + .imageScale(.large).foregroundColor(.yellow) + .padding(.trailing) + } else { + Image(systemName: "circle.fill") + .imageScale(.large).foregroundColor(.gray) + .padding(.trailing) + } + Button(action: { if userSettings.preferredPeripheralId.count > 0 && peripheral.peripheral.identifier.uuidString != userSettings.preferredPeripheralId { presentingSwitchPreferredPeripheral = true @@ -173,7 +180,7 @@ struct Connect: View { self.bleManager.connectTo(peripheral: peripheral.peripheral) } }) { - Text(peripheral.name).font(.title3) + Text(peripheral.name).font(.callout) } Spacer() VStack { diff --git a/Meshtastic/Views/Nodes/EnvironmentMetricsLog.swift b/Meshtastic/Views/Nodes/EnvironmentMetricsLog.swift index 13033dc9..46a16dd8 100644 --- a/Meshtastic/Views/Nodes/EnvironmentMetricsLog.swift +++ b/Meshtastic/Views/Nodes/EnvironmentMetricsLog.swift @@ -33,17 +33,17 @@ struct EnvironmentMetricsLog: View { } TableColumn("Humidity") { em in if em.metricsType == 1 { - Text("\(String(format: "%.2f", em.relativeHumidity))") + Text("\(String(format: "%.2f", em.relativeHumidity))%") } } TableColumn("Barometric Pressure") { em in if em.metricsType == 1 { - Text("\(String(format: "%.2f", em.barometricPressure))") + Text("\(String(format: "%.2f", em.barometricPressure)) hPa") } } TableColumn("gas.resistance") { em in if em.metricsType == 1 { - Text("\(String(format: "%.2f", em.gasResistance))") + Text("\(String(format: "%.2f", em.gasResistance)) ohms") } } TableColumn("current") { em in @@ -98,7 +98,7 @@ struct EnvironmentMetricsLog: View { Text(em.temperature.formattedTemperature()) .font(.caption) - Text("\(String(format: "%.2f", em.relativeHumidity))") + Text("\(String(format: "%.2f", em.relativeHumidity))%") .font(.caption) Text("\(String(format: "%.2f", em.barometricPressure))") .font(.caption)