fix: Allow insulin delivery while loop is suspended but pump is available #4524
+2
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



In certain cases, the Insulin dialog goes yellow and only allows entering "record-only" boluses. Before 3.4.0.0/the running mode rework of loop status, these cases were limited to when there was no pump ready to run a bolus. With the rework, the condition was mistakenly changed from "is the pump suspended" to "is the loop suspended", which is why 3.4.0.0 will let you set basal rates but will not let you bolus as long as the loop is suspended. This PR restores the 3.3.2.1 behavior, reallowing boluses when the loop is suspended but the pump is available.
As the other uses for RM's
isSuspended()function do intentionally look at all loop suspension reasons, I added a separate function calledisPumpSuspended()and use that to determine whether pump-boluses should be allowed. This way, pump suspension/disconnection should still lead to the yellow insulin dialog, but loop suspension should let you bolus again.Tested with Omnipod Dash, confirmed the insulin dialog shows the right version in the following cases:
PS: this is my first time contributing to this repo, so if this is the wrong place/way to make this happen, let me know and I'll do my best to accommodate!
Fixes #4468, fixes #4517