Skip to content

Commit

Permalink
limit SMB zero temps to 60m (openaps#844)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottleibrand authored Dec 11, 2017
1 parent ef81c66 commit 959981d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/determine-basal/determine-basal.js
Original file line number Diff line number Diff line change
Expand Up @@ -1064,10 +1064,10 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
var smbLowTempReq = 0;
if (durationReq <= 0) {
durationReq = 0;
// don't set a temp longer than 120 minutes
// don't set an SMB zero temp longer than 60 minutes
} else if (durationReq >= 30) {
durationReq = round(durationReq/30)*30;
durationReq = Math.min(120,Math.max(0,durationReq));
durationReq = Math.min(60,Math.max(0,durationReq));
} else {
// if SMB durationReq is less than 30m, set a nonzero low temp
smbLowTempReq = round( basal * durationReq/30 ,2);
Expand Down

0 comments on commit 959981d

Please sign in to comment.