Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
0ba7350
new much smarter loop.sh
scottleibrand Sep 7, 2015
27a3c5c
regenerate requestedtemp.online.json before printing out its reason
scottleibrand Sep 7, 2015
4f17b8f
don't tell easy.log every time we're already running
scottleibrand Sep 7, 2015
7d1928c
refresh the openaps.lock file each time we loop
scottleibrand Sep 7, 2015
0bfcf31
if there are any old loops still running without proper lockfiles, ki…
scottleibrand Sep 7, 2015
56256a0
need to be a bit more specific to avoid killing ourselves
scottleibrand Sep 7, 2015
a5a3735
ping google to see if we're online instead of relying on openaps-mong…
scottleibrand Sep 7, 2015
5a5210e
comment out last die statement that might kill the loop once it's going
scottleibrand Sep 7, 2015
88ecf99
pull new reservoir data for baseline
scottleibrand Sep 7, 2015
967b02d
enact is fast: let's retry it more times if it fails
scottleibrand Sep 7, 2015
09dc977
Merge pull request #25 from openaps/master
scottleibrand Sep 7, 2015
269b8e9
sleep 10 between enact retries
scottleibrand Sep 7, 2015
73dabe8
if we can't generate a suggestion, we need to requery everything
scottleibrand Sep 7, 2015
3937d16
5 of 5 retries is redundant
scottleibrand Sep 7, 2015
ba6c39a
if ntp isn't working, try /etc/init.d/ntp restart before setting fake…
scottleibrand Sep 7, 2015
10a07d4
or clock set incorrectly
scottleibrand Sep 7, 2015
1535dcb
Merge branch 'master' into new-loop
scottleibrand Sep 8, 2015
862159f
Merge branch 'master' into new-loop
scottleibrand Sep 8, 2015
10231c5
bgpredict.js was never used for anything
scottleibrand Sep 8, 2015
5e7b843
retry querypump until findpumphistory succeeds, and sleep more during…
scottleibrand Sep 8, 2015
5098fa9
Merge branch 'master' into new-loop
scottleibrand Sep 8, 2015
a15baf9
Merge branch 'master' into new-loop
scottleibrand Sep 8, 2015
e9d229c
no need to retry inside a retry loop
scottleibrand Sep 8, 2015
358688a
sleep 30s in between pump queries to give other Pi's a chance
scottleibrand Sep 8, 2015
17ad85b
let's try running each pumpquery report individually so they don't ha…
scottleibrand Sep 8, 2015
8feca00
findclock instead of findclocknew
scottleibrand Sep 8, 2015
bd675e5
background the upload process and immediately continue
scottleibrand Sep 8, 2015
bf4dbaa
refresh glucose and currenttemp before deciding if action is required
scottleibrand Sep 8, 2015
467797f
try or retry; there is no fail
scottleibrand Sep 8, 2015
ea66461
keep openaps.lock when tight-looping
scottleibrand Sep 8, 2015
792f42c
disable mongo uploads
scottleibrand Sep 8, 2015
b510c3f
clock.json is still required to get up-to-date IOB, so refresh it
scottleibrand Sep 8, 2015
77895fa
s/openaps invoke/openaps report invoke/ for compatibility
scottleibrand Sep 8, 2015
feaf1b4
spacing
scottleibrand Sep 9, 2015
35592f3
write iob to easy.log
scottleibrand Sep 9, 2015
b04d23d
Merge branch 'bolus-low-snooze' into new-loop
scottleibrand Sep 10, 2015
801257b
bump package version, just because
scottleibrand Sep 10, 2015
2438da0
ns-upload.sh
scottleibrand Sep 13, 2015
391b741
upload quietly
scottleibrand Sep 13, 2015
65cad8c
author
scottleibrand Sep 13, 2015
bed9cb0
support timezone override
scottleibrand Sep 13, 2015
4fae510
fix basal_iob > max_iob logic, and call out when no temp, setting
scottleibrand Sep 13, 2015
f70e168
openaps is writing incorrect dates: override
scottleibrand Sep 13, 2015
1d2e4f9
Revert "openaps is writing incorrect dates: override"
scottleibrand Sep 13, 2015
72223ec
return requestedTemp
scottleibrand Sep 13, 2015
1f7af77
separate initial read of _data from everything else (function determi…
scottleibrand Sep 13, 2015
93aa61a
move BG data is too old check outside of function determine_basal for…
scottleibrand Sep 14, 2015
0c67596
rename temps_data to currenttemp and temps_input to currenttemp_input
scottleibrand Sep 14, 2015
5b23b68
rename profile_data to just profile
scottleibrand Sep 14, 2015
6f14260
debugging console.error statements
scottleibrand Sep 14, 2015
97551f8
move functions into a more logical order
scottleibrand Sep 14, 2015
7df7692
refactor to export functions for testing and modularization
scottleibrand Sep 14, 2015
5d821a4
initial tests of function setTempBasal
scottleibrand Sep 14, 2015
8c8a58c
still having issues with timezones; remove timezone override again
scottleibrand Sep 14, 2015
791d4d2
don't use global varaibles inside setTempBasal, and s/offline_input/o…
scottleibrand Sep 14, 2015
2126563
shorten requestedTemp to just rT
scottleibrand Sep 14, 2015
a4e9f15
set rT.reason directly instead of treating reason as a global variable
scottleibrand Sep 14, 2015
2131bf1
start with empty rT.reason so += doesn't prepend 'undefined'
scottleibrand Sep 14, 2015
afc4051
test cases for low glucose suspend mode
scottleibrand Sep 14, 2015
700376d
add output.reason.should.match to test cases
scottleibrand Sep 14, 2015
71578ad
Makefile to allow you to run tests by typing 'make'
scottleibrand Sep 14, 2015
b7fbcc6
update a comment
scottleibrand Sep 14, 2015
306ccc7
Merge branch 'master' into new-loop
scottleibrand Sep 14, 2015
eb4798b
Merge branch 'master' into test-refactor
scottleibrand Sep 14, 2015
70de133
make curl quiet again: that was just for debugging
scottleibrand Sep 14, 2015
7c3da2c
Merge branch 'new-loop' of github.com:openaps/openaps-js into new-loop
scottleibrand Sep 14, 2015
d545be5
remove now-duplcate console.log(JSON.stringify(rT))
scottleibrand Sep 14, 2015
e0291a8
calculate IOB as of 'now' instead of as of clock.json time
scottleibrand Sep 14, 2015
a1c0224
Merge branch 'new-loop' into test-refactor
scottleibrand Sep 14, 2015
918dc90
Merge branch 'new-loop' of github.com:openaps/openaps-js into new-loop
scottleibrand Sep 14, 2015
4a65bad
console.log rT even when not doing setTemp
scottleibrand Sep 14, 2015
2f91e73
#28: Compare delta against BGI instead of against 0: first pass, and …
scottleibrand Sep 15, 2015
4756cf4
switch from else clauses to returning early
scottleibrand Sep 15, 2015
6631801
more tests
scottleibrand Sep 15, 2015
71591b4
cosmetic stuff
scottleibrand Sep 15, 2015
ff4bbb5
reorganize tests slightly
scottleibrand Sep 15, 2015
53ed16f
round bgi
scottleibrand Sep 15, 2015
747ea44
Merge branch 'new-loop' into dev
scottleibrand Sep 15, 2015
43b4770
add fix-dead-carelink check to the loop
scottleibrand Sep 16, 2015
239b6d3
only suppress low-temp if BOTH delta and avgdelta are > bgi
scottleibrand Sep 16, 2015
9559973
fix iob.js for non-3h DIAs, and do bolus IOB properly
scottleibrand Sep 17, 2015
892d5df
Merge pull request #1 from openaps/dev
audiefile Sep 17, 2015
fe84acf
should temp to 0 when low and falling, regardless of BGI or bolus snooze
scottleibrand Sep 18, 2015
ba13048
make it clearer what we're doing to calculate avg, and make it easier…
scottleibrand Sep 19, 2015
d90a11f
update pebble while tight-looping
scottleibrand Sep 20, 2015
6dbe93a
comparing to BGI is a bit too extreme: backing it off to BGI/2 (half …
scottleibrand Sep 20, 2015
4f150f0
Merge branch 'dev' of github.com:openaps/openaps-js into dev
scottleibrand Sep 20, 2015
1367af7
fix variable name
scottleibrand Sep 20, 2015
ee99fd2
rm all requestedtemp* to make sure we're not using an old suggestion
scottleibrand Sep 20, 2015
f1b5df3
add another rm requestedtemp* just in case an old process is in an en…
scottleibrand Sep 20, 2015
dc33b42
delete any json files older than 10m to make triply sure we avoid usi…
scottleibrand Sep 20, 2015
af6556a
add .json to pumphistory in the usage
scottleibrand Sep 20, 2015
da7fbbf
Merge pull request #3 from openaps/dev
audiefile Sep 20, 2015
f7120fe
removing everything removes max_iob.json and infrequently-changed set…
scottleibrand Sep 20, 2015
8b495c8
forgot to add profile, rT, offline to one instance of setTempBasal()
scottleibrand Sep 21, 2015
fe07b7c
remove windows byte-order mark and add #!/usr/bin/env node
scottleibrand Sep 21, 2015
e19ea67
use cwd + '/' instead of './'
scottleibrand Sep 21, 2015
796e062
take webapi host as an argument instead of hardcoding
scottleibrand Sep 21, 2015
e313fee
change site environment variable to NIGHTSCOUT_HOST
scottleibrand Sep 21, 2015
de99c29
functionalize enact and getcurrenttemp, add send-tempbasal-Azure if A…
scottleibrand Sep 21, 2015
a06aa40
only try ns-upload if NIGHTSCOUT_HOST exists
scottleibrand Sep 21, 2015
f6e1ccb
syntax
scottleibrand Sep 21, 2015
142c99e
don't delete current_basal_profile.json
scottleibrand Sep 23, 2015
0bc352d
Adding ns-upload-glucose.sh
cjo20 Sep 26, 2015
482e303
In ns-upload-glucose, fix 'type' for sgv entries, set device to show …
cjo20 Sep 26, 2015
b03821e
ns-upload-glucose.sh, note this was written for decocare v0.0.17
cjo20 Sep 27, 2015
e757efe
make script names match installed script names
bewest Sep 27, 2015
0826bee
add more tools to the package/distribution
bewest Sep 27, 2015
dbf8458
separate concerns a bit
bewest Sep 27, 2015
65d609f
use stdout by default
bewest Sep 27, 2015
b45b450
Merge branch 'master' of github.com:openaps/openaps-js into dev
bewest Sep 27, 2015
04da2a0
Merge branch 'dev' into wip/bewest/separate-concerns
bewest Sep 27, 2015
a61cf59
Provide top level exec shell for diyps.
bewest Sep 27, 2015
d413a0b
even more helpers
bewest Sep 27, 2015
4816802
allow diyps wrapper to handle some basic debugging
bewest Sep 27, 2015
db4d271
Merge pull request #4 from openaps/dev
audiefile Sep 27, 2015
a07e2f9
init mm-stick tool
bewest Sep 28, 2015
40a53a5
distribute with package
bewest Sep 28, 2015
497057e
changed so pebble card can read from apache server
audiefile Sep 28, 2015
a6a81cf
Code was ignoring old data
aemazaheri Oct 4, 2015
e7ca6b0
Merge pull request #35 from amazaheri/dev
scottleibrand Oct 4, 2015
f74e54d
be strict about errors
bewest Oct 6, 2015
839b9d9
fix default behavior with no args should not error
bewest Oct 6, 2015
c3a821b
ifttt tool, rename everything to oref0
bewest Oct 6, 2015
e81593d
spruce up help output a bit
bewest Oct 6, 2015
b38300d
Merge branch 'dev' of github.com:openaps/openaps-js into wip/bewest/s…
bewest Oct 6, 2015
20ad134
add ascii art
bewest Oct 6, 2015
1883610
Merge pull request #33 from openaps/wip/bewest/separate-concerns
bewest Oct 6, 2015
c26f9c1
Merge pull request #5 from openaps/dev
audiefile Oct 6, 2015
5a6621f
Edit test condition in oref0-itff-notify to be more roboust (eliminat…
audiefile Oct 6, 2015
2d930de
Merge pull request #36 from audiefile/dev
bewest Oct 7, 2015
eab2e1f
%s/FTT_/FTTT_/g
bewest Oct 7, 2015
d77db47
use -z "$model", bash/shell tweaks
bewest Oct 7, 2015
474343f
rename to ifttt-notify for consistency
bewest Oct 7, 2015
e62e94a
experimental tweak, using mm-stick diagnose.
bewest Oct 7, 2015
847a985
Merge pull request #37 from openaps/wip/bewest/tweaks-notify
bewest Oct 10, 2015
ad6a120
fix package
bewest Oct 13, 2015
521d40a
add fail and warmup utilities
bewest Oct 14, 2015
b50bfad
rm loop.sh and replace with symlink to openaps-sh/loop.sh
scottleibrand Oct 15, 2015
b844c0c
check /sys/devices/platform/bcm2708_usb/buspower and /sys/devices/pla…
scottleibrand Oct 15, 2015
435c5c2
rename reset-wifi-dongle.sh to reset-usb.sh
scottleibrand Oct 15, 2015
5dcc09b
hard-code lower bounds for min_bg and max_bg in case pump is set too …
scottleibrand Oct 17, 2015
58aa795
hard-code upper bound for min_bg in case pump is set too high
scottleibrand Oct 17, 2015
513a89c
this should cause get-profile to fail if bg_target units aren't in mg/dL
scottleibrand Oct 17, 2015
9be5568
Merge branch 'wip/min-thresholds' of github.com:openaps/openaps-js in…
bewest Oct 17, 2015
718476b
fix js errors, error in case of unexpected units
bewest Oct 17, 2015
0644cb1
make sure the package.json matches the actual file
bewest Oct 17, 2015
eda93d3
allow tests to run/pass
bewest Oct 17, 2015
d1abb74
name package to oref0
bewest Oct 17, 2015
609159c
just change permission to make it executable
bewest Oct 17, 2015
7aaebd3
refactor, reorganize into source modules
bewest Oct 17, 2015
273bd0e
refactor calculate-iob to be more testable/reusable
bewest Oct 17, 2015
11045cd
add .gitignore
bewest Oct 17, 2015
a27b82e
mostly whitespace tweaks, insert missing var keyword
bewest Oct 18, 2015
63dfeae
actually return iob result
bewest Oct 18, 2015
40bea4f
Merge pull request #39 from openaps/wip/more-failsafes
scottleibrand Oct 18, 2015
1c41e01
Merge pull request #42 from openaps/wip/refactor/testable-reusable
scottleibrand Oct 18, 2015
8e71f27
fix syntax error
bewest Oct 18, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
bower_components/
node_modules/


bundle/bundle.out.js

.idea/
*.iml
my.env

*.env
static/bower_components/
.*.sw?
.DS_Store

.vagrant
/iisnode

# istanbul output
coverage/

npm-debug.log
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
TESTS=tests/*.js

all: test

test:
./node_modules/.bin/mocha ${TESTS}
62 changes: 0 additions & 62 deletions bin/bgpredict.js

This file was deleted.

2 changes: 1 addition & 1 deletion bin/clockset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

die() { echo "$@" ; exit 1; }

ntp-wait -n 1 -v && die "NTP already synchronized."
ntp-wait -n 1 -v && die "NTP already synchronized." || ( sudo /etc/init.d/ntp restart && ntp-wait -n 1 -v && die "NTP re-synchronized." )

cd ~/openaps-dev
( cat clock.json; echo ) | sed 's/"//g' | sed "s/$/`date +%z`/" | while read line; do date -u -d $line +"%F %R:%S"; done > fake-hwclock.data
Expand Down
290 changes: 0 additions & 290 deletions bin/determine-basal.js

This file was deleted.

Loading