don't reduce CR for low temptargets #1194
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the low_temptarget_lowers_sensitivity option enabled, oref0 doses more aggressively when an "eating soon" target is set. However, in the current implementation, this becomes much more aggressive with COB, as the adjusted sensitivityRatio is used to adjust CR as well as basal/IOB and ISF. This results in too-aggressive dosing when a low temptarget is started or left running after carb entry.
This PR adjusts the low_temptarget_lowers_sensitivity behavior so that the modified sensitivityRatio does not affected CR, yielding much more intuitive and predictable behavior before vs. after carb entry, and avoiding most of the risk of a low target causing a postprandial low.