These are chat archives for nightscout/ios

10th
Aug 2015
kenstack
@kenstack
Aug 10 2015 17:00
I pushed some changes to my apple watch app repo in Perceptus/nsapple- you can now toggle which BG is used as primary display - Dexcom or Raw. If raw is chosen it calculates the raw delta bg and the directional arrow (its a little jumpy I only used a 2 point derivative - on my list to imrove). I also fixed a few bugs related error trapping data availability on calibrations. I tested it on both the 0.6 and 0.7 versions of the pebble endpoint - I notices the 0.7 endpoint now provides cal data if its older then 24 hours which is great, but as a note apple's json stuff then couldnt parse it even though its valid json. I used a workaround from someoneanyone's code to remove some plus signs and its now parsing. nice find.
Jason Calabrese
@jasoncalabrese
Aug 10 2015 17:02
what part of the json can't be parsed?
should always be valid json
kenstack
@kenstack
Aug 10 2015 17:02
yes it is - apple's parser has a bug I think
workaround from someoneanyone was to convert the data from the pebble endpoint to a string, remove + signs then parse - works fine now
Jason Calabrese
@jasoncalabrese
Aug 10 2015 17:03
wow, does it not like the float? an empty value?
where are the + signs
kenstack
@kenstack
Aug 10 2015 17:03
not sure hang on Ill look
ahh I see it now - looks like a cal slope miscalc
intercept":-1.7976931348623157e+308
Pete
@someoneAnyone
Aug 10 2015 17:06
Apple doesn't like the e+ notation
Jason Calabrese
@jasoncalabrese
Aug 10 2015 17:06
oh
kenstack
@kenstack
Aug 10 2015 17:06
slope is a little big :)
Jason Calabrese
@jasoncalabrese
Aug 10 2015 17:06
there was some rounding there, but it screwed up the calculation
kenstack
@kenstack
Aug 10 2015 17:06
yep
Jason Calabrese
@jasoncalabrese
Aug 10 2015 17:06
shouldn't need to return that stuff, should return the raw pre-calculated
Pete
@someoneAnyone
Aug 10 2015 17:07
var stringVersion = NSString(data: dataObject, encoding: NSUTF8StringEncoding)
stringVersion = stringVersion?.stringByReplacingOccurrencesOfString("+", withString: "")
                    if let newData = stringVersion?.dataUsingEncoding(NSUTF8StringEncoding) {
Jason Calabrese
@jasoncalabrese
Aug 10 2015 17:07
I'd really like to get a new /api/v1/summary endpoint in the F release
Pete
@someoneAnyone
Aug 10 2015 17:07
what would be in summary?
kenstack
@kenstack
Aug 10 2015 17:07
btw the 0.7.0 pebble endpoint now kicks out not just the last cal but if you multiple bg data you get the same number of cals returned as well
can I get cal data from that endpoint?
Jason Calabrese
@jasoncalabrese
Aug 10 2015 17:08
think it would be similar to /pebble but not a hack, expose the plugin values, iob, cob, bwp, etc
precalculate raw, with option to get the full data
Pete
@someoneAnyone
Aug 10 2015 17:08
cool
Jason Calabrese
@jasoncalabrese
Aug 10 2015 17:08
expose treatments
Pete
@someoneAnyone
Aug 10 2015 17:08
it took me a while to match the raw out put
shouldn't treatments be its own endpoint?
kenstack
@kenstack
Aug 10 2015 17:09
cool - is there any docs on how to use that?
Jason Calabrese
@jasoncalabrese
Aug 10 2015 17:09
shouldn't have to do all that for every device
Pete
@someoneAnyone
Aug 10 2015 17:09
exactly. I like how pebble has delta already there
Jason Calabrese
@jasoncalabrese
Aug 10 2015 17:09
doesn't exist yet, but if we figure out what we want it will be easy to add
for all these devices I think you want a summary of the current state
so for treatments I was think it would be more about the more recents if they are in some time window
so last bolus and time
but we should still fix the formatting of the intercept
kenstack
@kenstack
Aug 10 2015 17:13
my kid broke our one adult receiver (fixing USB on my list for this week...) so we are back to peds - using raw as the primary for not only BG but delta and direction arrow is awesome - if not I found myself constantly trying to figure out direction and detla etc from the distance between white dots :) might be a good option for core ns remote monitor too - I may hack my own. I already got rid of the log scale :) it fools me if he is say 150 and rising if Im tired and half asleep
I really forgot how awful the lag is on the peds version... kid and wife both liking raw as primary as well