Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve issue #289: implement NS-provided display of fat/protein #290

Merged
merged 1 commit into from
Jun 9, 2024
Merged
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
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