Skip to content

fix: measure only recorded attributes in the oversize warning - #42

Merged
timmaurice merged 1 commit into
masterfrom
f2/oversize-warning
Nov 13, 2026
Merged

timmaurice merged 1 commit into
masterfrom
f2/oversize-warning

Conversation

@timmaurice

Copy link
Copy Markdown
Owner

Summary

Since #34 entries and channel are unrecorded, but the oversize warning still measured all attributes and claimed the history would lose its attributes.

  • UNRECORDED_ATTRIBUTES now lives in const.py; the sensor and the check share it.
  • The warning measures only recorded attributes (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).
  • Diagnostics exceeds_recorder_limit is based on the new recorded_attributes_bytes; state_attributes_bytes still reports the full live state.
  • README and CLAUDE.md updated. The state machine has no attribute size limit of its own, so no warning for the 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.

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.
@timmaurice
timmaurice merged commit 833e79d into master Nov 13, 2026
8 checks passed
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