소스 검색

replace onlyLowHigh to onlyAlarmLimits

kskandis 1 년 전
부모
커밋
5f8900c111

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

@@ -35,7 +35,7 @@ struct FreeAPSSettings: JSON, Equatable {
     var notificationsCgm: Bool = true
     var notificationsCarb: Bool = true
     var notificationsAlgorithm: Bool = true
-    var glucoseNotificationsOption: GlucoseNotificationsOption = .onlyLowHigh
+    var glucoseNotificationsOption: GlucoseNotificationsOption = .onlyAlarmLimits
     var useAlarmSound: Bool = false
     var addSourceInfoToGlucoseNotifications: Bool = false
     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 }
     case disabled
     case alwaysEveryCGM
-    case onlyLowHigh
+    case onlyAlarmLimits
 
     var displayName: String {
         switch self {
         case .disabled: return "Disabled"
         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 {
     final class StateModel: BaseStateModel<Provider> {
         @Published var glucoseBadge = false
-        @Published var glucoseNotificationsOption: GlucoseNotificationsOption = .onlyLowHigh
+        @Published var glucoseNotificationsOption: GlucoseNotificationsOption = .onlyAlarmLimits
         @Published var useAlarmSound = false
         @Published var addSourceInfoToGlucoseNotifications = false
         @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) {
-                                                    Text("Low/High Alarms:").bold()
+                                                    Text("Only Alarm Limits:").bold()
                                                     Text(
                                                         "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:
             guard settings.notificationsCarb else { return false }
         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 }
         case .algorithm:
             guard settings.notificationsAlgorithm else { return false }