Skip to content

Commit

Permalink
Merge pull request #290 from aug0211/alpha-fat-protein-to-NS
Browse files Browse the repository at this point in the history
Resolve issue #289: implement NS-provided display of fat/protein
  • Loading branch information
bjornoleh authored Jun 9, 2024
2 parents 4589f86 + 254907b commit fb838e4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions FreeAPS/Sources/APS/Storage/CarbsStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ final class BaseCarbsStorage: CarbsStorage, Injectable {
bolus: nil,
insulin: nil,
carbs: $0.carbs,
fat: nil,
protein: nil,
fat: $0.fat,
protein: $0.protein,
foodType: $0.note,
targetTop: nil,
targetBottom: nil
Expand Down
4 changes: 2 additions & 2 deletions FreeAPS/Sources/APS/Storage/PumpHistoryStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ extension NightscoutTreatment {
insulin: nil,
notes: nil,
carbs: Decimal(event.carbInput ?? 0),
fat: nil,
protein: nil,
fat: Decimal(event.fatInput ?? 0),
protein: Decimal(event.proteinInput ?? 0),
targetTop: nil,
targetBottom: nil
)
Expand Down
8 changes: 8 additions & 0 deletions FreeAPS/Sources/Models/PumpHistoryEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ struct PumpHistoryEvent: JSON, Equatable {
let rate: Decimal?
let temp: TempType?
let carbInput: Int?
let fatInput: Int?
let proteinInput: Int?
let note: String?
let isSMB: Bool?
let isExternalInsulin: Bool?
Expand All @@ -25,6 +27,8 @@ struct PumpHistoryEvent: JSON, Equatable {
rate: Decimal? = nil,
temp: TempType? = nil,
carbInput: Int? = nil,
fatInput: Int? = nil,
proteinInput: Int? = nil,
note: String? = nil,
isSMB: Bool? = nil,
isExternalInsulin: Bool? = nil
Expand All @@ -38,6 +42,8 @@ struct PumpHistoryEvent: JSON, Equatable {
self.rate = rate
self.temp = temp
self.carbInput = carbInput
self.fatInput = fatInput
self.proteinInput = proteinInput
self.note = note
self.isSMB = isSMB
self.isExternalInsulin = isExternalInsulin
Expand Down Expand Up @@ -88,6 +94,8 @@ extension PumpHistoryEvent {
case rate
case temp
case carbInput = "carb_input"
case fatInput
case proteinInput
case note
case isSMB
case isExternalInsulin
Expand Down

0 comments on commit fb838e4

Please sign in to comment.