-
Notifications
You must be signed in to change notification settings - Fork 1k
Recommended bolus for Trio #466
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
base: dev
Are you sure you want to change the base?
Conversation
| @State private var statusMessage: String? = nil | ||
|
|
||
| private let pushNotificationManager = PushNotificationManager() | ||
| private let minDeliverableU: Double = 0.05 // hides negative/zero/tiny recs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be renamed to minDeliverableUnit for improved readability
|
It does not really make sense to display a bolus value that the pump cannot administer (0.96 U in your example for what I presume is a pod user on Trio). The overall bolus seems to have 3 decimals; bolus dosages are usually rounded up to 2 decimals in allowed increments. Where is this recommended value coming from on the Trio side? |
|
LoopFollow currently does not know what pump is used, and therefore not what increments used. I plan to introduce a setting for it. I believe it can be fetched from Loop. |
|
I wanted to thank you for making this extension available to all of us. I assure you, many parents use it. I hope it'll be added to the official versions of Trio and LoopFollow so that when an update is released by the developers, it can be downloaded without having to wait for "bjorkert" to make the appropriate changes. |
TestThis test was not successful.
ConfigurationTrio phone is an SE 2nd gen phone running iOS 18.7.2
LoopFollow phone is an iPhone 15 running iOS 18.7.2
Remote BolusThe bolus increment is not being honored
Repeat the test with same result Try a larger bolus so I have time to watch it be delivered on Trio and on pump itself
Recommended Bolus
|
| guard stepU > 0 else { return value } | ||
|
|
||
| let stepped = (value / stepU).rounded(.up) * stepU | ||
| let stepped = (value / stepU).rounded(.down) * stepU |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested formula:
let stepped = (0.5 + value / stepU).rounded(.down) * stepU
The avoids the situation where the float expression of (value/stepU) = 29.99999 gets round down to 29
Test SummaryI think the rounding down should be with respect to the increment. In this test, the increment is 0.05 U. I think if the requested bolus is an integer multiple of the increment, it should be accepted. I found the relevant line and suggested a fix for it. Test ConfigurationTrio phone:
LoopFollow phone
Ensure TRC works and values shown in LoopFollow are appropriate
Use the
|
TestSuccessful test except ❌ LoopFollow should not continue when bolus <= bolus increment
Test ListThe Trio phone is running version 0.6.0.26.
Any issues (except for the 0 U remote bolus request) appear to be issues with Trio (not with LoopFollow) and were reported to the devs. |

Trio Remote Control: Recommended Bolus on Bolus Screen
This PR adds a flow for using the Recommended Bolus in the Trio Remote Control bolus view.
What’s included
Why
Make it quick to use a safe, recent recommendation—and avoid nudging users toward stale or invalid values.