Open bastiaanv opened 2 months ago
Love the draft/prototype! Would love to see this make it into the project down the line I think it looks amazing!
Built onto my real phone. Thanks so much for making this available. š
Awesome work !
Is it possible to change the y-axis of the graph in order to be more center on the data like in the app?
Maybe the blue area can replace the settings of the upper / lower limit, because it can change in the day. Or maybe the blue area should be displayed with no limit like the other graphs
In order to have the graph with full width, the status ring could be in the bottom bar
I have been using this for several days - I really enjoy having it attached to Loop.
Thanks for all the feedback:
Blue area (glucose target) | Preset enabled (without predictive line) | Preset enabled (with predictive line) |
---|---|---|
Nice upgrade except the override appears confused.
The walking override started at 1:47 with a duration of 3 hours and was cancelled 19 minutes later.
Thanks for the blue area!
Same here for the bug with an override label shown even none were triggered
I did a bit more testing.
In the last update, I didn't see the target area for the next hour by default:
If I activate the premeal, then remove it, it's ok.
Aight, it has been a crazy few days, but I made several fixes and restructured the code a bit. This should fix most of the weird behaviour found by @bastienmoulia and @marionbarker.
@marionbarker regarding the extraneous override. With this new version, I made it so that the preMeal override is "preferred" above the scheduled overrides, since that is only active for a maximum between now and 1hour. Do you agree with this? I dont think there is enough space to show both texts, tho it is possible to show both in the graph
Other question, do we want to keep the upper and lower limit in the settings (and with that the green, orange and red coloring in the graph)?
Other question, do we want to keep the upper and lower limit in the settings (and with that the green, orange and red coloring in the graph)?
Personally I prefer to not have multiple color because it causing more stress when it's orange or red. So no limit.
I have no strong opinion on the color. But with the ability to modify the glucose levels at which colors change allows people who want colors to have them and folks who do not want colors to turn them off.
I just set mine to 40 and 400 mg/dL to give it a try.
I added the setting to enable or disable the coloring based on the BG
Chart view without coloring | New setting (with BG coloring enabled) |
---|---|
I would prefer if there was an explicit Save button to save new settings on the Live Activities screen with the Back button leaving settings alone.
The things that work as expected:
Dumb question, but could anyone point me to documentation that could show me how to try out this branch? Downloading the ZIP from https://github.com/bastiaanv/Loop/tree/feat/live-activity doesn't seem to be buildable in Xcode but perhaps I am missing a step.
Dumb question, but could anyone point me to documentation that could show me how to try out this branch? Downloading the ZIP from https://github.com/bastiaanv/Loop/tree/feat/live-activity doesn't seem to be buildable in Xcode but perhaps I am missing a step.
I don't know how to do this with Xcode, but with the build from github I change the .gitmodules file like this :
https://github.com/bastienmoulia/LoopWorkspace/blob/dev/.gitmodules
And when there is an update I run git submodule update --remote
in the LoopWorkspace before pushing it.
There are several ways to do this:
Open the terminal in the Loop folder. Do 'git remote set-url origin https//github.com/bastiaanv/loop', then do 'git pull', then do 'git checkout feat/live-activity'
Or download the patch file from https://github.com/loopandlearn/customization, open the terminal in the Loop folder, then do 'git apply
Or run the customization script in your terminal yourself: https://www.loopnlearn.org/custom-code/
Please note, that I typed this on my phone, so there might be typos in my commands
When using Nightscout as CGM, it appears that the data will always be reported as stale. For additional context on this issue, Nightscout is reading from LibreLinkUp, and thus reporting blood glucose values on a 1-minute interval, which may affect how this is handled.
Using v3.4.1 with the latest customization as of today.
Hi @partcoffee ,
This behaviour is correct. The Live Activity doesnt keep iOS from suspending the app (also called Heartbeath). This also means that Loop isn't doing anything while the app is suspended. Jumping to conclusion, I assume you use Loop as a following app (just watching the BG values from NightScout).
There are a few ways to correct this:
Hi @partcoffee ,
This behaviour is correct. The Live Activity doesnt keep iOS from suspending the app (also called Heartbeath). This also means that Loop isn't doing anything while the app is suspended. Jumping to conclusion, I assume you use Loop as a following app (just watching the BG values from NightScout).
There are a few ways to correct this:
Connect a BLE-enabled pump to Loop
Customize Loop to include background sounds (like LoopFollow) or use Location services to keep Loop from being suspended
Or switch to something like xDrip4ios which is a dedicated app to follow BG values from different sources like NightScout or LibreLinkUp
Thanks for the clarification, but I'm using Nightscout as a CGM with Omnipod Dash, which functions as a heartbeat as well from my understanding. Loop is running its normal closed loop activities in the background like bolusing and suspending basal based on the readings from Nightscout.
My CGM is not compatible unfortunately, which is why Nightscout is being used.
The Live Activity is reporting the data as stale immediately, and not after a few minutes, when the app in theory still would be "awake".
@partcoffee My bad. Thank you for the clarification!
I think you are spot on with the 1 minute time interval. The LA has a limit for the amount of data I can send to the widget, too much data leads to the Widget always being stale. So I can limit the amount of samples being send to the widget even further, but that would limit the usages of the LA. You could try to limit the glucoseSamples yourself for the LA maybe to 70: https://github.com/bastiaanv/Loop/blob/feat/live-activity/Loop/Managers/Live%20Activity/GlucoseActivityManager.swift#L183
But the best solution would be to limit the amount of Glucose samples in Nightscout. Maybe the import script you are running allows for something like that?
@marionbarker I fixed your reported bugs! I also made that when you open Loop and the LA isn't showing but is activated, that Loop will recreate the LA, without the need to re-enable LA or kill Loop
@bastiaanv Thanks for looking in to it! I'll do some tinkering with it myself, I know it's a very niche issue.
I think the best approach would be to alter Nightscout, as you suggested. Loop runs a lot better with 5 minute intervals.
Good luck! If you need help, you can always contact me via DM on Zulipchat
@marionbarker Update the PR to include a save button and minor bg coloring fix
Not published yet in CustomizationSelect. Testing prior to publishing.
The stale override that expired at end of duration is fixed.
The save button is there but does not seem to work quite right.
I rebooted the phone and got the same behavior.
@bastiaanv, thanks so much for putting this together. I put this together last night and had a few notes that I was hoping to pass along for you to consider incorporating into the next commit:
I built this last night with the code. This feature is so awesome. I'm already finding it much more convenient to keep ann eye on things than before. :)
And for those who are not as technically savvy as me, I followed the instructions at https://www.loopandlearn.org/custom-code/ which easily allowed me to pull in a set list of customizations, including this one. :)
@rfmurphy81 First of all, thank you for your feedback! Really appreciate it.
I will try to find some time to fix the save button soon!
About point 1: The only option currently is to disable BG colouring, but since the save button doesnt work correctly it is hard to try that option. Other idea: would less opacity in the background be a solution for you? Because I think changing the color would be a solution for your background color, but not for someone else. Having less opacity in the widget would leave the widget less vulnerable to this issue.
About point 2: I found the code for the y-axis calculation for the Loop chart, will use that code as soon as I try to fix the save button!
@marionbarker I updated the LA with the following:
Do you have time for a update of the customisation?
The most recent updates to Live Activity have been incorporated in the customization script. Run the script again and you will be offered an update to Live Activity if you already have it installed.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/loopandlearn/lnl-scripts/main/CustomizationSelect.sh)"
Documentation overview for the script: https://www.loopandlearn.org/custom-code/#overview
Just wanted to share something I just noticed - that with the live activity running, if my phone is in StandBy (mine is on a MagSafe desk charger), it shows my BG as a small bubble in the upper right of the clock and I can tap that and see the live activity full screen. Pretty neat!!
Keep up the good work everyone! Thank you for all you do!
This PR is an initial/basic version of this Live Activity, without any feature which are spoken of in the Zulipchat.
Look & Feel:
Lock Screen (all iPhone's):
Dynamic Island (iPhone 14 pro max and higher):
Settings
Things to know:
CurrentBG
,IOB
,COB
,UpdatedAt
(like in the screenshots)GlucoseStore.glucoseSamplesDidChange
CarbStore.carbEntriesDidChange
dosing changing
UIApplication.willEnterForegroundNotification