trupici / G-Watch-Wear

G-Watch App for Wear OS Samsung watch models
Apache License 2.0
41 stars 11 forks source link

Suggestion - fall back to weighted average when most recent reading isn't updating #6

Closed tagunter closed 1 year ago

tagunter commented 1 year ago

It appears that after last night's system maintenance, Abbott is currently not updating glucoseMeasurement but is still periodically updating graphData. It might be a good idea to fall back to graphData in this situation.

Idea based on this reddit comment and the conversation below it.

Main body of that comment quoted here (with minor edits for formatting) in case something happens to the source:

The API response that LibreLinkUp uses to pull the display data comes in two ways:

glucoseMeasurement

  • This is the most recent reading. This is what's displayed at the very top of the screen as well as on the furthest right side of the graph. This is also why as readings change, the line changes. This reading is not tracked until it becomes part of a weighted average as a way to smooth the graph out and remove anomalies. This is what that data looks like. It only displays for a minute and then is replaced by the next reading.

graphData

  • These are the weighted averages. This is the bulk of the readings shown on the graph, and uses whatever algorithm Abbott has developed in order to smooth out the graph and remove anomalies (is also kind of annoying as it makes your time in range look better than it is. This is an example of one of those entries. The response will show the last 12 hours (give or take about 20 minutes) worth of weighted averages of readings. This is why the graph ends up being so rounded.

glucoseMeasurement is not currently being updated. That is why there's a delay. As the weighted averages are being calculated, they show up in graphData. graphData seems to be operating normally.

trupici commented 1 year ago

Thank you for the info. Finally, it was enough to change the app version in the request header. Everything else seems to work as before for the gwatch integration.

Juraj

Dňa št 15. 6. 2023, 23:42 tagunter @.***> napísal(a):

It appears that after last night's system maintenance, Abbott is currently not updating glucoseMeasurement but is still periodically updating graphData. It might be a good idea to fall back to graphData in this situation.

Idea based on this reddit comment https://www.reddit.com/r/Freestylelibre/comments/14a51f1/librelinkup_running_30_minutes_behind_today/jo8kx0y/ and the conversation below it.

Main body of that comment quoted here (with minor edits for formatting) in case something happens to the source:

The API response that LibreLinkUp uses to pull the display data comes in two ways:

glucoseMeasurement

  • This is the most recent reading. This is what's displayed at the very top of the screen as well as on the furthest right side of the graph. This is also why as readings change, the line changes. This reading is not tracked until it becomes part of a weighted average as a way to smooth the graph out and remove anomalies. This https://i.imgur.com/5EMMYMo.png is what that data looks like. It only displays for a minute and then is replaced by the next reading.

graphData

  • These are the weighted averages. This is the bulk of the readings shown on the graph, and uses whatever algorithm Abbott has developed in order to smooth out the graph and remove anomalies (is also kind of annoying as it makes your time in range look better than it is. This https://i.imgur.com/3VLpHet.png is an example of one of those entries. The response will show the last 12 hours (give or take about 20 minutes) worth of weighted averages of readings. This is why the graph ends up being so rounded.

glucoseMeasurement is not currently being updated. That is why there's a delay. As the weighted averages are being calculated, they show up in graphData. graphData seems to be operating normally.

— Reply to this email directly, view it on GitHub https://github.com/trupici/G-Watch-Wear/issues/6, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOA2QJREXW7VDPBMIZOH7T3XLN6WDANCNFSM6AAAAAAZINWVI4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ojalaj commented 1 year ago

Should it work now? Should we update through Playstore?

trupici commented 1 year ago

No, it must pass the store approval process. It will take some time. It also requires migration to Android SDK 13, which must be tested, due to changes in API and added restrictions. Hotfix test version is available for download in G-Watch App Users group on fb

trupici commented 1 year ago

closing this thread

tagunter commented 1 year ago

Play Store takes a while to update after it's submitted. Under issue 7 trupici said it's available two sideload in the Facebook support group. I'm headed there now