kevinconroy / cgm-simple-spark

a simple pebble cgm watchface with a sparkline.
GNU Affero General Public License v3.0
1 stars 0 forks source link

More frequent/aggressive refresh when low #6

Open kevinconroy opened 8 years ago

kevinconroy commented 8 years ago

When blood sugar is low, refresh from the data source more frequently.

Use case: child is low and you've given carbs to correct. Watchface should poll for new BGs when the reading is 4 min old and should repeat every 15 seconds rather than once a minute (or whatever it is). This can remove up to a minute of built in delay due to timing, lowering stress levels.

jpegjames commented 8 years ago

@kevinconroy: I'm a T1D (and developer) using Nightscout / Pebble and working on forking this project to make some changes as well. I might be wrong here, but isn't the 5 minute limitation from the Dexcom and not the app? Possibly you are using something other than the G5, but just wondering if you knew something that I didn't. I too would love to get more frequent data when the levels are low.

kevinconroy commented 8 years ago

@jpegjames: Dexcom will only provide a new reading once every 5 minutes, however the Simple CGM Spark watchface (like many of the watch faces) has its own timer loop to check for new readings every 5 minutes. The time windows don't always sync properly, though, and it can take up to 2 to 3 minutes of elapsed real time after Dexcom has uploaded a new reading before the watch face pulls it. In many instances this isn't a big deal (e.g. if it takes an extra few moments to see you've gone from 120 to 122 that's not going to impact one much). My proposal here is that if your BG is below a certain threshold (likely the user defined low), the watch face can poll the cloud more frequently - say every 30 seconds - to get the updated data. I don't think we should do this all the time as it would impact the Pebble battery life. Just balancing battery life vs human life with this.

jpegjames commented 8 years ago

@kevinconroy: Ok. That makes sense. I was actually thinking about doing something like that, but I didn't think about just when the value is low.