Fix Core Room Size encoding and decoded value round-trip#46
Open
EdenNelson wants to merge 1 commit into
Open
Conversation
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.
Fix Core-series Room Size encode/decode round-tripping so decoded status values publish the intended room-size value instead of truncating down at range edges.
Fixes #45
Summary
10.764 * 3.15factor.round(m² * 10.764 * 3.15).publish_number(...)instead of narrowing decoded number state touint32_t.LEVOIT_UART.md.Validation
git diff --checkpassed.9 m² -> raw=305 -> low=0x31 high=0x01 -> decoded=938 m² -> raw=1288 -> low=0x08 high=0x05 -> decoded=38EdenNelson/levoit@integration/core400s-auto-profile-stack:38 m²published as38.00, sent raw1288(0x08 0x05), and MCU status echoed0x08 0x05without the previous37.00bounce.9 m²status echo showed raw305(0x31 0x01), which now decodes to9with the rounded Core status path; the previous bad behavior was8.00.Scope
This PR only changes Core room-size encoding/decoding and the numeric publish path needed to avoid truncating decoded number values. It does not add remembered Room Size persistence, fan mode mechanics, diagnostics, raw sensors, or unrelated model changes.
Disclosure
This PR was prepared with GitHub Copilot/AI assistance and human-in-the-loop review. Live payload/status validation was performed by a human on a Core400S using
air-purifier-office.yaml.