indicate when bolus is automatic in pod message#15
Conversation
|
|
||
| let beep = self.confirmationBeeps | ||
| let result = session.bolus(units: enactUnits, acknowledgementBeep: beep, completionBeep: beep) | ||
| let result = session.bolus(units: enactUnits, acknowledgementBeep: beep, completionBeep: beep, programReminderInterval: programReminderInterval) |
There was a problem hiding this comment.
A better way of doing this would be to log extra metadata in the device logs themselves. Shortcuts like this end up making the code harder to read (why are we sending a reminder for a bolus?) and make later changes harder (what about tracking other metadata about the bolus?)
There was a problem hiding this comment.
This allows us to determine if the bolus was automatic or manual just from the messages.
There was a problem hiding this comment.
This is in addition to, not in place of the meta data.
There was a problem hiding this comment.
Having this information in the message logs has been helpful to people providing Omnipod support across multiple DIY implementations. This has been done like this ever since the OmniKit enactBolus has had a parameter to indicate if a bolus is automatic (in private implementations for over 2 years now as well as in has been Loop dev, FreeAPS and FreeAPSX for quite some time already). Loop's OmniBLE shouldn't be different in this regard than OmniKit on Loop/FreeAPS/FreeAPSX as well as OmniBLE on FreeAPS and eventually FreeAPSX. The only reason why this isn't already here was simply because OmniBLE was forked for Loop dev before the post v2.2.6 OmniKit changes were applied.
Modify the language to make the "trick" obvious
|
I modified the language to make it clear what this "trick" is doing. To belabor the usefulness of this approach - here are some examples: Use Case #1:
Use Case #2:
|
|
If we can agree that this language is appropriate, I will close this PR and make new ones after PR 16 and 17 are accepted. |
|
It's not that I don't think there's not a use case worth supporting here: I definitely think we should have the forensic ability to see if dose was automatic or not. My issue is that I think we should be using actual device logs that can contain other metadata and not just the raw encoded bits. I'll take this PR for use with the existing infrastructure you have for parsing logs, but I think this kind of thing is bad practice, and would love to see movement towards using actual device logs. There is a lot of other stuff you may want to use in log analysis, like connectivity stats, other BLE layer details, etc, and those would be easy to add to device logs. I'll merge the other PRs and will wait for another PR from you on this, as you suggested above. |
|
I will close this now and prepare a new one. |
…scheduled-presets LOOP-5235 Enable scheduled presets
…scheduled-presets LOOP-5235 Enable scheduled presets
This method of incorporating bits to indicate if a particular bolus is automatic (rather than manual) has been used for several years in other forks of Loop and is found Loop-dev for Eros Pods.
The method for interpreting these bits is incorporated in the python parser used to assist people who report Pod concerns with Loop (and other forks). It is extremely helpful to the analysis to know if it was an automatic bolus or manual.