Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for recordOnly bolus when pump is disconnected or suspended #3254

Merged
merged 3 commits into from
Mar 18, 2024

Conversation

jbr7rr
Copy link

@jbr7rr jbr7rr commented Mar 3, 2024

This PR allows to record a bolus using the Insulin button when loop is disconnected or pump is suspended/not active

Have seen this request on discord some time ago, and experienced it myself.

Consider following scenarios:

  • You are in a sauna with disconnected/suspended pump, you want to do pen bolus
  • You canula is blocked or leaking, you do not trust AAPS to run, so you suspend pump and do manual pen bolus

There are other scenarios as well when you want to do a pen bolus while disconnected.

Tested:

  • loop disconnected (medtrum)
  • Medtrum Patch not activated
  • Dash pod not active
  • Insight not initialized

Update:
Screenshot_20240304-194743_AAPS

@Der-Schubi
Copy link

Tested with ComboV2, works well. Thanks!
I really missed that, as you wrote: Sauna, disconnected pump and pen.

@MilosKozak
Copy link
Contributor

I generally have nothing against but it must visible on first sight that is record only. Maybe even on icon. Otherwise it can lead to mistakes.
Not sure how ... waiting for ideas

@Der-Schubi
Copy link

I generally have nothing against but it must visible on first sight that is record only. Maybe even on icon. Otherwise it can lead to mistakes. Not sure how ... waiting for ideas

For example the text / checkbox "do not bolus ..." could be red?!

@jbr7rr
Copy link
Author

jbr7rr commented Mar 4, 2024

I generally have nothing against but it must visible on first sight that is record only. Maybe even on icon. Otherwise it can lead to mistakes.
Not sure how ... waiting for ideas

Currently upon entering the bolus, it is clearly stated in the confirmation screen.
I could make the checkbox/text "do not bolus, record only" red as Schubi suggested.

WhatsApp Image 2024-03-04 at 10 19 05

@MilosKozak
Copy link
Contributor

MilosKozak commented Mar 4, 2024

Based on what I see on my daughter, nobody reads
I could imagine different color of icon + different color of window header for example

@jbr7rr
Copy link
Author

jbr7rr commented Mar 4, 2024

Based what I see on my daughter, nobody reads I could imagine different color of icon + different color of window header for example

Something like this?
Screenshot_20240304-193343_AAPS
Screenshot_20240304-194743_AAPS
Screenshot_20240304-194827_AAPS

@@ -583,8 +583,22 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
&& preferences.get(BooleanKey.OverviewShowTreatmentButton)).toVisibility()
binding.buttonsLayout.wizardButton.visibility = (!loop.isDisconnected && pump.isInitialized() && !pump.isSuspended() && profile != null
&& preferences.get(BooleanKey.OverviewShowWizardButton)).toVisibility()
binding.buttonsLayout.insulinButton.visibility = (!loop.isDisconnected && pump.isInitialized() && !pump.isSuspended() && profile != null
&& preferences.get(BooleanKey.OverviewShowInsulinButton)).toVisibility()
binding.buttonsLayout.insulinButton.visibility = (profile != null && preferences.get(BooleanKey.OverviewShowInsulinButton)).toVisibility()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.toVisibility() should not be there

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see it's on more places here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its needed here because:
Type mismatch.
Required:
Int
Found:
Boolean

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, my mistake. There is a bracket I didn't see

@olorinmaia
Copy link
Contributor

Thumbs up from me :) I actually thought about this myself one day as we disconnect pump when in the swimming pool!

Small "bug", when pump is connected (tested with virtual pump) text color of "Insulin" is white instead of blue like in dev/master.
image

@jbr7rr
Copy link
Author

jbr7rr commented Mar 8, 2024

Small "bug", when pump is connected (tested with virtual pump) text color of "Insulin" is white instead of blue like in dev/master.

Thx, fixed

Copy link

sonarcloud bot commented Mar 8, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
8.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@MilosKozak MilosKozak merged commit 675fbb9 into nightscout:dev Mar 18, 2024
0 of 3 checks passed
@jbr7rr jbr7rr deleted the bolus-when-suspended branch March 18, 2024 13:01
@vanelsberg
Copy link
Contributor

This feature was high on my list:
Thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants