-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Use Two Decimals for Insulin Remaining #3626
base: dev
Are you sure you want to change the base?
Conversation
This allows the Overview ("Home") screen to show two decimal points if the insulin remaining is <50U. This is useful for issuing boluses that use up all of the remaining reservoir without having to check the reservoir amount in the pump's settings.
Quality Gate passedIssues Measures |
Feedback from iceman & ga-zelle on Discord proposed staggered if- statements to only show two decimals if reservoir < 10u to avoid showing "50.00"U. It's two more characters than the current "50U+" so I don't know if it really throws off other resolutions or use cases. I could try to implement the staggered numbers as well, but I figured the less I touch the code the better. Also for discussion ;) |
I think we can't add 2 additional number in all situation
My proposal would be to keep integer value above 10U, and add only one decimal below 10U. |
To be clear, this modification doesn't care if the reservoir level report is consistently accurate; it's entirely how much remains in the omnipod's brain. It actually keeps a reserve long after the reservoir is exhausted (probably about 2U?) so it's overreporting, not under.
Unfortunately that still isn't the right level of specificity. To be clear, the thing that I'm trying to stop is issuing a bolus based on the home screen and then getting an error saying that I can't actually issue that bolus due to rounding. Even if we rounded to one decimal, omnipod reports/thinks in two. E.g. if reservoir has 1.35, the screen reports 1.4, you issue 1.4, and you get an error. Could we lose the unit "U" <5U or something like that? Now we're only adding one more character as proposed but we're still keeping specificity. --Edits-- for clarity, but one more thought: |
Instead of rouding value, then you can use As an example of status light (keep in mind that this example is not the worse case because you can have with some sensor an additional percentage for "sensor battery level" and some values can have one more character...) |
My personal opinion is that the reason (flushing out insulin to the last drop) is a nonsence. You never know what will happen at the end of reservoir |
That would work. There's still something very cheap within me that doesn't like the idea of wasting 0.9U when it gets rounded down, but if we're at that kind of premium then I suppose it can't be helped. I would challenge that a patch pump still doesn't show more than two status lights (pump age and insulin reservoir) so even the screenshot shows enough real estate for one more character, but that was also my reason for raising this during a beta period as well or in dev for feedback to see if anyone was bothered by it.
As stated, I don't think the Dash's reservoir reports 100% of the insulin in it. I know that when I issue the final bolus on a pump (e.g. 2.25U yesterday after work), I can leave the pump on and it will continue my basal rate, including clicking and keeping me level for at least another two hours. So the reservoir report is clearly not every last drop. Canada and the USA both pay for our insulin, many of us out of pocket. I'm particularly cheap - it would bother me to throw out up to 0.9U per pump that I could deliver easily with this PR. That's 164U/year thrown out - that's a whole pump fill for me. No reason to be wasteful if a rounding error can be corrected. One other thought: would it make more sense (and be more space-respecting) to have the reservoir reflected in the bolus screen? I wouldn't even know where to begin adding that line, but at least then we're not issuing a bolus that AAPS reports that we can issue but we can't (again, e.g. if we have 2.75U in the reservoir and AAPS is reporting 3U on the home screen - you will get an error for issuing that 3U bolus). |
With my proposal, it's not 0.9U but 0.09U max that can be lost...
Concerning Bolus (and/or calculator), you can open an issue as "enhancement or feature request", to provide a visual information when bolus amount is over remaining reservoir level. Note that in my mind it should only be an information, but not more (no limitation or things like that...). But it could be with a little warning triangle, bolus amount in red color or something like that (again to not include additional information to windows or popup that are already full...) |
It's up to you guys as the main developers. Happy to try the float solution or just close it and keep my little fork alive. Considering the status lights are currently the only way to predict whether you will get an error of "not enough in reservoir" before issuing a bolus, it makes sense to have that be accurate or at worst not rounded up. It's not just for trying to extract the last 0.35U... yesterday at the end of my pump i needed to 5u bolus and if there were only 4.95u, without this change i would have errored out. I could tell that there was 4.95 left thanks to this so that's what i issued. I propose merge and let the dev users let us know if it crowds the lights. But again: I'm just a potential contributor and you guys have a way better view of what the software needs. |
Keep in mind that the status light is not always a 100% up to date. The basal rate reduces the reservoir also, and you really need to refresh to get the latest reservoir update. |
Hum, I think you are trying to propose here a workaround concerning a pump limitation (or a pump driver limitation)... I don't know how Dash pump and Dash driver works, but with my Insight pump, it is just a "no topic"... This way of working is inside Insight pump, and pump driver just manage pump history synchronization with AAPS to record delivered amount instead of requested amount. I don't know in this specific use case how the other tube pump works (like Dana pumps), or how patch pump with reusable HW (like medtrum) works 🤔. |
Makes sense to me. I can safely say that I have yet to encounter a "basal rate reduced reservoir before status light updated so I don't have enough insulin to deliver the bolus" issue, but I suppose that it is theoretically possible. The only thing I've noticed is that the pump happily delivers basal insulin even when the reservoir (reported by Dash screen or status light) reads zero. I assumed that the report was of some sort of a "main" tank with a "reserve" tank that wasn't reported and limited to basal for safety. Anyone who's operated an ATV/Snowmobile/Jetski probably understands the analogy.
The short check of the Dash page is exactly what I'm trying to avoid and this is exactly why. Thank you for highlighting the issue. @Philoul your explanation of Insight's operation explains why this was so difficult. Frustratingly, the Dash simply errors out if you tell it to issue a bolus larger than what it reports is available. With the status light rounded to whole numbers, it's entirely too easy to issue too much of a bolus by 0.05U and get a stupid error. Not a lot of fun for a dad of three kids who's only had this disorder for a few years and is still somewhat irritated by the whole thing - when I tell it to prebolus, that's probably because I'm in the process of putting food on three plates while children do their thing. Absolutely zero chance that I'm taking the time to change pages, refresh, pray that it doesn't drain past its current estimate, and try to issue the bolus again. In other words, I'm trying to avoid cussing at AAPS over something that's fairly easily changed in the code, and I'm guessing I'm not the only one who hates those moments. I'll make the change in the proposal assuming I can figure out how. --Edit-- Or should I change handleLevel itself to consider whether it's a patchpump and then implement the new logic into it? It might make handlePatchReservoirLevel redundant that way. |
This proposal makes no sense to me.
In general: showing 2 digits imho would only make overview "less accurate", i.e suggesting accuracy that isn't. |
This allows the Overview ("Home") screen to show two decimal points if the insulin remaining is <50U. This is useful for issuing boluses that use up all of the remaining reservoir without having to check the reservoir amount in the pump's settings.
Use Case for Explanation:
This PR thus changes the home screen to show, e.g. "1.95U" remaining at the end of a pump, so that without changing tabs one can issue a bolus of 1.95U. Note that the current home screen would show "2U" but issuing that bolus would result in an error.
Using this on a Pixel 8. I havent' run into any UI glitches or issues with space.