Skip to content

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

Open
bjorkert wants to merge 1 commit into
devfrom
fix/devicestatus-structured-cr-isf
Open

Prefer structured ISF/CR from device status over reason string#677
bjorkert wants to merge 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.
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.

1 participant