Skip to content

Distinguish operational controls from configuration entities - #29

Merged
fboundy merged 1 commit into
mainfrom
patch
Jul 3, 2026
Merged

fboundy merged 1 commit into
mainfrom
patch

Conversation

@fboundy

@fboundy fboundy commented Jul 3, 2026

Copy link
Copy Markdown
Owner

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.

  • Adds a control flag to entity definitions; entity_category_for_sensor_category() and the platform entity classes (SolisSensor, SolisNumberEntity, SolisBinaryEntity, SolisSelectEntity, SolisTimeEntity, SolisProtocolSelect) now return None (default category) for control=True entities instead of EntityCategory.CONFIG.
  • Renames storage-mode switch bits (register 43110) to a shorter "Mode - X" scheme; two rarely-used bits (Battery Forcecharge Peakshaving, Battery Current Correction) are now disabled by default.
  • Unifies TOU V2 entity names to "Timed Charge {field} N" (N=1-6 charge slots, 7-12 discharge slots) — mirrors how V1 TOU already uses "Time-Charging" as an umbrella term covering both charge and discharge.
  • New _apply_control_metadata() helper in hybrid_sensors.py tags/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 split
  • Full suite: 337 passed
  • ruff check / ruff format --check clean

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.
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Failed to generate code suggestions for PR

@fboundy
fboundy merged commit 0b42a94 into main Jul 3, 2026
6 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