JohanDegraeve / xdripswift

xdrip for iOS, written in Swift
GNU General Public License v3.0
343 stars 340 forks source link

Add 1m/5m selector option for Calendar update frequency (Libre 2 direct connection) #205

Closed paulplant closed 3 years ago

paulplant commented 3 years ago

Some Libre 2 (direct bluetooth) users suffer heavy battery usage when we were updating the calendar entry every 60 seconds as a new reading came #198

The update frequency was fixed back to 5m intervals (as always) which seems to have fixed the reported battery drain issue.

Since then several users have commented that they never had an noticeable battery drain and that they really liked to 1m calendar updates.

We could consider adding a switch to allow 1m updates if wanted. This could then be disabled for anybody not wanting to use it.

LiroyvH commented 3 years ago

Might wanna consider including #191 then for the same reason (and tie it to the same option maybe? To prevent tons of switches.) Johan already toyed with the idea in the comments, so would make sense. I think people wanting an alarm every minute must be immune to warning fatigue and perhaps slightly insane, but maybe there are lost and depraved souls that actually enjoy such torment. 🤪😉

moxyman commented 3 years ago

Not trying to complicate the mix, but would a setting for dynamic updates be possible? Update every 5 minutes for stable and 45° arrow, and update every 1 minute for arrow up/down.

JohanDegraeve commented 3 years ago

It's possible off course, we will see

JohanDegraeve commented 3 years ago

see commit 9a91de757b6e60ca56bf3c0f5fe53a8b19166203 This is not completely as requested here

It does allow watch/Libre 2 users to have a new reading every minute. It also allows all users to have specify the minimum time between to calendar events on the watch, or to have a notification with a reading.

For the notification : an overrule of the interval is done if there's been a dis/reconnect, which means if there was a disconnect/reconnect, the next reading will generate a notification, no matter the value of the interval.

Default value for the interval = 0