-
Notifications
You must be signed in to change notification settings - Fork 400
Autotune: Properly parse AndroidAPS Temp Basal records #1060
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
Conversation
- Recognize AndroidAPS Temp Basal records - Delete AndroidAPS "Cancel Temp Basal" records
| for (var i=0; i+1 < tempHistory.length; i++) { | ||
| if (tempHistory[i].date + tempHistory[i].duration*60*1000 > tempHistory[i+1].date) { | ||
| tempHistory[i].duration = (tempHistory[i+1].date - tempHistory[i].date)/60/1000; | ||
| // Delete AndroidAPS "Cancel TBR records" in which duration is not populated |
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.
not sure I follow the comment / logic here. can you explain how this part works?
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.
AndroidAPS cancels TBRs in Nightscout by creating a subsequent TBR entry in which rate and duration fields do not exist. My idea of the logic here was to use the AndroidAPS "Cancel TBR" records to adjust the duration of the previously running TBR. Afterwards these "Cancel TBR" records are not needed anymore and can be deleted. However, not deleting them does not seem to affect Autotune results, it only causes a lot of empty array elements when running Autotune on AAPS data.
|
Anyone want to test this further before I merge it to dev? |
|
Merging to 0.7.0-dev. |
So, in order to work with those, AndroidAPS would need to upload the absolute rate, yes? |
|
My bad, I overlooked the option to upload the absolute rate, sorry for the noise. |
|
@jotomo Can you confirm that an absolute rate is uploaded for all pumps as long as the option is selected? Would there be any disadvantage to simply always uploading an absolute rate? |
|
@philipgo Yes, the option is pump-agnostic (code: https://github.com/MilosKozak/AndroidAPS/blob/dev/app/src/main/java/info/nightscout/utils/NSUpload.java#L79). |
This change lets Autotune recognize Nightscout AndroidAPS Temp Basal records. It also addresses the way AndroidAPS cancels Temp Basals (by creating a record without duration and rate).
I have tested the changes with OpenAPS data (no change) and AndroidAPS data.
It does not address the following issues:
AndroidAPS Temp Basal entry (with Combo pump)
AndroidAPS Cancel TBR record