mddub / urchin-cgm

A graph of your CGM data on a Pebble watch.
MIT License
56 stars 45 forks source link

fetch data via websockets #6

Closed mgranberry closed 8 years ago

mgranberry commented 8 years ago

This is just a proof of concept, but it shows that fetching via websockets is possible. Let me know if you have any thoughts.

mgranberry commented 8 years ago

Messages currently timeout when data is delayed and the code is just kind of wedged in "where it works", but it shows that it's probably worth developing further.

mgranberry commented 8 years ago

Data returned from nightscout websockets:

https://gist.github.com/mgranberry/fb701a50cebb61aedb7b

mgranberry commented 8 years ago

This is a complete websocket client implementation. I've been running it for the last few hours and everything seems to be working correctly. I also moved most of the status line messages over to using the cached data from the websockets.

Treatments are unbounded, which may be a problem. I wasn't certain what the reasonable window is for them, but it would be simple enough to filter out everything but the last temp basal and anything within the graph window.

Thanks again for making this watch face something I'm happy to use and work on. I'm not sure that there's much left that I want besides bolus/iob visualization, but it has been fun hacking on it.

bewest commented 8 years ago

Wow, very cool.