Kaynağa Gözat

Merge pull request #618 from marv-out/snoozeNoPodAlert

Prevent Looping when Pump is Suspended
Deniz Cengiz 11 ay önce
ebeveyn
işleme
8076a2dee0
1 değiştirilmiş dosya ile 6 ekleme ve 0 silme
  1. 6 0
      Trio/Sources/APS/APSManager.swift

+ 6 - 0
Trio/Sources/APS/APSManager.swift

@@ -668,6 +668,12 @@ final class BaseAPSManager: APSManager, Injectable {
             throw APSError.apsError(message: "Pump not set")
             throw APSError.apsError(message: "Pump not set")
         }
         }
 
 
+        // Check if pump is suspended and abort if it is
+        if pump.status.pumpStatus.suspended {
+            info(.apsManager, "Skipping enactDetermination because pump is suspended")
+            return // return without throwing an error
+        }
+
         // Unable to do temp basal during manual temp basal 😁
         // Unable to do temp basal during manual temp basal 😁
         if isManualTempBasal {
         if isManualTempBasal {
             throw APSError.manualBasalTemp(message: "Loop not possible during the manual basal temp")
             throw APSError.manualBasalTemp(message: "Loop not possible during the manual basal temp")