Skip to content

Prefer structured ISF/CR from device status over reason string#677

Merged
marionbarker merged 1 commit into
devfrom
fix/devicestatus-structured-cr-isf
Jul 9, 2026
Merged

Prefer structured ISF/CR from device status over reason string#677
marionbarker merged 1 commit into
devfrom
fix/devicestatus-structured-cr-isf

Conversation

@bjorkert

Copy link
Copy Markdown
Member

When showing ISF and Carb Ratio in the info table, LoopFollow reads from the most recent enacted/suggested record in device status.

ISF was taken straight from the structured ISF field without validation. The value is now validated, and a 0 is treated as missing, so the info row falls back to the profile ISF instead of rendering profileISF → 0.

Carb Ratio was parsed out of the reason string by regex, even though device status already carries a structured CR field. CR now reads from the structured field when present (and non-zero), keeping the reason-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.

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.

@marionbarker marionbarker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve from code review and minimal testing. It builds, it reports modified ISF for Trio URL.

@marionbarker marionbarker merged commit 2acd81b into dev Jul 9, 2026
1 check passed
@marionbarker marionbarker deleted the fix/devicestatus-structured-cr-isf branch July 9, 2026 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants