Repository navigation
Add sensor disable controls to the statistics interface - #3
Merged
Merged
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.
The statistics interface previously required administrators to leave the panel and disable both entities manually. This adds a Disable both sensor entities action for a reviewed pair that otherwise passes the statistics checks.
The action uses Home Assistant's entity registry API for only the two selected entities, preserves existing disable reasons, and never disables a whole device, removes states, or reloads integrations. The panel shows entity readiness, briefly polls for actual unloading, and provides Refresh status when unloading is delayed. Transfer stays blocked until both entities are disabled and unloaded and has its own fresh review and backup confirmation.
The disable action is administrator-only, session-bound, expiring, single-use and revalidates sensor identities and statistics before either registry write. Existing destination statistics are rejected before offering to disable anything. Partial registry failures are reported without claiming success or retrying blindly. Configuration Restore does not undo entity disabling.
Validation: 106 standalone Python tests, six real Home Assistant 2026.3.0 recorder tests, frontend unit tests, desktop/mobile Chromium workflows and overflow checks at 1360px and 390px, JavaScript syntax and package validation all passed locally. Real recorder coverage confirms companion entities are unchanged, loaded states are never forcibly removed and transfer remains gated until unload.
Updates the version and prerelease request to v1.2.1. On merge, the existing prerelease-only workflow reruns checks and publishes the ZIP/checksums with --prerelease --latest=false. The measurement-only limitations remain; this does not add merging or energy-counter support. Related to #1, which remains open.