Explorar el Código

replace onlyLowHigh to onlyAlarmLimits

kskandis hace 1 año
padre
commit
5f8900c111

+ 1 - 1
FreeAPS/Sources/Models/FreeAPSSettings.swift

@@ -35,7 +35,7 @@ struct FreeAPSSettings: JSON, Equatable {
     var notificationsCgm: Bool = true
     var notificationsCgm: Bool = true
     var notificationsCarb: Bool = true
     var notificationsCarb: Bool = true
     var notificationsAlgorithm: Bool = true
     var notificationsAlgorithm: Bool = true
-    var glucoseNotificationsOption: GlucoseNotificationsOption = .onlyLowHigh
+    var glucoseNotificationsOption: GlucoseNotificationsOption = .onlyAlarmLimits
     var useAlarmSound: Bool = false
     var useAlarmSound: Bool = false
     var addSourceInfoToGlucoseNotifications: Bool = false
     var addSourceInfoToGlucoseNotifications: Bool = false
     var lowGlucose: Decimal = 72
     var lowGlucose: Decimal = 72

+ 2 - 2
FreeAPS/Sources/Models/GlucoseNotificationsOption.swift

@@ -10,13 +10,13 @@ public enum GlucoseNotificationsOption: String, JSON, CaseIterable, Identifiable
     public var id: String { rawValue }
     public var id: String { rawValue }
     case disabled
     case disabled
     case alwaysEveryCGM
     case alwaysEveryCGM
-    case onlyLowHigh
+    case onlyAlarmLimits
 
 
     var displayName: String {
     var displayName: String {
         switch self {
         switch self {
         case .disabled: return "Disabled"
         case .disabled: return "Disabled"
         case .alwaysEveryCGM: return "Always"
         case .alwaysEveryCGM: return "Always"
-        case .onlyLowHigh: return "Low/High Alarms"
+        case .onlyAlarmLimits: return "Only Alarm Limits"
         }
         }
     }
     }
 }
 }

+ 1 - 1
FreeAPS/Sources/Modules/GlucoseNotificationSettings/GlucoseNotificationSettingsStateModel.swift

@@ -3,7 +3,7 @@ import SwiftUI
 extension GlucoseNotificationSettings {
 extension GlucoseNotificationSettings {
     final class StateModel: BaseStateModel<Provider> {
     final class StateModel: BaseStateModel<Provider> {
         @Published var glucoseBadge = false
         @Published var glucoseBadge = false
-        @Published var glucoseNotificationsOption: GlucoseNotificationsOption = .onlyLowHigh
+        @Published var glucoseNotificationsOption: GlucoseNotificationsOption = .onlyAlarmLimits
         @Published var useAlarmSound = false
         @Published var useAlarmSound = false
         @Published var addSourceInfoToGlucoseNotifications = false
         @Published var addSourceInfoToGlucoseNotifications = false
         @Published var lowGlucose: Decimal = 0
         @Published var lowGlucose: Decimal = 0

+ 1 - 1
FreeAPS/Sources/Modules/GlucoseNotificationSettings/View/GlucoseNotificationSettingsRootView.swift

@@ -229,7 +229,7 @@ extension GlucoseNotificationSettings {
                                                     )
                                                     )
                                                 }
                                                 }
                                                 VStack(alignment: .leading, spacing: 5) {
                                                 VStack(alignment: .leading, spacing: 5) {
-                                                    Text("Low/High Alarms:").bold()
+                                                    Text("Only Alarm Limits:").bold()
                                                     Text(
                                                     Text(
                                                         "A notification will be triggered only when glucose is below LOW and above HIGH settings as defined in Glucose Alarm Limits below."
                                                         "A notification will be triggered only when glucose is below LOW and above HIGH settings as defined in Glucose Alarm Limits below."
                                                     )
                                                     )

+ 4 - 1
FreeAPS/Sources/Router/Router.swift

@@ -60,7 +60,10 @@ final class BaseRouter: Router {
         case .carb:
         case .carb:
             guard settings.notificationsCarb else { return false }
             guard settings.notificationsCarb else { return false }
         case .glucose:
         case .glucose:
-            guard (message.type == .warning && settings.glucoseNotificationsOption == GlucoseNotificationsOption.onlyLowHigh) ||
+            guard (
+                message.type == .warning &&
+                    settings.glucoseNotificationsOption == GlucoseNotificationsOption.onlyAlarmLimits
+            ) ||
                 settings.glucoseNotificationsOption == GlucoseNotificationsOption.alwaysEveryCGM else { return false }
                 settings.glucoseNotificationsOption == GlucoseNotificationsOption.alwaysEveryCGM else { return false }
         case .algorithm:
         case .algorithm:
             guard settings.notificationsAlgorithm else { return false }
             guard settings.notificationsAlgorithm else { return false }