Parcourir la source

Merge branch 'dev' into fix-temp-target-enteredby

Deniz Cengiz il y a 1 mois
Parent
commit
a8162fe5a8
2 fichiers modifiés avec 9 ajouts et 3 suppressions
  1. 1 1
      Config.xcconfig
  2. 8 2
      Trio/Sources/APS/DeviceDataManager.swift

+ 1 - 1
Config.xcconfig

@@ -19,7 +19,7 @@ TRIO_APP_GROUP_ID = group.org.nightscout.$(DEVELOPMENT_TEAM).trio.trio-app-group
 
 // The developers set the version numbers, please leave them alone
 APP_VERSION = 0.6.0
-APP_DEV_VERSION = 0.6.0.74
+APP_DEV_VERSION = 0.6.0.75
 APP_BUILD_NUMBER = 1
 COPYRIGHT_NOTICE =
 

+ 8 - 2
Trio/Sources/APS/DeviceDataManager.swift

@@ -126,7 +126,10 @@ final class BaseDeviceDataManager: DeviceDataManager, Injectable {
                     pumpExpiresAtDate.send(endTime)
                 }
                 if let medtrumPump = pumpManager as? MedtrumPumpManager {
-                    guard let endTime = medtrumPump.state.patchExpiresAt else {
+                    // Medtrum's state.patchExpiresAt is actually lifespan + grace
+                    // keeping this in line with omnipod, we will use just the lifetime
+                    // i.e., state.patchGracePeriodFrom
+                    guard let endTime = medtrumPump.state.patchGracePeriodFrom else {
                         pumpExpiresAtDate.send(nil)
                         return
                     }
@@ -534,7 +537,10 @@ extension BaseDeviceDataManager: PumpManagerDelegate {
                 $0.pumpReservoirDidChange(Decimal(medtrumPump.state.reservoir))
             }
 
-            guard let endTime = medtrumPump.state.patchExpiresAt else {
+            // Medtrum's state.patchExpiresAt is actually lifespan + grace
+            // keeping this in line with omnipod, we will use just the lifetime
+            // i.e., state.patchGracePeriodFrom
+            guard let endTime = medtrumPump.state.patchGracePeriodFrom else {
                 pumpExpiresAtDate.send(nil)
                 return
             }