From 5ed76b6b4d4a34b1f8a6987feb0a863097eed42b Mon Sep 17 00:00:00 2001 From: Ben West Date: Wed, 15 Oct 2014 18:45:56 -0700 Subject: [PATCH 1/2] attempt to prevent pebble to only read SGV values Try to avoid reporting null for pebble by only considering SGV records. Many thanks to @elute for raising flags on this. --- lib/pebble.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pebble.js b/lib/pebble.js index a6a2185933f..8299623466d 100644 --- a/lib/pebble.js +++ b/lib/pebble.js @@ -80,7 +80,7 @@ function pebble (req, res) { console.error("req.devicestatus.tail", err); } - req.entries.list({count: 2}, get_latest); + req.entries.list({count: 2, find: { "sgv": { $exists: true }}}, get_latest); }); } function configure (entries, devicestatus) { From b35f7f72fde86e501d375b961fe24333320eadc8 Mon Sep 17 00:00:00 2001 From: Ben West Date: Wed, 15 Oct 2014 19:12:28 -0700 Subject: [PATCH 2/2] fix mmol panning to show mmol Fixes a bug where panning would show "HIGH". --- static/js/client.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/client.js b/static/js/client.js index 19768df3f18..44de5f6a38f 100644 --- a/static/js/client.js +++ b/static/js/client.js @@ -240,9 +240,9 @@ var focusPoint = nowData[nowData.length - 1]; //in this case the SGV is scaled - if (focusPoint.sgv < scaleBg(40)) + if (focusPoint.y < 40) $('.container .currentBG').text('LOW'); - else if (focusPoint.sgv > scaleBg(400)) + else if (focusPoint.y > 400) $('.container .currentBG').text('HIGH'); else $('.container .currentBG').text(focusPoint.sgv);