فهرست منبع

Add guard for suspended pump in enactDetermination()

Marvin Polscheit 1 سال پیش
والد
کامیت
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")
         }
 
+        // 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")