Created
May 10, 2016 22:53
-
-
Save mddub/4f4a8b135f8d734b1691ca2dcef659a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/basal-set-temp.js b/lib/basal-set-temp.js | |
index ea0a80e..cf52021 100644 | |
--- a/lib/basal-set-temp.js | |
+++ b/lib/basal-set-temp.js | |
@@ -13,22 +13,9 @@ var setTempBasal = function (rate, duration, profile, rT, currenttemp) { | |
return rT; | |
} | |
- var suggestedRate = Math.round((Math.round(rate / 0.05) * 0.05)*100)/100; | |
- if (suggestedRate === profile.current_basal) { | |
- if (typeof(currenttemp) === 'undefined') { | |
- console.error('suggested rate is same as profile rate and no temp is set, doing nothing'); | |
- return rT; | |
- } else { | |
- console.error('suggested rate is same as profile rate and a temp basal is active, canceling current temp'); | |
- rT.duration = 0; | |
- rT.rate = 0; | |
- return rT; | |
- } | |
- } else { | |
- rT.duration = duration; | |
- rT.rate = suggestedRate; | |
- return rT; | |
- } | |
+ rT.duration = duration; | |
+ rT.rate = Math.round((Math.round(rate / 0.05) * 0.05)*100)/100; | |
+ return rT; | |
}; | |
module.exports = setTempBasal; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment