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

Shortcuts - refactoring and add new functionalities #177

Draft
wants to merge 35 commits into
base: dev
Choose a base branch
from

Conversation

avouspierre
Copy link
Contributor

@avouspierre avouspierre commented May 13, 2024

Shortcuts Trio

this PR refactors the shortcuts and adds new shortcuts for Trio.

Refactoring

  • Same organisation of files
  • Remove junk code
  • Add internationalization of shortcuts with the use of catalog string of Xcode

List of shortcuts available

  • Override preset selection, application and cancelation
  • Add Carbs shortcuts
  • Carbs preset list and display all carbs, fat and proteins associated
  • Create And Apply a temporary target with the definition of target, duration, date of start
  • Apply a preset temporary target
  • Get the state of Trio : BG, IOB, COB
  • Command a bolus

Some examples described in the picture :

When your iPhone alarm clock is ringing a Profile override is started/canceled.
• When you get to your gym a Profile Override is started/canceled.
• When you step inside your car (which has CarPlay) a profile override is started/canceled.
• When you start an exercise a profile override is started.
• When you end an exercise the active profile override is canceled.
• .

Select a carb preset, add carbs associated and define a override preset List of shortcuts available Cancel temporary preset and/or override preset and adds carbs in the past
IMG_93A644ADB473-1 IMG_E62CF95824EE-1 IMG_F4A8EE137CD2-1
temporary preset with a date in 60 minutes When I start a fitness activity, start sport override except if my BG > 180, wait 30 min and notify me When you get a specific sms from your parent a specific profile override is started/canceled
IMG_16251E5F9A67-1 RPReplay_Final1714157264 https://github.com/nightscout/Open-iAPS/assets/4339604/5f0a81a8-4445-449a-94cf-6805fbf316b9

New UI for config shortcuts :

config config
Simulator Screenshot - iPhone 15 - 2024-05-01 at 18 23 50 Simulator Screenshot - iPhone 15 - 2024-05-01 at 18 24 00

Detail of the commit (squash all commits about shortcuts) :
Refactoring the shortcuts with adding :

  • same organisation of files
  • remove junk code
  • add internationalization of shortcuts
  • add AddCarbs shortcuts
  • add createAndApply temp target
  • Add override preset selection, application and cancelation
  • Add Carbs preset list and display all carbs, fat and proteins associated
  • fix carb list shortcut issue
  • fix carb added with fat/protein shortcut
  • add bolus shortcuts with guardrails
  • harmonise temporary target labels
  • add in Trio a shortcut config allowing to authorize bolus enact and guardrails.
  • Add localisation for the UI shortcuts config view and shortcuts
  • minor improvements to avoid warning in build

avouspierre and others added 2 commits May 13, 2024 19:57
Refactoring the shortcuts with adding :
- same organisation of files
- remove junk code
- add internationalization of shortcuts
- add AddCarbs shortcuts
- add createAndApply temp target
- Add override preset selection, application and cancelation
- Add Carbs preset list and display all carbs, fat and proteins associated
- fix carb list shortcut issue
- fix carb added with fat/protein  shortcut
- add bolus shortcuts with guardrails
- harmonise temporary target labels
- add in OIAPS a shortcut config allowing to authorize bolus enact and guardrails.
- Add localisation for the UI shortcuts config view and shortcuts
- minor improvements to avoid warning in build
md/dL instead of mg/L
for instead of during

# Conflicts:
#	FreeAPS/Sources/Localizations/ShortcutsDetail/ShortcutsDetail.xcstrings
@mountrcg
Copy link
Contributor

mountrcg commented May 15, 2024

@avouspierre I made some suggestions to harmonize the texts and also list all shortcuts for the Trio app
https://github.com/mountrcg/Trio/commits/dev%2Bshortcuts/

However the Bolus shortcut does not popup the amount dialog in itself as the Add carbs shortcut does.

Copy link
Contributor

@mountrcg mountrcg left a comment

Choose a reason for hiding this comment

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

see commits I proposed in link above

@LiroyvH
Copy link
Contributor

LiroyvH commented May 15, 2024

Q: I see temp override and temp target. I believe currently they're just the temp targets. Are overrides supposed to be what's called a Profile in-app?

@mountrcg
Copy link
Contributor

mountrcg commented May 15, 2024

Q: I see temp override and temp target. I believe currently they're just the temp targets. Are overrides supposed to be what's called a Profile in-app?

That was one thing I suggested, calling them overrides without temp as they can be also without an end date.

@avouspierre
Copy link
Contributor Author

thanks @mountrcg ! I updated the PR with your contribution + 1 more fix for wording

Copy link

sonarcloud bot commented May 16, 2024

Quality Gate Passed Quality Gate passed

Issues
18 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@mountrcg
Copy link
Contributor

@avouspierre the Bolus shortcut when run as shortcut and not integrated as an action does not ask for bolus amount. Instread throws an error. Carbs works fine this way. Could you add that to Bolus as well

Bolus Carbs
Simulator Screenshot - Dev 12 mini - 2024-05-17 at 09 40 12 Simulator Screenshot - Dev 12 mini - 2024-05-17 at 09 40 35

@aug0211
Copy link
Contributor

aug0211 commented May 23, 2024

@avouspierre the Bolus shortcut when run as shortcut and not integrated as an action does not ask for bolus amount. Instread throws an error. Carbs works fine this way. Could you add that to Bolus as well

Bolus Carbs
Simulator Screenshot - Dev 12 mini - 2024-05-17 at 09 40 12 Simulator Screenshot - Dev 12 mini - 2024-05-17 at 09 40 35

The fix for this is to not mark bolusQuantity as optional in the BolusIntent parameter declaration (line 28 of BolusIntent.swift). After doing this, we must remove the guard (and matching else{...}) at line 50 (and below) of the same file.

Will add these notes in a review.

Copy link
Contributor

@aug0211 aug0211 left a comment

Choose a reason for hiding this comment

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

Requested change at line 28 and 50 to ensure a bolus amount is declared in the shortcut prompt (bug identified by @mountrcg).

FreeAPS/Sources/Shortcuts/Bolus/BolusIntent.swift Outdated Show resolved Hide resolved
FreeAPS/Sources/Shortcuts/Bolus/BolusIntent.swift Outdated Show resolved Hide resolved
• Mark bolusQuantity as non-optional
• Remove associated guard/else {...} since this is not optional
aug0211
aug0211 previously approved these changes May 23, 2024
@aug0211
Copy link
Contributor

aug0211 commented May 23, 2024

Committed requested changes to the PR and tested on a physical device. Ready to merge in my opinion.

@marionbarker or @bjornoleh or @mountrcg could you give a 👍 and merge if you agree?

IMG_3537
IMG_3538
IMG_3539
IMG_3540

@aug0211 aug0211 requested a review from mountrcg May 24, 2024 14:37
@bjornoleh bjornoleh added the enhancement New feature or request label Jun 6, 2024
Copy link
Contributor

@Sjoerd-Bo3 Sjoerd-Bo3 left a comment

Choose a reason for hiding this comment

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

Didn’t look at the localisations. And do the tables work with crowdin?
But found 2 foreign changes that should not be in this PR.
For the rest LGTM

.github/workflows/build_trio.yml Outdated Show resolved Hide resolved
Trio.xcworkspace/xcshareddata/swiftpm/Package.resolved Outdated Show resolved Hide resolved
@bjornoleh
Copy link
Contributor

bjornoleh commented Jun 6, 2024

I merged dev into dev+shortcutslocally and built with Xcode.

Then I got the following unstaged changes:

% git diff
diff --git a/FreeAPS/Sources/Localizations/ShortcutsDetail/ShortcutsDetail.xcstrings b/FreeAPS/Sources/Localizations/ShortcutsDetail/ShortcutsDetail.xcstrings
index afd4d815..804ff32c 100644
--- a/FreeAPS/Sources/Localizations/ShortcutsDetail/ShortcutsDetail.xcstrings
+++ b/FreeAPS/Sources/Localizations/ShortcutsDetail/ShortcutsDetail.xcstrings
@@ -538,6 +538,7 @@
       }
     },
     "Amount not correctly defined" : {
+      "extractionState" : "stale",
       "localizations" : {
         "de" : {
           "stringUnit" : {

So Xcode seems to have added the "extractionState" : "stale", line on build time.

The app built ok and is running on my phone, but I haven't done any actual testing yet.

@bjornoleh
Copy link
Contributor

bjornoleh commented Jun 6, 2024

Quick comment:

When limiting bolus to insulin recommendation, a more specific info string could be presented in the shortcut.

Tested 1 U bolus:

Recommended was 0,5 U

Response:
"A bolus command of 0,5 U of insulin was sent"

Suggestion: Add info to indicate that the bolus was limited to xx U due to the "Limit by insulin suggestion estimation".

Similarly when issuing a bolus above the max bolus limit, it would be good to get a specific response that tells that the bolus was limited to that value.

Another comment: this settings string could possibly be improved/shortened: "Limit by insulin suggestion estimation"

@bjornoleh
Copy link
Contributor

Regarding the uncommitted changes and sync with dev, I opened this PR:
avouspierre#1

@mountrcg
Copy link
Contributor

mountrcg commented Jun 18, 2024

If an override with no name is set, the message “No active Override to cancel” is displayed. But the override is correctly cancelled in Trio

@Sjoerd-Bo3

I observe, that the cancellation of the override is somehow shifted by 1 event.

  • apply an override preset with name "xyz"
  • use cancel shortcut
    • message no active override to cancel
    • but the cancellation will happen
  • apply another override without name
  • use cancel shortcut
    • message Override "xyz" canceled <- btw typo, should read cancelled
    • but the cancellation will happen

I somehow cannot reproduce consistently the above behaviour.

Hitting Cancel Override twice in succession will lead to:
Bildschirmfoto 2024-06-18 um 14 20 43
Hitting a third and fourth time will not trigger the error!?!

@mountrcg
Copy link
Contributor

mountrcg commented Jun 21, 2024

So I re-tested all of the above and could not reproduce any of the errors. Could it have been some initial thing as that were the first overrides I activated on a fresh installation?

EDIT: sry I forgot to specify that I tested this: #177 (comment)
and not the all issues in thread above

@bjornoleh
Copy link
Contributor

So I re-tested all of the above and could not reproduce any of the errors. Could it have been some initial thing as that were the first overrides I activated on a fresh installation?

Ok, thanks. Can you verify there are no uncommitted changes on build now after the last commit? If so I can give my approval.

@bjornoleh
Copy link
Contributor

However it is strange that the mmol value is correctly converted to mgdL when saved in Trio (target values are always stored as mgdL), but units are not recognised for the message?

I dove in to it yesterday and not sure how to fix but it is releated to you not getting prompted the unit type if you just click the message. It picks the right unit during calculation of the action but the step you showed is before that point. So if you didnt manaully chose a unit it is just not filled yet. But gets filled during execution, a step later. And gets also the right one for calculation. Looking into why I cant use dynamic content (searching for the right unit in settings before execution) in the app intents. So will comeback to this today.

Ref my previous post: Unless there are still tings to do regarding the above.

@MikePlante1
Copy link
Contributor

MikePlante1 commented Jun 25, 2024

I merged this PR into the latest alpha and tested on a simulator...

I toggled on Allows to bolus with shortcuts and left Method to limit the bolus amount set to Limit by max bolus. I then opened the Shortcuts app and executed Trio Bolus and entered 55. A popup appeared to confirm I wanted to bolus 55U and I hit Continue to which it alerted A bolus command of 10U of insulin was sent.

In this circumstance, I think the bolus shortcut should fail and no insulin should be delivered, not the maximum allowed amount. For the test above, it could have been someone who meant to type 5.5 instead of 55 and didn't look too closely at the popup confirmation.

Also, here's a couple wording suggestions:

current:

Allows to bolus with shortcuts

suggestion:

Allow bolusing with shortcuts

current:

The application lets you create automations using shortcuts. Go to the Shortcuts application to create new automations.

suggestion:
I think this can just be removed entirely. Shortcuts has been in iOS for almost 6 years now, so I don't think it needs an explanation.

I'm a little unsure the best way to phrase the following, but how about

current:

Method to limit the bolus amount

suggestion:

Limit bolus from shortcuts to

current:

Limit by max bolus

suggestion:

Max Bolus

current:

Limit by insulin suggestion estimation

suggestion:

Insulin recommended

@aug0211
Copy link
Contributor

aug0211 commented Jun 26, 2024

Are there any blockers for this to go forward? Was testing successful?

I see some phrasing recommendations - I recommend those either get fixed (@MikePlante1 maybe add them in directly?) or touch those up after initial release?

@MikePlante1
Copy link
Contributor

MikePlante1 commented Jun 26, 2024

@aug0211 Phrasing suggestions aren’t crucial, but I think the initial part of my comment about delivering the max when requesting above the max should be addressed.

Copy link
Contributor

@aug0211 aug0211 left a comment

Choose a reason for hiding this comment

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

Added a note for @MikePlante1, I think I identified the section of code he is interested in, and I proposed what this could look like.

table: "ShortcutsDetail"
)
case .limitBolusMax:
bolusQuantity = apsManager
Copy link
Contributor

Choose a reason for hiding this comment

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

@MikePlante1 is this where the change is needed for your recommendation? Is the check here to compare the bolusAmount with maxBolus?

I think it's something like this:

if bolusAmount > maxBolus {
   return LocalizedStringResource("Maximum bolus exceeded, no bolus administered.")
}
else {
 bolusQuantity = roundBolus(Decimal(bolusAmount))
}

Do this down below for the other version - checking for recommended percentage.

@MikePlante1
Copy link
Contributor

Trio Carbs shortcut doesn't seem to work as expected. Testing in a simulator with this PR merged into the latest dev.

Input Response
1 Are you sure to add 1 g of carbs ?
30 Are you sure to add 30 g of carbs ?
59 Are you sure to add 59 g of carbs ?
60 Are you sure to add 1:00 g of carbs ?
100 Are you sure to add 1:40 g of carbs ?
200 Are you sure to add 3:20 g of carbs ?
201 What is the quantity of the carb to add ?

@MikePlante1
Copy link
Contributor

Also, Carbs seems to work like Bolus when it comes to exceeding the maximum limit. As in, if I set Max Carbs to 30g and enter 44g in the Carbs shortcut, it prompts to confirm an entry of "30g". I think a better workflow would be for it to just alert you that your entry exceeded the maximum and prompt you to edit your entry. Just like how the Meal and Bolus modules work in the Trio app on the iPhone.

@MikePlante1
Copy link
Contributor

Another test:

  • Created and saved two profile overrides: 110% and 120%
  • Confirmed no override is currently being used in Trio
  • Activated 110% override from shortcut
  • Confirmed 110% override is being used in Trio
  • Activated 120% override from shortcut
  • Confirmed 120% override is being used in Trio
  • Canceled override from shortcut
  • It should have prompted me to cancel the 120% override but instead it prompted to cancel the 110% override
  • Tapped to confirm the cancelation in the shortcut anyway
  • Confirmed no override is being used in Trio
  • Tapped the Cancel Override shortcut again
  • It prompted me to cancel the 110% override, even though no override was being used
  • Tapped to confirm the cancelation in the shortcut anyway
  • Tried to tap Cancel Override again, but this time it correctly informed me I did not have any running overrides.
Screen.Recording.2024-07-01.at.3.50.17.PM.mov

@Sjoerd-Bo3 Sjoerd-Bo3 deleted the branch nightscout:dev July 2, 2024 14:00
@Sjoerd-Bo3 Sjoerd-Bo3 closed this Jul 2, 2024
@Sjoerd-Bo3 Sjoerd-Bo3 reopened this Jul 2, 2024
@Sjoerd-Bo3 Sjoerd-Bo3 changed the base branch from alpha to dev July 2, 2024 14:09
@Sjoerd-Bo3 Sjoerd-Bo3 marked this pull request as draft July 2, 2024 14:58
@dnzxy dnzxy added Post 1.0 and removed Pre 1.0 labels Jul 4, 2024
@aug0211
Copy link
Contributor

aug0211 commented Jul 7, 2024

Trio Carbs shortcut doesn't seem to work as expected. Testing in a simulator with this PR merged into the latest dev.

| | Input | Response |

| --- | --- | --- |

| | 1 | Are you sure to add 1 g of carbs ? |

| | 30 | Are you sure to add 30 g of carbs ? |

| | 59 | Are you sure to add 59 g of carbs ? |

| ❌ | 60 | Are you sure to add 1:00 g of carbs ? |

| ❌ | 100 | Are you sure to add 1:40 g of carbs ? |

| ❌ | 200 | Are you sure to add 3:20 g of carbs ? |

| ❌ | 201 | What is the quantity of the carb to add ? |

I can reproduce this when running locally on a test phone, in Trio, iAPS 4.X and iAPS 3.X.

They all end up having the actual expected action (they enter the amount of carbs entered), except for the 201 case which never logs anything because it keeps asking for an amount.

So this issue is a "display/confirmation" issue, living somewhere in the confirmation code. Will try to take a look next time I can get time.

@aug0211
Copy link
Contributor

aug0211 commented Jul 7, 2024

Another test:

  • Created and saved two profile overrides: 110% and 120%

  • Confirmed no override is currently being used in Trio

  • Activated 110% override from shortcut

  • Confirmed 110% override is being used in Trio

  • Activated 120% override from shortcut

  • Confirmed 120% override is being used in Trio

  • Canceled override from shortcut

  • It should have prompted me to cancel the 120% override but instead it prompted to cancel the 110% override

  • Tapped to confirm the cancelation in the shortcut anyway

  • Confirmed no override is being used in Trio

  • Tapped the Cancel Override shortcut again

  • It prompted me to cancel the 110% override, even though no override was being used

  • Tapped to confirm the cancelation in the shortcut anyway

  • Tried to tap Cancel Override again, but this time it correctly informed me I did not have any running overrides.

Screen.Recording.2024-07-01.at.3.50.17.PM.mov

Couldn't get video to load here but this seems similar to the carb issue - a shortcut confirmation text issue.

I think:

  1. This is an annoying bug, should not stop merging

  2. A quick fix is to just remove the reference in the confirmation text to a specific override and just say "are you sure you'd like to cancel the active override?" or something like this - which IMO is what this shouldn't been anyway, making this fix both simpler to implement and simpler to grok when using.

I can work on and test this in an in vitro device.

- Shortcut cancellation confirmation text should display the latest override, not the first override
- Addresses a text display bug identified by Mike here: nightscout#177 (comment)
@aug0211
Copy link
Contributor

aug0211 commented Jul 7, 2024

Another test:

  • Created and saved two profile overrides: 110% and 120%

  • Confirmed no override is currently being used in Trio

  • Activated 110% override from shortcut

  • Confirmed 110% override is being used in Trio

  • Activated 120% override from shortcut

  • Confirmed 120% override is being used in Trio

  • Canceled override from shortcut

  • It should have prompted me to cancel the 120% override but instead it prompted to cancel the 110% override

  • Tapped to confirm the cancelation in the shortcut anyway

  • Confirmed no override is being used in Trio

  • Tapped the Cancel Override shortcut again

  • It prompted me to cancel the 110% override, even though no override was being used

  • Tapped to confirm the cancelation in the shortcut anyway

  • Tried to tap Cancel Override again, but this time it correctly informed me I did not have any running overrides.

    Screen.Recording.2024-07-01.at.3.50.17.PM.mov

Couldn't get video to load here but this seems similar to the carb issue - a shortcut confirmation text issue.

I think:

  1. This is an annoying bug, should not stop merging
  2. A quick fix is to just remove the reference in the confirmation text to a specific override and just say "are you sure you'd like to cancel the active override?" or something like this - which IMO is what this shouldn't been anyway, making this fix both simpler to implement and simpler to grok when using.

I can work on and test this in an in vitro device.

Fixed this one and committed.

I kept the originally desired intent of showing the "current" override that was cancelled in the confirmation text.

If we want to switch to the simpler "Override cancelled" confirmation I proposed above, that's a simple 1 line change we can make in the future after merging.

- Error handling for carb/fat/protein exceeding max defined
- Show user all values for carb/fat/protein entered in the confirmation
- Do not assume 0 for these values, instead - ask the user
- This can be refactored later if we can get access to settingsManager.settings.maxCarbs/Fat/Protein: if we get that, drop it into the upper bound in the shortcut and clean up other code
- Lastly, we should allow the user to specify the date if they'd like to, in the future
@aug0211
Copy link
Contributor

aug0211 commented Jul 7, 2024

Trio Carbs shortcut doesn't seem to work as expected. Testing in a simulator with this PR merged into the latest dev.

Input Response
1 Are you sure to add 1 g of carbs ?
30 Are you sure to add 30 g of carbs ?
59 Are you sure to add 59 g of carbs ?
60 Are you sure to add 1:00 g of carbs ?
100 Are you sure to add 1:40 g of carbs ?
200 Are you sure to add 3:20 g of carbs ?
201 What is the quantity of the carb to add ?

I can reproduce this when running locally on a test phone, in Trio, iAPS 4.X and iAPS 3.X.

They all end up having the actual expected action (they enter the amount of carbs entered), except for the 201 case which never logs anything because it keeps asking for an amount.

So this issue is a "display/confirmation" issue, living somewhere in the confirmation code. Will try to take a look next time I can get time.

Fixed this and a few other things in this commit.

  1. Carb values won't give weird confirmation messages anymore as reported above
  2. Max value violations will not be silently capped, they will fail with an alert
  3. Users are asked for fat and protein now (previously defaulted to 0 (validation occurs as well)
  4. Success confirmation lists carbs, fat, and protein clearly
  5. Max value respects user settings configured in Trio
  6. Future (out of scope here) - should allow user to select the time
  7. Future (out of scope here) - cleaner code option if we get access to settingsManager for max values in the AppIntent

- Block (with an alert) boluses that exceed the user-configured max (whether this is max pump max bolus or recommended amount)
- Addresses this request nightscout#177 (comment)
@aug0211
Copy link
Contributor

aug0211 commented Jul 7, 2024

@aug0211 Phrasing suggestions aren’t crucial, but I think the initial part of my comment about delivering the max when requesting above the max should be addressed.

Fixed in this commit. Boluses will not be blocked with an alert if they exceed the maximum configured (whether this is pump max bolus or insulin suggestion).

- Addresses requested updates in PR feedback for phrasing
- See original requests here: nightscout#177 (comment)
- Skipped one request based on my judgment
- This commit includes comment cleanup on shortcut guardrails, too
- No functional change in this commit
@aug0211
Copy link
Contributor

aug0211 commented Jul 7, 2024

I merged this PR into the latest alpha and tested on a simulator...
...
...
Also, here's a couple wording suggestions:

current:

Allows to bolus with shortcuts

suggestion:

Allow bolusing with shortcuts

current:

The application lets you create automations using shortcuts. Go to the Shortcuts application to create new automations.

suggestion: I think this can just be removed entirely. Shortcuts has been in iOS for almost 6 years now, so I don't think it needs an explanation.

I'm a little unsure the best way to phrase the following, but how about

current:

Method to limit the bolus amount

suggestion:

Limit bolus from shortcuts to

current:

Limit by max bolus

suggestion:

Max Bolus

current:

Limit by insulin suggestion estimation

suggestion:

Insulin recommended

Phrasing notes requested in this comment are addressed in this commit.

@MikePlante1
Copy link
Contributor

Thanks @aug0211, it's certainly improved now, but still a bit more to fix I think.


Regarding canceling of overrides, I think it's fine to just say Override cancelled like you proposed. Your commit fixed it displaying the wrong override initially but there are still problems with it. Maybe look at how TT shortcuts are implemented, because I don't run into these problems with the "Cancel Trio TempTarget" shortcut.

Example 1: Start a new profile override (not a saved override) in the Trio app. Then run the "Cancel Trio Override" shortcut. The shortcut says "No active Override to cancel", even though it actually does cancel the override.

Example 2: Start a saved profile override with a set duration. Wait for the override to expire. Run the "Cancel Trio Override" shortcut and it will say Override 'name' canceled even though it wasn't running.

Example 3: Create two saved profiles: OA and OB. In the Trio app, start OA and then start OB. Run the "Cancel Trio Override" shortcut and it will say Override 'OB' canceled. Checking the Trio app confirms there are now no profile overrides running, but if you run the "Cancel Trio Override" shortcut again it will say Override 'OA' Canceled


For the "Trio Bolus" shortcut, when Limit bolus from shortcuts to is set to Max bolus, the shortcut works properly when too big of a bolus is requested by telling the user The bolus cannot be larger than the pump setting max bolus and then not delivering any bolus.

Likewise, when I set Limit bolus from shortcuts to to Bolus recommended, with a max bolus setting of 4U, where Insulin Recommended was 1.3U, and I tried to bolus 3U... the Bolus shortcut told me The bolus cannot be larger than the suggested insulin. and did not deliver any bolus.

The check failed, however, when the Insulin recommended equals the Max Bolus. I entered 120g carbs, which caused the Insulin recommended to be 4U. It would have been higher, but it was capped at 4U because the Max Bolus setting is 4U. I then ran the "Trio Bolus" shortcut and requested a 5U bolus. It asked Are you sure you want to bolus 5 U of insulin ? and when I selected "Continue" it replied A bolus command of 4 U was sent.


carbs/fat/protein seem to be properly capped at their max limits in settings. I do find it odd that it seems to pad numbers to one decimal place in the prompts, though. I also don't like how it responds when you don't enter a value for any of the prompts, though. It looks like the prompt should default to 0 if you don't enter anything for carbs, fat, or protein and just hit "done" to move to the next macro prompt, but instead the shortcut just kills itself without any feedback. So if you enter 10 for carbs, hit Done, then it prompts for fat but it looks like 0g is already pre-populated, so you hit Done, and it crashes.

Maybe there should be two shortcuts: Trio Add Carbs and Trio Add Meal, the former only prompting for carbs and the latter prompting for carbs, fat, and protein. For the meal entry, though, it should still allow the user to just press Done for any of the values instead of being forced to type 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Post 1.0
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

9 participants