Repository navigation
fix: measure only recorded attributes in the oversize warning - #42
Merged
Merged
Conversation
Before: the warning and diagnostics measured every state attribute and told the user the history would have no attributes. Since entries and channel are unrecorded, that was no longer true: a verbose feed keeps its history. After: the check measures only what the recorder stores (feed_url), via a shared UNRECORDED_ATTRIBUTES constant the sensor also uses. The message now says the recorded part is oversized and that show_topn does not affect it. Diagnostics reports recorded_attributes_bytes and bases exceeds_recorder_limit on it. README and tests updated.
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.
Summary
Since #34
entriesandchannelare unrecorded, but the oversize warning still measured all attributes and claimed the history would lose its attributes.UNRECORDED_ATTRIBUTESnow lives inconst.py; the sensor and the check share it.feed_url), so a verbose feed no longer warns. It fires only for an absurdly long feed URL, and the message says so (show_topn/max_text_length do not help).exceeds_recorder_limitis based on the newrecorded_attributes_bytes;state_attributes_bytesstill reports the full live state.Tests
Full suite: 281 passed. ruff check shows no findings in changed code (remaining findings are pre-existing, from a newer local ruff). New tests: unrecorded entries do not warn, an oversized URL warns once, diagnostics sizes.
Board card f2.