Prefer structured ISF/CR from device status over reason string#677
Open
bjorkert wants to merge 1 commit into
Open
Prefer structured ISF/CR from device status over reason string#677bjorkert wants to merge 1 commit into
bjorkert wants to merge 1 commit into
Conversation
Ignore a placeholder 0 in the structured ISF field so the info row falls back to the profile value instead of showing a 0 enacted ISF. Read the carb ratio from the structured CR field when present, keeping the reason-string regex only as a fallback for uploaders that don't expose it.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When showing ISF and Carb Ratio in the info table, LoopFollow reads from the most recent
enacted/suggestedrecord in device status.ISF was taken straight from the structured
ISFfield without validation. The value is now validated, and a0is treated as missing, so the info row falls back to the profile ISF instead of renderingprofileISF → 0.Carb Ratio was parsed out of the
reasonstring by regex, even though device status already carries a structuredCRfield. CR now reads from the structured field when present (and non-zero), keeping thereason-string regex only as a fallback for uploaders that don't expose it. Parsing the structured number is more robust than matching free text across oref versions.