-
Notifications
You must be signed in to change notification settings - Fork 720
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
Adapt LoopFollow to Trio 1.0’s Updated Device Status Upload Behavior #368
Conversation
Tested this and it works exactly as expected with BT heartbeat (or silent audio) for keeping track of the latest enacted device status and timestamp, and trigger any not looping alerts as intended. Well done Jonas! |
Merge conflicts with dev is resolved, it can now be merged using a merge commit |
Things to FixI think the Not Looping alert should show up on the LoopFollow main screen for Trio when the Not Looping alarm goes off. See graphics under Trio URL Code ReviewThe code changes seem reasonable. This touches Loop code as well as Trio code. So test both. TestsConfigure 2 test phones - one feeding a Loop URL and one feeding a Trio URL Build code using this PR Loop URLFor the Loop phone, set Not Looping to 15 minutes (don't have PR 366 included yet) Based on testing for PR 366, expect Not Looping alert at 10:42 + 15 + 15 = around 11:12 Trio URLUsing Trio private beta, commit 8e87cee75, which includes Ensure latest 'enacted' determination is always uploaded #259 and Merge pull request #264 from nightscout/fix-ns-devicestatus-upload. 11:00 NS shows Enacted in the OpenAPS pill Based on testing for PR 366, expect Not Looping alert at 11:01 + 15 = around 11:15 The Not Looping alarm noise happens at 11:17 Capture a few OpenAPS pills for completeness. EDITED TO SAY - I must not have built the commit I stated I built. Repeating this test (2 days later with no change to the related modules in Trio) I got different Nightscout display results. I commented out the incorrect comments and removed the graphic about the Nightscout display. |
Just a note on NS behavior: As long as NS receives device statuses from Trio that is "suggested" NS openaps pill will show the quite counterintuitive "looping" symbol. When Trio enacts a suggestion, the "enacted" device status is uploaded and the NS openaps pill will show "enacted". Trio will send those "suggested" statuses as long as Trio gets cgm readings even if the pump com is down. When no device status has been received by NS for X minutes, then it changes the pill to show a Ie "looping" status in NS is an indication that close loop isn't happening right now for any reason, but that Trio still receives cgm readings and uploads suggested DS. |
I have pushed changes to simplify the Not Looping display logic and align its timing with the alarm when enabled; otherwise, it remains 15 minutes as before. |
StatusWorks well with Loop main and Trio private beta. Code ReviewReviewed both the changes from the most recent 2 commits (since last test) and the changes from all commits. Looks good.
TestsConfigure 2 test phones - one feeding a Loop URL and one feeding a Trio URL Build LoopFollow code using this PR Trio private beta URLSummary:
Details: Build Trio private beta, commit Ensure URL is properly connected and LoopFollow displays items correctly (including InfoTable)
Check Info Table:
Restore rPi so Trio begins to loop again at 09:06 Loop URLSummary:
Details: For the Loop phone, set Not Looping time to 15 minutes
Halt the rPi at 09:31 local time - right after a successful loop
Note that IOB is not reported in LoopFollow. But that is not the subject of this PR. Turn on the rPi again and confirm Not Looping icon goes away on LoopFollow main screen and IOB, COB, Basal, rec. bolus, etc. all begin reporting again. Trio 0.2.3 URLSummary:
Details: Build Trio 0.2.3 on the phone that was previously running Trio private beta and allow it to begin showing information on Nightscout and LoopFollow. Halt rPi at 09:57 (about 3 minutes after last successful loop). Build LoopFollow main on this LoopFollow test phone to see if Not Looping was indicated properly before. |
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.
LGTM
@bjorkert confirmed that Trio 0.2.x does not upload the information LoopFollow would need to indicate Not Looping.
I confirmed that the results for LoopFollow have not changed (went back several version through v2.2.4 with the same results) when the URL is fed by Trio 0.2.x.
Trio 1.0 now always uploads both suggested and enacted data, whereas before, only suggested was uploaded if new data was available after an enacted entry.
Adjusted how device status is fetched, ensuring it correctly handles both suggested and enacted data, where data in suggested is prioritized and last loop date is fetched from enacted's timestamp.