Skip to content

Commit

Permalink
Add bolusVolume to NS enacted struct
Browse files Browse the repository at this point in the history
  • Loading branch information
ps2 committed Mar 26, 2022
1 parent 1e520fc commit 31e5853
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions NightscoutServiceKit/Extensions/StoredDosingDecision.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,10 @@ extension StoredDosingDecision {
}

var loopStatusEnacted: LoopEnacted? {
guard case .some(.tempBasal(let tempBasal)) = pumpManagerStatus?.basalDeliveryState else {
guard let automaticDoseRecommendation = automaticDoseRecommendation, errors.isEmpty, let tempBasal = automaticDoseRecommendation.basalAdjustment else {
return nil
}
let duration = tempBasal.endDate.timeIntervalSince(tempBasal.startDate)
return LoopEnacted(rate: tempBasal.unitsPerHour, duration: duration, timestamp: tempBasal.startDate, received: true)
return LoopEnacted(rate: tempBasal.unitsPerHour, duration: tempBasal.duration, timestamp: date, received: true, bolusVolume: automaticDoseRecommendation.bolusUnits ?? 0)
}

var loopStatusFailureReason: String? {
Expand Down

0 comments on commit 31e5853

Please sign in to comment.