Skip to content

Commit

Permalink
reversed concentration adaption?!
Browse files Browse the repository at this point in the history
  • Loading branch information
mountrcg committed Feb 7, 2025
1 parent c31b548 commit da54b23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions FreeAPS/Sources/APS/APSManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ final class BaseAPSManager: APSManager, Injectable {

debug(.apsManager, "Enact temp basal \(rate) - \(duration)")

let roundedAmout = pump.roundToSupportedBasalRate(unitsPerHour: rate)
let roundedAmout = pump.roundToSupportedBasalRate(unitsPerHour: rate / self.concentration.concentration)
pump.enactTempBasal(unitsPerHour: roundedAmout, for: duration) { error in
if let error = error {
debug(.apsManager, "Temp Basal failed with error: \(error.localizedDescription)")
Expand All @@ -517,7 +517,7 @@ final class BaseAPSManager: APSManager, Injectable {
debug(.apsManager, "Temp Basal succeeded")
let temp = TempBasal(
duration: Int(duration / 60),
rate: Decimal(rate * self.concentration.concentration),
rate: Decimal(rate),
temp: .absolute,
timestamp: Date()
)
Expand Down

0 comments on commit da54b23

Please sign in to comment.