Repository navigation
Conversation
Follow-up to the EntityCategory work in #28: introduces a "control" flag on sensor/switch/select/time entity definitions so genuine operational controls (storage-mode bits, TOU V2 enable switches, TOU V2 SOC/current/voltage/time entities, Work Mode select, the active- protocol select) stay in the default category instead of being lumped into EntityCategory.CONFIG alongside one-time settings. Also renames storage-mode switch bits to a shorter "Mode - X" scheme, disables two rarely-used bits (Battery Forcecharge Peakshaving, Battery Current Correction) by default, and unifies TOU V2 entity names to "Timed Charge {field} N" (N=1-6 charge slots, 7-12 discharge slots), mirroring how V1 TOU already uses "Time-Charging" as an umbrella term for both directions. A new _apply_control_metadata() helper in hybrid_sensors.py tags and renames entities by register instead of hand-annotating each dict.
Contributor
|
Failed to generate code suggestions for PR |
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
Follow-up to PR #28's EntityCategory work (issue #15's "per-sensor category never mapped to EntityCategory" gap). That PR uniformly marked register-backed config/control entities as
EntityCategory.CONFIG, which over-reached: entities the user interacts with regularly (storage-mode bits, TOU V2 enable switches, TOU V2 SOC/current/voltage/time entities, the Work Mode select, the active-protocol select) don't belong in HA's CONFIG category alongside genuine one-time settings.controlflag to entity definitions;entity_category_for_sensor_category()and the platform entity classes (SolisSensor,SolisNumberEntity,SolisBinaryEntity,SolisSelectEntity,SolisTimeEntity,SolisProtocolSelect) now returnNone(default category) forcontrol=Trueentities instead ofEntityCategory.CONFIG._apply_control_metadata()helper inhybrid_sensors.pytags/renames entities by register instead of hand-annotating each dict entry.Test plan
tests/test_ac_coupling.py,tests/test_entity_categories_and_versions.py: new coverage for the naming scheme and control-vs-configuration category splitruff check/ruff format --checkclean