Преглед на файлове

Add guard for suspended pump in enactDetermination()

Marvin Polscheit преди 11 месеца
родител
ревизия
c5f72a7d85
променени са 1 файла, в които са добавени 6 реда и са изтрити 0 реда
  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")