Skip to content

Exclude high-churn energy sensor attrs from recorder (#197)#202

Merged
cayossarian merged 2 commits intomainfrom
2_0_4a_attribute_recorder
Mar 23, 2026
Merged

Exclude high-churn energy sensor attrs from recorder (#197)#202
cayossarian merged 2 commits intomainfrom
2_0_4a_attribute_recorder

Conversation

@cayossarian
Copy link
Copy Markdown
Member

Set SpanEnergySensorBase._unrecorded_attributes for grace-period and dip diagnostics plus circuit tabs and nominal voltage. Live entity attributes unchanged; RestoreSensor storage unchanged. Add test and 2.0.4 changelog.

Set SpanEnergySensorBase._unrecorded_attributes for grace-period and dip
diagnostics plus circuit tabs and nominal voltage. Live entity attributes
unchanged; RestoreSensor storage unchanged. Add test and 2.0.4 changelog.

Made-with: Cursor
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR reduces Home Assistant recorder database churn for Span energy sensors by marking several high-frequency (and some redundant) extra_state_attributes as unrecorded, while keeping live entity attributes and RestoreSensor storage behavior unchanged.

Changes:

  • Add _unrecorded_attributes to SpanEnergySensorBase to exclude grace-period/dip diagnostics plus tabs and voltage from recorder history.
  • Add a unit test asserting the entity’s combined unrecorded-attribute set includes these keys.
  • Document the change in the 2.0.4 changelog entry.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
custom_components/span_panel/sensor_base.py Defines the new unrecorded-attributes set and applies it to SpanEnergySensorBase to reduce recorder churn.
tests/test_energy_sensor_recorder.py Adds coverage to ensure the relevant attributes are excluded from recorder persistence.
CHANGELOG.md Notes the recorder churn reduction in the 2.0.4 release notes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot PR #202: comment wrongly implied circuit-only; SpanEnergySensorBase
covers panel and circuit energy entities.

Made-with: Cursor
@cayossarian cayossarian merged commit de706f3 into main Mar 23, 2026
7 checks passed
@cayossarian cayossarian deleted the 2_0_4a_attribute_recorder branch March 23, 2026 06:15
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