-
Notifications
You must be signed in to change notification settings - Fork 403
Description
Hi,
Turns out a couple of safety checks/guardrails are capping carb ratios to 1:3:
Lines 19 to 22 in 88cf032
| // disallow impossibly high/low carbRatios due to bad decoding | |
| if (carbRatio < 3 || carbRatio > 150) { | |
| console_error(final_result, "Error: carbRatio of " + carbRatio + " out of bounds."); | |
| return; |
Lines 88 to 92 in 88cf032
| // disallow impossibly low carbRatios due to bad decoding | |
| if ( typeof(profile_data.carb_ratio) === 'undefined' || profile_data.carb_ratio < 3 ) { | |
| console_log(final_result, '{ "carbs": 0, "mealCOB": 0, "reason": "carb_ratio ' + profile_data.carb_ratio + ' out of bounds" }'); | |
| return console_error(final_result, "Error: carb_ratio " + profile_data.carb_ratio + " out of bounds"); | |
| } |
oref0/bin/oref0-autotune-prep.js
Lines 83 to 89 in 88cf032
| // disallow impossibly low carbRatios due to bad decoding | |
| if ( typeof(profile_data.carb_ratio) === 'undefined' || profile_data.carb_ratio < 2 ) { | |
| if ( typeof(pumpprofile_data.carb_ratio) === 'undefined' || pumpprofile_data.carb_ratio < 2 ) { | |
| console.log('{ "carbs": 0, "mealCOB": 0, "reason": "carb_ratios ' + profile_data.carb_ratio + ' and ' + pumpprofile_data.carb_ratio + ' out of bounds" }'); | |
| return console.error("Error: carb_ratios " + profile_data.carb_ratio + ' and ' + pumpprofile_data.carb_ratio + " out of bounds"); | |
| } else { | |
| profile_data.carb_ratio = pumpprofile_data.carb_ratio; |
However, for people with such 'impossibly low ratios' (damnit :P) such as myself - I need to go below it.
Of course it can be implemented differently in the app that I use and deviate from the oref0 standard, but consistency is nice so I was wondering if perhaps this could be refactored. Ideally, the app implementing oref0 will give a warning if people try to go below 1:3, but oref0 itself shouldn't put a limit on it as there simply are people that have insane insensitivity.
Thank you for your consideration.