Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Common/FeatureFlags.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Foundation
let FeatureFlags = FeatureFlagConfiguration()

struct FeatureFlagConfiguration: Decodable {
let cgmManagerCategorizeManualGlucoseRangeEnabled: Bool
let criticalAlertsEnabled: Bool
let deleteAllButtonEnabled: Bool
let fiaspInsulinModelEnabled: Bool
Expand All @@ -26,6 +27,12 @@ struct FeatureFlagConfiguration: Decodable {
let walshInsulinModelEnabled: Bool

fileprivate init() {
#if CGM_MANAGER_CATEGORIZE_GLUCOSE_RANGE_ENABLED
self.cgmManagerCategorizeManualGlucoseRangeEnabled = true
#else
self.cgmManagerCategorizeManualGlucoseRangeEnabled = false
#endif

#if CRITICAL_ALERTS_ENABLED
self.criticalAlertsEnabled = true
#else
Expand Down Expand Up @@ -119,6 +126,7 @@ struct FeatureFlagConfiguration: Decodable {
extension FeatureFlagConfiguration : CustomDebugStringConvertible {
var debugDescription: String {
return [
"* cgmManagerCategorizeManualGlucoseRangeEnabled: \(cgmManagerCategorizeManualGlucoseRangeEnabled)",
"* criticalAlertsEnabled: \(criticalAlertsEnabled)",
"* deleteAllButtonEnabled: \(deleteAllButtonEnabled)",
"* fiaspInsulinModelEnabled: \(fiaspInsulinModelEnabled)",
Expand Down
26 changes: 13 additions & 13 deletions Common/Models/StatusExtensionContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ struct NetBasalContext {
let end: Date?
}

struct SensorDisplayableContext: SensorDisplayable {
struct GlucoseDisplayableContext: GlucoseDisplayable {
let isStateValid: Bool
let stateDescription: String
let trendType: GlucoseTrend?
let isLocal: Bool
let glucoseValueType: GlucoseValueType?
let glucoseRangeCategory: GlucoseRangeCategory?
}

struct GlucoseContext: GlucoseValue {
Expand Down Expand Up @@ -128,15 +128,15 @@ extension NetBasalContext: RawRepresentable {
}
}

extension SensorDisplayableContext: RawRepresentable {
extension GlucoseDisplayableContext: RawRepresentable {
typealias RawValue = [String: Any]

init(_ other: SensorDisplayable) {
init(_ other: GlucoseDisplayable) {
isStateValid = other.isStateValid
stateDescription = other.stateDescription
isLocal = other.isLocal
trendType = other.trendType
glucoseValueType = other.glucoseValueType
glucoseRangeCategory = other.glucoseRangeCategory
}

init?(rawValue: RawValue) {
Expand All @@ -158,10 +158,10 @@ extension SensorDisplayableContext: RawRepresentable {
trendType = nil
}

if let glucoseValueRawValue = rawValue["glucoseValueType"] as? GlucoseValueType.RawValue {
glucoseValueType = GlucoseValueType(rawValue: glucoseValueRawValue)
if let glucoseRangeCategoryRawValue = rawValue["glucoseRangeCategory"] as? GlucoseRangeCategory.RawValue {
glucoseRangeCategory = GlucoseRangeCategory(rawValue: glucoseRangeCategoryRawValue)
} else {
glucoseValueType = nil
glucoseRangeCategory = nil
}
}

Expand All @@ -172,7 +172,7 @@ extension SensorDisplayableContext: RawRepresentable {
"isLocal": isLocal
]
raw["trendType"] = trendType?.rawValue
raw["glucoseValueType"] = glucoseValueType?.rawValue
raw["glucoseRangeCategory"] = glucoseRangeCategory?.rawValue

return raw
}
Expand Down Expand Up @@ -287,7 +287,7 @@ struct StatusExtensionContext: RawRepresentable {
var netBasal: NetBasalContext?
var batteryPercentage: Double?
var reservoirCapacity: Double?
var sensor: SensorDisplayableContext?
var glucoseDisplay: GlucoseDisplayableContext?
var pumpManagerHUDViewContext: PumpManagerHUDViewContext?
var pumpStatusHighlightContext: DeviceStatusHighlightContext?
var pumpLifecycleProgressContext: DeviceLifecycleProgressContext?
Expand All @@ -313,8 +313,8 @@ struct StatusExtensionContext: RawRepresentable {
batteryPercentage = rawValue["batteryPercentage"] as? Double
reservoirCapacity = rawValue["reservoirCapacity"] as? Double

if let rawValue = rawValue["sensor"] as? SensorDisplayableContext.RawValue {
sensor = SensorDisplayableContext(rawValue: rawValue)
if let rawValue = rawValue["glucoseDisplay"] as? GlucoseDisplayableContext.RawValue {
glucoseDisplay = GlucoseDisplayableContext(rawValue: rawValue)
}

if let rawPumpManagerHUDViewContext = rawValue["pumpManagerHUDViewContext"] as? PumpManagerHUDViewContext.RawValue {
Expand Down Expand Up @@ -348,7 +348,7 @@ struct StatusExtensionContext: RawRepresentable {
raw["netBasal"] = netBasal?.rawValue
raw["batteryPercentage"] = batteryPercentage
raw["reservoirCapacity"] = reservoirCapacity
raw["sensor"] = sensor?.rawValue
raw["glucoseDisplay"] = glucoseDisplay?.rawValue
raw["pumpManagerHUDViewContext"] = pumpManagerHUDViewContext?.rawValue
raw["pumpStatusHighlightContext"] = pumpStatusHighlightContext?.rawValue
raw["pumpLifecycleProgressContext"] = pumpLifecycleProgressContext?.rawValue
Expand Down
8 changes: 2 additions & 6 deletions Loop Status Extension/StatusViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ class StatusViewController: UIViewController, NCWidgetProviding {
hudView.cgmStatusHUD.tintColor = .label
hudView.pumpStatusHUD.tintColor = .insulinTintColor
hudView.backgroundColor = .clear

if view.bounds.width < 375 {
// need to adjust for narrow display
hudView.adjustViewsForNarrowDisplay = true
}

// given the reduced width of the widget, allow for tighter spacing
hudView.containerView.spacing = 6.0
Expand Down Expand Up @@ -305,7 +300,8 @@ class StatusViewController: UIViewController, NCWidgetProviding {
at: lastGlucose.startDate,
unit: unit,
staleGlucoseAge: recencyInterval,
sensor: context.sensor
glucoseDisplay: context.glucoseDisplay,
wasUserEntered: lastGlucose.wasUserEntered
)
}

Expand Down
28 changes: 23 additions & 5 deletions Loop.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -419,17 +419,19 @@
B405E35924D2A75B00DD058D /* DerivedAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A966152923EA5A37005D8B29 /* DerivedAssets.xcassets */; };
B405E35A24D2B1A400DD058D /* HUDAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4F2C15961E09E94E00E160D4 /* HUDAssets.xcassets */; };
B405E35B24D2E05600DD058D /* HUDAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4F2C15961E09E94E00E160D4 /* HUDAssets.xcassets */; };
B41B2BB32514E9C5006F7014 /* ManualGlucoseDisplayable.swift in Sources */ = {isa = PBXBuildFile; fileRef = B41B2BB22514E9C4006F7014 /* ManualGlucoseDisplayable.swift */; };
B42C951424A3C76000857C73 /* CGMStatusHUDViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B42C951324A3C76000857C73 /* CGMStatusHUDViewModel.swift */; };
B43DA44124D9C12100CAFF4E /* DismissibleHostingController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B43DA44024D9C12100CAFF4E /* DismissibleHostingController.swift */; };
B47A791C2508009E006C0E11 /* ChartAxisValuesStaticGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = B47A791B2508009E006C0E11 /* ChartAxisValuesStaticGenerator.swift */; };
B48B0BAC24900093009A48DE /* PumpStatusHUDView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B48B0BAB24900093009A48DE /* PumpStatusHUDView.swift */; };
B490A03F24D0550F00F509FA /* GlucoseValueType.swift in Sources */ = {isa = PBXBuildFile; fileRef = B490A03E24D0550F00F509FA /* GlucoseValueType.swift */; };
B490A03F24D0550F00F509FA /* GlucoseRangeCategory.swift in Sources */ = {isa = PBXBuildFile; fileRef = B490A03E24D0550F00F509FA /* GlucoseRangeCategory.swift */; };
B490A04124D0559D00F509FA /* DeviceLifecycleProgressState.swift in Sources */ = {isa = PBXBuildFile; fileRef = B490A04024D0559D00F509FA /* DeviceLifecycleProgressState.swift */; };
B490A04324D055D900F509FA /* DeviceStatusHighlight.swift in Sources */ = {isa = PBXBuildFile; fileRef = B490A04224D055D900F509FA /* DeviceStatusHighlight.swift */; };
B491B09E24D0B600004CBE8F /* DerivedAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A966152523EA5A25005D8B29 /* DerivedAssets.xcassets */; };
B491B0A324D0B66D004CBE8F /* Color.swift in Sources */ = {isa = PBXBuildFile; fileRef = B490A03C24D04F9400F509FA /* Color.swift */; };
B491B0A424D0B675004CBE8F /* UIColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43BFF0B11E45C18400FF19A9 /* UIColor.swift */; };
B4AC0D3F24B9005300CDB0A1 /* UIImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 437CEEE31CDE5C0A003C8C80 /* UIImage.swift */; };
B4BC56382518DEA900373647 /* CGMStatusHUDViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4BC56372518DEA900373647 /* CGMStatusHUDViewModelTests.swift */; };
B4D620D424D9EDB900043B3C /* GuidanceColors.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4D620D324D9EDB900043B3C /* GuidanceColors.swift */; };
B4E96D4B248A6B6E002DABAD /* DeviceStatusHUDView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4E96D4A248A6B6E002DABAD /* DeviceStatusHUDView.swift */; };
B4E96D4F248A6E20002DABAD /* CGMStatusHUDView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4E96D4E248A6E20002DABAD /* CGMStatusHUDView.swift */; };
Expand Down Expand Up @@ -1268,15 +1270,17 @@
A9F703722489BC8500C98AD8 /* CarbStore+SimulatedCoreData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CarbStore+SimulatedCoreData.swift"; sourceTree = "<group>"; };
A9F703742489C9A000C98AD8 /* GlucoseStore+SimulatedCoreData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "GlucoseStore+SimulatedCoreData.swift"; sourceTree = "<group>"; };
A9F703762489D8AA00C98AD8 /* PersistentDeviceLog+SimulatedCoreData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PersistentDeviceLog+SimulatedCoreData.swift"; sourceTree = "<group>"; };
B41B2BB22514E9C4006F7014 /* ManualGlucoseDisplayable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ManualGlucoseDisplayable.swift; sourceTree = "<group>"; };
B42C951324A3C76000857C73 /* CGMStatusHUDViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CGMStatusHUDViewModel.swift; sourceTree = "<group>"; };
B42C951624A3CAF200857C73 /* NotificationsCriticalAlertPermissionsViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotificationsCriticalAlertPermissionsViewModel.swift; sourceTree = "<group>"; };
B43DA44024D9C12100CAFF4E /* DismissibleHostingController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DismissibleHostingController.swift; sourceTree = "<group>"; };
B47A791B2508009E006C0E11 /* ChartAxisValuesStaticGenerator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChartAxisValuesStaticGenerator.swift; sourceTree = "<group>"; };
B48B0BAB24900093009A48DE /* PumpStatusHUDView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PumpStatusHUDView.swift; sourceTree = "<group>"; };
B490A03C24D04F9400F509FA /* Color.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Color.swift; sourceTree = "<group>"; };
B490A03E24D0550F00F509FA /* GlucoseValueType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GlucoseValueType.swift; sourceTree = "<group>"; };
B490A03E24D0550F00F509FA /* GlucoseRangeCategory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GlucoseRangeCategory.swift; sourceTree = "<group>"; };
B490A04024D0559D00F509FA /* DeviceLifecycleProgressState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceLifecycleProgressState.swift; sourceTree = "<group>"; };
B490A04224D055D900F509FA /* DeviceStatusHighlight.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceStatusHighlight.swift; sourceTree = "<group>"; };
B4BC56372518DEA900373647 /* CGMStatusHUDViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CGMStatusHUDViewModelTests.swift; sourceTree = "<group>"; };
B4D620D324D9EDB900043B3C /* GuidanceColors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GuidanceColors.swift; sourceTree = "<group>"; };
B4E96D4A248A6B6E002DABAD /* DeviceStatusHUDView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceStatusHUDView.swift; sourceTree = "<group>"; };
B4E96D4E248A6E20002DABAD /* CGMStatusHUDView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CGMStatusHUDView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1592,10 +1596,12 @@
C17824A41E1AD4D100D9D25C /* BolusRecommendation.swift */,
43C2FAE01EB656A500364AFF /* GlucoseEffectVelocity.swift */,
436A0DA41D236A2A00104B24 /* LoopError.swift */,
E9C00EF424C623EF00628F35 /* LoopSettings+Loop.swift */,
4F526D601DF8D9A900A04910 /* NetBasal.swift */,
B41B2BB22514E9C4006F7014 /* ManualGlucoseDisplayable.swift */,
438D42F81D7C88BC003244B0 /* PredictionInputEffect.swift */,
4328E0311CFC068900E199AA /* WatchContext+LoopKit.swift */,
C165B8CD23302C5D0004112E /* RemoteCommand.swift */,
4328E0311CFC068900E199AA /* WatchContext+LoopKit.swift */,
E9C00EF424C623EF00628F35 /* LoopSettings+Loop.swift */,
A987CD4824A58A0100439ADC /* ZipArchive.swift */,
);
Expand Down Expand Up @@ -1966,7 +1972,9 @@
E9C58A7624DB510500487A17 /* Fixtures */,
A9E6DFE4246A0418005B1A1C /* Extensions */,
1DA7A83F24476E8C008257F0 /* Managers */,
E93E86AC24DDE02C00FF40C8 /* Mock Stores */,
A9E6DFED246A0460005B1A1C /* Models */,
B4BC56362518DE8800373647 /* ViewModels */,
43E2D90F1D20C581004DA55F /* Info.plist */,
A9DF02CA24F72B9E00B7C988 /* CriticalEventLogTests.swift */,
A9DAE7CF2332D77F006AE942 /* LoopTests.swift */,
Expand Down Expand Up @@ -2079,7 +2087,7 @@
B490A04024D0559D00F509FA /* DeviceLifecycleProgressState.swift */,
B490A04224D055D900F509FA /* DeviceStatusHighlight.swift */,
B43DA44024D9C12100CAFF4E /* DismissibleHostingController.swift */,
B490A03E24D0550F00F509FA /* GlucoseValueType.swift */,
B490A03E24D0550F00F509FA /* GlucoseRangeCategory.swift */,
B4D620D324D9EDB900043B3C /* GuidanceColors.swift */,
1DB1CA4C24A55F0000B3B94C /* Image.swift */,
434F54561D287FDB002A9274 /* NibLoadable.swift */,
Expand Down Expand Up @@ -2314,6 +2322,14 @@
path = ViewModel;
sourceTree = "<group>";
};
B4BC56362518DE8800373647 /* ViewModels */ = {
isa = PBXGroup;
children = (
B4BC56372518DEA900373647 /* CGMStatusHUDViewModelTests.swift */,
);
path = ViewModels;
sourceTree = "<group>";
};
C16DA84022E8E104008624C2 /* Plugins */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -3307,6 +3323,7 @@
1DDE273E24AEA4B000796622 /* SettingsView.swift in Sources */,
A9B607B0247F000F00792BE4 /* UserNotifications+Loop.swift in Sources */,
43F89CA322BDFBBD006BB54E /* UIActivityIndicatorView.swift in Sources */,
B41B2BB32514E9C5006F7014 /* ManualGlucoseDisplayable.swift in Sources */,
A999D40624663D18004C89D4 /* PumpManagerError.swift in Sources */,
437D9BA31D7BC977007245E8 /* PredictionTableViewController.swift in Sources */,
4344628F20A7ADD500C4BE6F /* UserDefaults+CGM.swift in Sources */,
Expand Down Expand Up @@ -3556,6 +3573,7 @@
A9DAE7D02332D77F006AE942 /* LoopTests.swift in Sources */,
E93E86B024DDE1BD00FF40C8 /* MockGlucoseStore.swift in Sources */,
1DFE9E172447B6270082C280 /* UserNotificationAlertPresenterTests.swift in Sources */,
B4BC56382518DEA900373647 /* CGMStatusHUDViewModelTests.swift in Sources */,
A9E6DFE8246A043D005B1A1C /* DoseStoreTests.swift in Sources */,
E93E86B224DDE21D00FF40C8 /* MockCarbStore.swift in Sources */,
);
Expand Down Expand Up @@ -3599,7 +3617,7 @@
43FCEEB3221BC3B60013DD30 /* DoseChart.swift in Sources */,
4F7528AA1DFE215100C322D6 /* HKUnit.swift in Sources */,
4FB76FB61E8C426900B39636 /* ChartPointsTouchHighlightLayerViewCache.swift in Sources */,
B490A03F24D0550F00F509FA /* GlucoseValueType.swift in Sources */,
B490A03F24D0550F00F509FA /* GlucoseRangeCategory.swift in Sources */,
4F2C15931E09BF2C00E160D4 /* HUDView.swift in Sources */,
43BFF0B71E45C20C00FF19A9 /* NumberFormatter.swift in Sources */,
B43DA44124D9C12100CAFF4E /* DismissibleHostingController.swift in Sources */,
Expand Down
28 changes: 26 additions & 2 deletions Loop/Managers/DeviceDataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,32 @@ extension DeviceDataManager {
return pumpManager?.status
}

var sensorState: SensorDisplayable? {
return cgmManager?.sensorState
func glucoseDisplay(for glucose: GlucoseSampleValue?) -> GlucoseDisplayable? {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] this responsibility seems odd here in DeviceDataManager. I would have expected this to live in a ViewModel somewhere (maybe CGMStatusHUDViewModel?)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it's here because of the interaction with cgmManager. And the interaction with cgmManager is the not-great part, imo; we need to eventually make Loop be able to evaluate glucoseRangeCategories independently of a CGM; it's not right that the CGM is evaluating ranges for the fingerstick value. I think once we have resolved that, this can go somewhere that makes more sense.

if let glucose = glucose, glucose.wasUserEntered {
guard FeatureFlags.cgmManagerCategorizeManualGlucoseRangeEnabled else {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think categorization would differ based on manual/cgm values, so we should have one categorization routine for each. In this case, we are splitting between Tidepool Loop, which uses the Dexcom CGMManager categorization routine, and DIY Loop, which will use a hardcoded categorization routine for now. But eventually, they will use the same routine in Loop (which might coordinate with the CGMManager in some ways, but the settings and config will be in Loop).

In essence, I'm suggesting that this temporary hardcoded categorization be used for both cgm and fingerstick glucose values if the flag is turned on.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know. I'll add this now.

// Using Dexcom default glucose thresholds to categories a manual glucose entry
let urgentLowGlucoseThreshold = HKQuantity(unit: .milligramsPerDeciliter, doubleValue: 55)
let lowGlucoseThreshold = HKQuantity(unit: .milligramsPerDeciliter, doubleValue: 80)
let highGlucoseThreshold = HKQuantity(unit: .milligramsPerDeciliter, doubleValue: 200)

switch glucose.quantity {
case ...urgentLowGlucoseThreshold:
return ManualGlucoseDisplayable(glucoseRangeCategory: .urgentLow)
case urgentLowGlucoseThreshold..<lowGlucoseThreshold:
return ManualGlucoseDisplayable(glucoseRangeCategory: .low)
case lowGlucoseThreshold..<highGlucoseThreshold:
return ManualGlucoseDisplayable(glucoseRangeCategory: .normal)
default:
return ManualGlucoseDisplayable(glucoseRangeCategory: .high)
}
}

// the CGM manager needs to determine the glucose range category for a manual glucose based on its managed glucose thresholds
let glucoseRangeCategory = (cgmManager as? CGMManagerUI)?.glucoseRangeCategory(for: glucose)
return ManualGlucoseDisplayable(glucoseRangeCategory: glucoseRangeCategory)
} else {
return cgmManager?.glucoseDisplay
}
}

func updatePumpManagerBLEHeartbeatPreference() {
Expand Down
14 changes: 7 additions & 7 deletions Loop/Managers/StatusExtensionDataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ final class StatusExtensionDataManager {
context.batteryPercentage = dataManager.pumpManager?.status.pumpBatteryChargeRemaining
context.reservoirCapacity = dataManager.pumpManager?.pumpReservoirCapacity

if let sensorInfo = dataManager.sensorState {
context.sensor = SensorDisplayableContext(
isStateValid: sensorInfo.isStateValid,
stateDescription: sensorInfo.stateDescription,
trendType: sensorInfo.trendType,
isLocal: sensorInfo.isLocal,
glucoseValueType: sensorInfo.glucoseValueType
if let glucoseDisplay = dataManager.glucoseDisplay(for: dataManager.glucoseStore.latestGlucose) {
context.glucoseDisplay = GlucoseDisplayableContext(
isStateValid: glucoseDisplay.isStateValid,
stateDescription: glucoseDisplay.stateDescription,
trendType: glucoseDisplay.trendType,
isLocal: glucoseDisplay.isLocal,
glucoseRangeCategory: glucoseDisplay.glucoseRangeCategory
)
}

Expand Down
Loading