Sfoglia il codice sorgente

Merge pull request #618 from marv-out/snoozeNoPodAlert

Prevent Looping when Pump is Suspended
Deniz Cengiz 11 mesi fa
parent
commit
8076a2dee0
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  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")
         }
 
+        // 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 😁
         if isManualTempBasal {
             throw APSError.manualBasalTemp(message: "Loop not possible during the manual basal temp")