nightscout / Trio

Trio - an automated insulin delivery system for iOS based on the OpenAPS algorithm with adaptations.
https://docs.diy-trio.org/en/latest/
MIT License
95 stars 484 forks source link

Add contact complication method for Watch (WatchOS 11 issue) #386

Open LiroyvH opened 2 months ago

LiroyvH commented 2 months ago

Is your feature request related to a problem? Please describe.

WatchOS has a history of having issues with the Calendar complication no longer updating real-time, causing issues for people who wish to have their BG shown on their Watch directly. (Without opening the app every time). As a work-around, people have been using the Siri watchface - which did update the Calendar real-time and thus enabled the use of the Calendar trick.

Come WatchOS 11: the Siri watchface is discontinued and has been removed. There is a new "Live Activities" view when lifting your wrist (which includes Trio's Live Activity if you have it enabled on iPhone), but this doesn't always show up - especially not if you've just used the watch for something else rather recently. Eg: during work-outs this is useless. You can conjure this view again by swiping app from the bottom of the screen to the top of the screen on the main view, which will reveal the Live Activities. But again, that's useless during work-outs (especially for example when swimming) and it appears it cannot be revealed from anywhere other than when you're on a Watchface. (Also, this requires the Live Activity to be running and updated. Whereas with the Contact-method: this is not required, it simply updates very 5 minutes.)

Describe the solution you'd like

Apps such as xDrip4iOS have a new method in place: the "Contact trick". How it works is that it creates a contact in your contacts, which you then assign to be shown on your Watchface as a complication. xDrip will then generate an image with your current BG and assigns this as the picture for your contact. This is sent directly to the Watch and thus you get real-time BG values once more. I'd like Trio to incorporate this feature as well, as the Calendar method is unfortunately unreliable and the pathway to get real-time updates (Siri watchface) is gone come this September when WatchOS 11 is released.

Describe alternatives you've considered

There are, to my knowledge, no alternatives.

Additional context

All has been given.

Technical Details

To my knowledge, there are no dependencies perse and no potential risks. It does require incorporating a new feature. Eg, relevant commits (I may have missed a couple, just adding here for reference): https://github.com/JohanDegraeve/xdripswift/pull/505 https://github.com/JohanDegraeve/xdripswift/pull/526 https://github.com/JohanDegraeve/xdripswift/pull/527 https://github.com/JohanDegraeve/xdripswift/commit/bed459135ce1135673d4fd6f9d34dbe03723432b https://github.com/JohanDegraeve/xdripswift/commit/8040eb44d8a49bd2ef5b96ddde668b41eb60bf95 https://github.com/JohanDegraeve/xdripswift/commit/bed459135ce1135673d4fd6f9d34dbe03723432b

User Impact

Users will be able to see real-time BG values on their watchface again including on WatchOS 11. WatchOS 11 closes the opportunity to do so, which causes major annoyances for users; as the last work-around for the Calendar-method for the Watch appears to have been killed off by Apple. Additionally, they're no longer forced to use the Siri watchface. This does not only benefit users on WatchOS 11, but also on earlier WatchOS versions whom are forced to use the overall rather crappy Siri watchface. (The only reason most people use it, is because there's no alternative when wishing to view real-time Calendar upates.)

LiroyvH commented 1 month ago

@paulplant This something you could help copy/paste from xDrip4iOS by any chance?

mountrcg commented 4 weeks ago

Copy paste from iAPS may be easier