Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions Common/Extensions/NSUserDefaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ extension UserDefaults {
glucoseTargetRangeSchedule: glucoseTargetRangeSchedule,
maximumBasalRatePerHour: maximumBasalRatePerHour,
maximumBolus: maximumBolus,
maximumInsulinOnBoard: nil,
suspendThreshold: suspendThreshold,
retrospectiveCorrectionEnabled: bool(forKey: "com.loudnate.Loop.RetrospectiveCorrectionEnabled")
)
Expand Down
4 changes: 4 additions & 0 deletions Common/Models/LoopSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ struct LoopSettings {
var maximumBasalRatePerHour: Double?

var maximumBolus: Double?

var maximumInsulinOnBoard: Double?

var suspendThreshold: GlucoseThreshold? = nil

Expand Down Expand Up @@ -59,6 +61,7 @@ extension LoopSettings: RawRepresentable {

self.maximumBasalRatePerHour = rawValue["maximumBasalRatePerHour"] as? Double

self.maximumInsulinOnBoard = rawValue["maximumInsulinOnBoard"] as? Double
self.maximumBolus = rawValue["maximumBolus"] as? Double

if let rawThreshold = rawValue["minimumBGGuard"] as? GlucoseThreshold.RawValue {
Expand All @@ -79,6 +82,7 @@ extension LoopSettings: RawRepresentable {

raw["glucoseTargetRangeSchedule"] = glucoseTargetRangeSchedule?.rawValue
raw["maximumBasalRatePerHour"] = maximumBasalRatePerHour
raw["maximumInsulinOnBoard"] = maximumInsulinOnBoard
raw["maximumBolus"] = maximumBolus
raw["minimumBGGuard"] = suspendThreshold?.rawValue

Expand Down
Loading