diff --git a/xdrip/Storyboards/da.lproj/SettingsViews.strings b/xdrip/Storyboards/da.lproj/SettingsViews.strings index a4d26cc8..7cc34c91 100644 --- a/xdrip/Storyboards/da.lproj/SettingsViews.strings +++ b/xdrip/Storyboards/da.lproj/SettingsViews.strings @@ -37,7 +37,7 @@ "settingsviews_transmitterid" = "Transmitter ID"; "settingsviews_transmitterid_text_for_button" = "Transmitter ID"; "settingsviews_givetransmitterid" = "Enter Transmitter ID"; -"settingsviews_resettransmitter" = "Reset Transmitter"; +"settingsviews_resettransmitter" = "Reset Transmitter (Anubis only)"; "settingsviews_webooptransmitter" = "Use Transmitter Algorithm?"; "settingsviews_nonfixedtransmitter" = "Enable Multi-point Calibration?"; "settingsviews_labelNonFixed" = "Multi-point Calibration"; diff --git a/xdrip/Storyboards/de.lproj/SettingsViews.strings b/xdrip/Storyboards/de.lproj/SettingsViews.strings index 4326f58d..a2140ee0 100644 --- a/xdrip/Storyboards/de.lproj/SettingsViews.strings +++ b/xdrip/Storyboards/de.lproj/SettingsViews.strings @@ -78,7 +78,7 @@ "settingsviews_nonfixedtransmitter" = "Aktiviere Mehrpunkt-Kalibrierung?"; /// transmitter settings, to explain that settings is about resetting the transmitter -"settingsviews_resettransmitter" = "Transmitter zurücksetzten"; +"settingsviews_resettransmitter" = "Transmitter zurücksetzten (Anubis)"; /// used in settings, section Info, title of the license setting "settingsviews_license" = "Lizenz"; diff --git a/xdrip/Storyboards/el.lproj/SettingsViews.strings b/xdrip/Storyboards/el.lproj/SettingsViews.strings index 0efc059c..8317628d 100644 --- a/xdrip/Storyboards/el.lproj/SettingsViews.strings +++ b/xdrip/Storyboards/el.lproj/SettingsViews.strings @@ -39,7 +39,7 @@ "settingsviews_transmitterid" = "Αναγνωριστικό πομπού"; "settingsviews_transmitterid_text_for_button" = "Αναγνωριστικό πομπού"; "settingsviews_givetransmitterid" = "Εισαγάγετε αναγνωριστικό πομπού"; -"settingsviews_resettransmitter" = "Επαναφορά πομπού"; +"settingsviews_resettransmitter" = "Επαναφορά πομπού (Anubis)"; "settingsviews_webooptransmitter" = "Χρήση αλγόριθμου πομπού;"; "settingsviews_nonfixedtransmitter" = "Ενεργοποίηση βαθμονόμησης πολλών σημείων;"; "settingsviews_labelNonFixed" = "Βαθμονόμηση πολλαπλών σημείων"; diff --git a/xdrip/Storyboards/en.lproj/SettingsViews.strings b/xdrip/Storyboards/en.lproj/SettingsViews.strings index 9d125172..a2e44cfa 100644 --- a/xdrip/Storyboards/en.lproj/SettingsViews.strings +++ b/xdrip/Storyboards/en.lproj/SettingsViews.strings @@ -63,7 +63,8 @@ "settingsviews_transmitterid" = "Transmitter ID"; "settingsviews_transmitterid_text_for_button" = "Transmitter ID"; "settingsviews_givetransmitterid" = "Enter Transmitter ID"; -"settingsviews_resettransmitter" = "Reset Transmitter"; +"settingsviews_resettransmitter" = "Reset Transmitter (Anubis only)"; +"settingsviews_resetDexcomTransmitterMessage" = "\nThis option will attempt to reset the transmitter on the next connection.\n\nNote that this will only work for G5 transmitters, very early G6 and all Anubis G6 transmitters.\n\nIt will NOT work for normal G6 or One transmitters."; "settingsviews_webooptransmitter" = "Use Transmitter Algorithm?"; "settingsviews_nonfixedtransmitter" = "Enable Multi-point Calibration?"; "settingsviews_labelNonFixed" = "Multi-point Calibration"; diff --git a/xdrip/Storyboards/es.lproj/SettingsViews.strings b/xdrip/Storyboards/es.lproj/SettingsViews.strings index 2dc75b63..ea672265 100644 --- a/xdrip/Storyboards/es.lproj/SettingsViews.strings +++ b/xdrip/Storyboards/es.lproj/SettingsViews.strings @@ -58,7 +58,8 @@ "settingsviews_transmitterid" = "ID del Transmisor"; "settingsviews_transmitterid_text_for_button" = "ID del Transmisor"; "settingsviews_givetransmitterid" = "ID del Transmisor"; -"settingsviews_resettransmitter" = "Resetear Transmisor"; +"settingsviews_resettransmitter" = "Resetear Transmisor (solo G5/Anubis)"; +"settingsviews_resetDexcomTransmitterMessage" = "\nEsta opción intentará resetear el transmisor durante la próxima conexión.\n\nEsto solo puede funcionar con transmisores G5 y transmisores G6 Anubis.\n\nNo funciona para transmisores normales tipo G6 y One."; "settingsviews_nonfixedtransmitter" = "Habilitar Calibración Multi-punto?"; "settingsviews_labelNonFixed" = "Calibración Multi-punto"; "settingsviews_sectiontitlealerting" = "Alarmas"; diff --git a/xdrip/Storyboards/fi.lproj/SettingsViews.strings b/xdrip/Storyboards/fi.lproj/SettingsViews.strings index acabcdc7..896fd61a 100644 --- a/xdrip/Storyboards/fi.lproj/SettingsViews.strings +++ b/xdrip/Storyboards/fi.lproj/SettingsViews.strings @@ -17,7 +17,7 @@ "settingsviews_transmitterid" = "Lähettimen ID"; "settingsviews_transmitterid_text_for_button" = "Lähettimen ID"; "settingsviews_givetransmitterid" = "Anna lähetettimen ID"; -"settingsviews_resettransmitter" = "Nollaa lähetin"; +"settingsviews_resettransmitter" = "Nollaa lähetin (Anubis)"; "settingsviews_nonfixedtransmitter" = "Käytä monipistekalibrointia?"; "settingsviews_labelNonFixed" = "Monipistekalibrointi"; "settingsviews_sectiontitlealerting" = "Hälytys"; diff --git a/xdrip/Storyboards/fr.lproj/SettingsViews.strings b/xdrip/Storyboards/fr.lproj/SettingsViews.strings index 882e1655..5d8d8163 100644 --- a/xdrip/Storyboards/fr.lproj/SettingsViews.strings +++ b/xdrip/Storyboards/fr.lproj/SettingsViews.strings @@ -25,7 +25,7 @@ "settingsviews_transmitterid" = "Transmetteur ID"; "settingsviews_transmitterid_text_for_button" = "Transmetteur ID"; "settingsviews_givetransmitterid" = "Entrer Transmetteur ID"; -"settingsviews_resettransmitter" = "Réinitialiser Transmetteur"; +"settingsviews_resettransmitter" = "Réinitialiser Transmetteur (Anubis)"; "settingsviews_sectiontitlealerting" = "Alarme"; "settingsviews_row_alert_types" = "Types d'alarme"; "settingsviews_row_alerts" = "Alarmes"; diff --git a/xdrip/Storyboards/it.lproj/SettingsViews.strings b/xdrip/Storyboards/it.lproj/SettingsViews.strings index 0f007e48..45c1be5b 100644 --- a/xdrip/Storyboards/it.lproj/SettingsViews.strings +++ b/xdrip/Storyboards/it.lproj/SettingsViews.strings @@ -163,7 +163,7 @@ "sendTraceFile" = "Send Issue Report"; /// transmitter settings, to explain that settings is about resetting the transmitter -"settingsviews_resettransmitter" = "Reset Transmitter"; +"settingsviews_resettransmitter" = "Reset Transmitter (Anubis only)"; /// general settings, should reading be multiplied with 10 yes or no "settingsviews_multipleAppBadgeValueWith10" = "Multiply App Badge Reading by 10?"; diff --git a/xdrip/Storyboards/nl.lproj/SettingsViews.strings b/xdrip/Storyboards/nl.lproj/SettingsViews.strings index e1c275fd..38643c90 100644 --- a/xdrip/Storyboards/nl.lproj/SettingsViews.strings +++ b/xdrip/Storyboards/nl.lproj/SettingsViews.strings @@ -28,7 +28,7 @@ "settingsviews_useIFCCA1C" = "Toon HbA1c in mmols/mol?"; "settingsviews_sectiontitletransmitter" = "Transmitter"; "settingsviews_givetransmitterid" = "Voer Transmitter ID In"; -"settingsviews_resettransmitter" = "Reset Transmitter"; +"settingsviews_resettransmitter" = "Reset Transmitter (Anubis)"; "settingsviews_nonfixedtransmitter" = "Schakel Meerpuntskalibratie In?"; "settingsviews_labelNonFixed" = "Meerpuntskalibratie"; "settingsviews_sectiontitlealerting" = "Alarmen"; diff --git a/xdrip/Storyboards/pl-PL.lproj/SettingsViews.strings b/xdrip/Storyboards/pl-PL.lproj/SettingsViews.strings index 0f007e48..45c1be5b 100644 --- a/xdrip/Storyboards/pl-PL.lproj/SettingsViews.strings +++ b/xdrip/Storyboards/pl-PL.lproj/SettingsViews.strings @@ -163,7 +163,7 @@ "sendTraceFile" = "Send Issue Report"; /// transmitter settings, to explain that settings is about resetting the transmitter -"settingsviews_resettransmitter" = "Reset Transmitter"; +"settingsviews_resettransmitter" = "Reset Transmitter (Anubis only)"; /// general settings, should reading be multiplied with 10 yes or no "settingsviews_multipleAppBadgeValueWith10" = "Multiply App Badge Reading by 10?"; diff --git a/xdrip/Storyboards/pt.lproj/SettingsViews.strings b/xdrip/Storyboards/pt.lproj/SettingsViews.strings index b0063744..cc038ad0 100644 --- a/xdrip/Storyboards/pt.lproj/SettingsViews.strings +++ b/xdrip/Storyboards/pt.lproj/SettingsViews.strings @@ -36,7 +36,7 @@ "settingsviews_transmitterid" = "ID de Transmissor"; "settingsviews_transmitterid_text_for_button" = "ID de Transmissor"; "settingsviews_givetransmitterid" = "Introduzir ID Transmissor"; -"settingsviews_resettransmitter" = "Repor Transmissor"; +"settingsviews_resettransmitter" = "Repor Transmissor (Anubis)"; "settingsviews_nonfixedtransmitter" = "Activar Calibração Multi-ponto?"; "settingsviews_labelNonFixed" = "Calibração Multi-ponto"; "settingsviews_sectiontitlealerting" = "Alarme"; diff --git a/xdrip/Storyboards/ru.lproj/SettingsViews.strings b/xdrip/Storyboards/ru.lproj/SettingsViews.strings index 7e6562af..4887b43c 100644 --- a/xdrip/Storyboards/ru.lproj/SettingsViews.strings +++ b/xdrip/Storyboards/ru.lproj/SettingsViews.strings @@ -39,7 +39,7 @@ "settingsviews_transmitterid" = "Идентификатор трансмиттера"; "settingsviews_transmitterid_text_for_button" = "Идентификатор трансмиттера"; "settingsviews_givetransmitterid" = "Введите идентификатор трансмиттера"; -"settingsviews_resettransmitter" = "Перезапустить трансмиттер?"; +"settingsviews_resettransmitter" = "Перезапустить трансмиттер (Anubis)"; "settingsviews_webooptransmitter" = "Калибровка трансмиттера?"; "settingsviews_nonfixedtransmitter" = "Многоточечная калибровка?"; "settingsviews_labelNonFixed" = "Многоточечная калибровка"; diff --git a/xdrip/Storyboards/sl.lproj/SettingsViews.strings b/xdrip/Storyboards/sl.lproj/SettingsViews.strings index b8f7b86c..aa49c4af 100644 --- a/xdrip/Storyboards/sl.lproj/SettingsViews.strings +++ b/xdrip/Storyboards/sl.lproj/SettingsViews.strings @@ -163,7 +163,7 @@ "sendTraceFile" = "Send Issue Report"; /// transmitter settings, to explain that settings is about resetting the transmitter -"settingsviews_resettransmitter" = "Reset Transmitter"; +"settingsviews_resettransmitter" = "Reset Transmitter (Anubis only)"; /// general settings, should reading be multiplied with 10 yes or no "settingsviews_multipleAppBadgeValueWith10" = "Multiply App Badge Reading by 10?"; diff --git a/xdrip/Storyboards/sv.lproj/SettingsViews.strings b/xdrip/Storyboards/sv.lproj/SettingsViews.strings index 6e874d5f..108a11a1 100644 --- a/xdrip/Storyboards/sv.lproj/SettingsViews.strings +++ b/xdrip/Storyboards/sv.lproj/SettingsViews.strings @@ -31,7 +31,7 @@ "settingsviews_transmitterid" = "Sändar-ID"; "settingsviews_transmitterid_text_for_button" = "Sändar-ID"; "settingsviews_givetransmitterid" = "Ange sändar-ID"; -"settingsviews_resettransmitter" = "Återställ sändare"; +"settingsviews_resettransmitter" = "Återställ sändare (Anubis)"; "settingsviews_nonfixedtransmitter" = "Använd flerpunktskalibrering?"; "settingsviews_labelNonFixed" = "Flerpunktskalibrering"; "settingsviews_sectiontitlealerting" = "Larm"; diff --git a/xdrip/Storyboards/tr.lproj/SettingsViews.strings b/xdrip/Storyboards/tr.lproj/SettingsViews.strings index 2bbd8e60..aa08ed1f 100644 --- a/xdrip/Storyboards/tr.lproj/SettingsViews.strings +++ b/xdrip/Storyboards/tr.lproj/SettingsViews.strings @@ -33,7 +33,7 @@ "settingsviews_transmitterid" = "Verici Kimliği"; "settingsviews_transmitterid_text_for_button" = "Verici Kimliği"; "settingsviews_givetransmitterid" = "Verici Kimliğine Gir"; -"settingsviews_resettransmitter" = "Vericiyi Sıfırla"; +"settingsviews_resettransmitter" = "Vericiyi Sıfırla (Anubis)"; "settingsviews_webooptransmitter" = "Verici algorithması Kullanılsın mı?"; "settingsviews_nonfixedtransmitter" = "Çok Noktalı Kalibrasyon Etkinleştirilsin mi?"; "settingsviews_labelNonFixed" = "Çok Noktalı Kalibrasyon"; diff --git a/xdrip/Storyboards/uk.lproj/SettingsViews.strings b/xdrip/Storyboards/uk.lproj/SettingsViews.strings index e90f12ba..a4428de3 100644 --- a/xdrip/Storyboards/uk.lproj/SettingsViews.strings +++ b/xdrip/Storyboards/uk.lproj/SettingsViews.strings @@ -151,7 +151,7 @@ "settingsviews_nightScoutAPIKey" = "API_SECRET"; /// transmitter settings, to explain that settings is about resetting the transmitter -"settingsviews_resettransmitter" = "Reset Transmitter"; +"settingsviews_resettransmitter" = "Reset Transmitter (Anubis only)"; /// home screen settings, should the main glucose chart screen be allowed? "settingsviews_allowScreenRotation" = "Allow Chart Rotation?"; diff --git a/xdrip/Storyboards/zh.lproj/SettingsViews.strings b/xdrip/Storyboards/zh.lproj/SettingsViews.strings index 63db684f..4558609c 100644 --- a/xdrip/Storyboards/zh.lproj/SettingsViews.strings +++ b/xdrip/Storyboards/zh.lproj/SettingsViews.strings @@ -130,7 +130,7 @@ "m5stack_settingsviews_textColor" = "Text Color"; /// transmitter settings, to explain that settings is about resetting the transmitter -"settingsviews_resettransmitter" = "Reset Transmitter"; +"settingsviews_resettransmitter" = "Reset Transmitter (Anubis only)"; /// general settings, should reading be multiplied with 10 yes or no "settingsviews_multipleAppBadgeValueWith10" = "Multiply App Badge Reading by 10?"; diff --git a/xdrip/Texts/TextsSettingsView.swift b/xdrip/Texts/TextsSettingsView.swift index 397b873c..f997bc36 100644 --- a/xdrip/Texts/TextsSettingsView.swift +++ b/xdrip/Texts/TextsSettingsView.swift @@ -286,7 +286,11 @@ class Texts_SettingsView { }() static let labelResetTransmitter:String = { - return NSLocalizedString("settingsviews_resettransmitter", tableName: filename, bundle: Bundle.main, value: "Reset Transmitter", comment: "transmitter settings, to explain that settings is about resetting the transmitter") + return NSLocalizedString("settingsviews_resettransmitter", tableName: filename, bundle: Bundle.main, value: "Reset Transmitter (Anubis only)", comment: "transmitter settings, to explain that settings is about resetting the transmitter") + }() + + static let resetDexcomTransmitterMessage: String = { + return NSLocalizedString("settingsviews_resetDexcomTransmitterMessage", tableName: filename, bundle: Bundle.main, value: "\nThis option will attempt to reset the transmitter on the next connection.\n\nNote that this will only work for G5 transmitters, very early G6 and all Anubis G6 transmitters.\n\nIt will NOT work for normal G6 or One transmitters.", comment: "transmitter settings, to explain that the reset option only works for certain transmitters") }() static let labelWebOOPTransmitter:String = { diff --git a/xdrip/View Controllers/BluetoothPeripheralsNavigationController/BluetoothPeripheralsViewController/BluetoothPeripheralViewController/BluetoothPeripheralViewController.swift b/xdrip/View Controllers/BluetoothPeripheralsNavigationController/BluetoothPeripheralsViewController/BluetoothPeripheralViewController/BluetoothPeripheralViewController.swift index 64055697..f01d445f 100644 --- a/xdrip/View Controllers/BluetoothPeripheralsNavigationController/BluetoothPeripheralsViewController/BluetoothPeripheralViewController/BluetoothPeripheralViewController.swift +++ b/xdrip/View Controllers/BluetoothPeripheralsNavigationController/BluetoothPeripheralsViewController/BluetoothPeripheralViewController/BluetoothPeripheralViewController.swift @@ -15,17 +15,14 @@ fileprivate enum Setting:Int, CaseIterable { /// the alias that user has given, possibly nil case alias = 1 - /// the address - case address = 2 - /// the current connection status - case connectionStatus = 3 + case connectionStatus = 2 /// timestamp when connection changed to connected or not connected - case connectOrDisconnectTimeStamp = 4 + case connectOrDisconnectTimeStamp = 3 /// transmitterID, only for devices that need it - case transmitterId = 5 + case transmitterId = 4 } @@ -821,14 +818,14 @@ class BluetoothPeripheralViewController: UIViewController { // unwrap bluetoothPeripheralManager guard let bluetoothPeripheralManager = bluetoothPeripheralManager else {return} - // textToAdd is either 'address' + the address, or 'alias' + the alias, depending if alias has a value - var textToAdd = Texts_BluetoothPeripheralView.address + " " + bluetoothPeripheral.blePeripheral.address + // textToAdd is either the name, or 'alias' + the alias, depending if alias has a value + var textToAdd = bluetoothPeripheral.blePeripheral.name if let alias = bluetoothPeripheral.blePeripheral.alias { textToAdd = Texts_BluetoothPeripheralView.bluetoothPeripheralAlias + " " + alias } // first ask user if ok to delete and if yes delete - let alert = UIAlertController(title: Texts_BluetoothPeripheralView.confirmDeletionBluetoothPeripheral + " " + textToAdd + "?", message: nil, actionHandler: { + let alert = UIAlertController(title: Texts_Common.delete , message: Texts_BluetoothPeripheralView.confirmDeletionBluetoothPeripheral + " " + textToAdd + "?", actionHandler: { // in case it's a Libre2 CGM, libre1DerivedAlgorithmParameters has a non nil value. When deleting the transmitter, by setting to nil, this will ensure that user first need to do a successful NFC scan. if let bluetoothTransmitter = bluetoothPeripheralManager.getBluetoothTransmitter(for: bluetoothPeripheral, createANewOneIfNecesssary: false), bluetoothTransmitter is CGMTransmitter { @@ -1265,17 +1262,6 @@ extension BluetoothPeripheralViewController: UITableViewDataSource, UITableViewD cell.detailTextLabel?.text = bluetoothPeripheral?.blePeripheral.name cell.accessoryType = .none - case .address: - - cell.textLabel?.text = Texts_BluetoothPeripheralView.address - cell.detailTextLabel?.text = bluetoothPeripheral?.blePeripheral.address - if cell.detailTextLabel?.text == nil { - cell.accessoryType = .none - } else { - cell.accessoryType = .disclosureIndicator - cell.accessoryView = disclosureAccessoryView - } - case .connectionStatus: cell.textLabel?.text = Texts_BluetoothPeripheralView.status @@ -1478,14 +1464,6 @@ extension BluetoothPeripheralViewController: UITableViewDataSource, UITableViewD switch setting { - case .address: - guard let bluetoothPeripheral = bluetoothPeripheral else {return} - - let alert = UIAlertController(title: Texts_BluetoothPeripheralView.address, message: bluetoothPeripheral.blePeripheral.address, actionHandler: nil) - - // present the alert - self.present(alert, animated: true, completion: nil) - case .name, .connectionStatus: break diff --git a/xdrip/View Controllers/BluetoothPeripheralsNavigationController/BluetoothPeripheralsViewController/BluetoothPeripheralViewController/Models/CGM/Dexcom/DexcomG5/DexcomG5BluetoothPeripheralViewModel.swift b/xdrip/View Controllers/BluetoothPeripheralsNavigationController/BluetoothPeripheralsViewController/BluetoothPeripheralViewController/Models/CGM/Dexcom/DexcomG5/DexcomG5BluetoothPeripheralViewModel.swift index c8151d88..8822f0fc 100644 --- a/xdrip/View Controllers/BluetoothPeripheralsNavigationController/BluetoothPeripheralsViewController/BluetoothPeripheralViewController/Models/CGM/Dexcom/DexcomG5/DexcomG5BluetoothPeripheralViewModel.swift +++ b/xdrip/View Controllers/BluetoothPeripheralsNavigationController/BluetoothPeripheralsViewController/BluetoothPeripheralViewController/Models/CGM/Dexcom/DexcomG5/DexcomG5BluetoothPeripheralViewModel.swift @@ -1,6 +1,7 @@ import Foundation import UIKit import CoreBluetooth +import os class DexcomG5BluetoothPeripheralViewModel { @@ -43,12 +44,6 @@ class DexcomG5BluetoothPeripheralViewModel { case voltageA = 0 case voltageB = 1 - - case batteryRuntime = 2 - - case batteryTemperature = 3 - - case batteryResist = 4 } @@ -329,25 +324,30 @@ extension DexcomG5BluetoothPeripheralViewModel: BluetoothPeripheralViewModel { // set isOn value to cGMG5Transmitter cGMG5Transmitter.reset(requested: isOn) + if isOn { + + // define and present alertcontroller, this will show a message to explain that the reset function only works with certain transmitters + let alert = UIAlertController(title: Texts_BluetoothPeripheralView.resetRequired, message: Texts_SettingsView.resetDexcomTransmitterMessage, actionHandler: nil) + + self.bluetoothPeripheralViewController?.present(alert, animated: true, completion: nil) + + } + } }) case .lastResetTimeStamp: + + cell.textLabel?.text = Texts_BluetoothPeripheralView.lastResetTimeStamp if let lastResetTimeStamp = dexcomG5.lastResetTimeStamp { - - cell.textLabel?.text = Texts_BluetoothPeripheralView.lastResetTimeStamp cell.detailTextLabel?.text = lastResetTimeStamp.toStringInUserLocale(timeStyle: .short, dateStyle: .short) - cell.accessoryType = .none - } else { - - cell.textLabel?.text = Texts_BluetoothPeripheralView.lastResetTimeStampNotKnown - cell.detailTextLabel?.text = nil - cell.accessoryType = .none - + cell.detailTextLabel?.text = Texts_Common.unknown } + + cell.accessoryType = .none } @@ -384,21 +384,6 @@ extension DexcomG5BluetoothPeripheralViewModel: BluetoothPeripheralViewModel { cell.detailTextLabel?.text = dexcomG5.voltageB != 0 ? dexcomBatteryLevelIndicator + dexcomG5.voltageB.description + "0 mV" : "" - case .batteryResist: - - cell.textLabel?.text = "Resistance" - cell.detailTextLabel?.text = dexcomG5.batteryResist != 0 ? dexcomG5.batteryResist.description : "" - - case .batteryRuntime: - - cell.textLabel?.text = "Runtime" - cell.detailTextLabel?.text = dexcomG5.batteryRuntime != 0 ? ( dexcomG5.batteryRuntime != -1 ? dexcomG5.batteryRuntime.description : "n/a" ) : "" - - case .batteryTemperature: - - cell.textLabel?.text = "Temperature" - cell.detailTextLabel?.text = dexcomG5.batteryTemperature != 0 ? dexcomG5.batteryTemperature.description : "" - } } @@ -409,42 +394,51 @@ extension DexcomG5BluetoothPeripheralViewModel: BluetoothPeripheralViewModel { guard let setting = Settings(rawValue: rawValue) else { fatalError("DexcomG5BluetoothPeripheralViewModel userDidSelectRow, unexpected setting") } - switch setting { + // just show select row actions for the general dexcom section + switch section { - case .sensorStatus: + case 1: - // firmware text could be longer than screen width, clicking the row allos to see it in pop up with more text place - if let sensorStatus = dexcomG5?.sensorStatus { - return .showInfoText(title: Texts_Common.sensorStatus, message: "\n" + sensorStatus) - } - - case .sensorStartDate: - - if let startDate = dexcomG5?.sensorStartDate { + switch setting { - var startDateString = startDate.toStringInUserLocale(timeStyle: .short, dateStyle: .short) + case .sensorStatus: - startDateString += "\n\n" + startDate.daysAndHoursAgo() + " " + Texts_HomeView.ago + // firmware text could be longer than screen width, clicking the row allos to see it in pop up with more text place + if let sensorStatus = dexcomG5?.sensorStatus { + return .showInfoText(title: Texts_Common.sensorStatus, message: "\n" + sensorStatus) + } - return .showInfoText(title: Texts_BluetoothPeripheralView.sensorStartDate, message: "\n" + startDateString) + case .sensorStartDate: + + if let startDate = dexcomG5?.sensorStartDate { + + var startDateString = startDate.toStringInUserLocale(timeStyle: .short, dateStyle: .short) + + startDateString += "\n\n" + startDate.daysAndHoursAgo() + " " + Texts_HomeView.ago + + return .showInfoText(title: Texts_BluetoothPeripheralView.sensorStartDate, message: "\n" + startDateString) + + } + + case .transmitterStartDate: + + if let startDate = dexcomG5?.transmitterStartDate { + + var startDateString = startDate.toStringInUserLocale(timeStyle: .short, dateStyle: .short) + + startDateString += "\n\n" + startDate.daysAndHoursAgo() + " " + Texts_HomeView.ago + + return .showInfoText(title: Texts_BluetoothPeripheralView.transmittterStartDate, message: "\n" + startDateString) + + } + + case .firmWareVersion, .userOtherApp: + return .nothing } - case .transmitterStartDate: - - if let startDate = dexcomG5?.transmitterStartDate { - - var startDateString = startDate.toStringInUserLocale(timeStyle: .short, dateStyle: .short) - - startDateString += "\n\n" + startDate.daysAndHoursAgo() + " " + Texts_HomeView.ago - - return .showInfoText(title: Texts_BluetoothPeripheralView.transmittterStartDate, message: "\n" + startDateString) - - } - - case .firmWareVersion, .userOtherApp: + default: return .nothing - } return .nothing @@ -470,16 +464,8 @@ extension DexcomG5BluetoothPeripheralViewModel: BluetoothPeripheralViewModel { } func numberOfSections() -> Int { - - if isFireFly() { - return DexcomSection.allCases.count - 1 - - } else { - - return DexcomSection.allCases.count - - } + return DexcomSection.allCases.count } @@ -586,3 +572,4 @@ extension DexcomG5BluetoothPeripheralViewModel: CGMG5TransmitterDelegate { } } +