Explorar el Código

Add CGM app Glucose Direct (https://github.com/creepymonster/GlucoseDirectApp.git) to CGM list. Is uses same default app group as xdripswift and FreeAPS X, so no further settings are required. (#138)

* Glucose Direct

* Glucose Direct source URL and a typo
Jon B.M hace 4 años
padre
commit
96190f3ed3
Se han modificado 1 ficheros con 33 adiciones y 0 borrados
  1. 33 0
      FreeAPS/Sources/APS/CGM/CGMType.swift

+ 33 - 0
FreeAPS/Sources/APS/CGM/CGMType.swift

@@ -48,4 +48,37 @@ enum CGMType: String, JSON, CaseIterable, Identifiable {
             return URL(string: "freeaps-x://libre-transmitter")!
         }
     }
+
+    var externalLink: URL? {
+        switch self {
+        case .xdrip:
+            return URL(string: "https://github.com/JohanDegraeve/xdripswift")!
+        default: return nil
+        case .glucoseDirect:
+            return URL(string: "https://github.com/creepymonster/GlucoseDirectApp")!
+        default: return nil
+        }
+    }
+
+    var subtitle: String {
+        switch self {
+        case .nightscout:
+            return NSLocalizedString("Online or internal server", comment: "Online or internal server")
+        case .xdrip:
+            return NSLocalizedString("Shared app group", comment: "Shared app group")
+        case .dexcomG6:
+            return NSLocalizedString("Native G6 app", comment: "Native G6 app")
+        case .dexcomG5:
+            return NSLocalizedString("Native G5 app", comment: "Native G5 app")
+        case .simulator:
+            return NSLocalizedString("Simple simulator", comment: "Simple simulator")
+        case .libreTransmitter:
+            return NSLocalizedString(
+                "Direct connection with Libre 1 transmitters or Libre 2",
+                comment: "Direct connection with Libre 1 transmitters or Libre 2"
+        case .glucoseDirect:
+            return NSLocalizedString("Shared app group", comment: "Shared app group")
+            )
+        }
+    }
 }