Skip to content

feat: add Regulation Mode text sensor (CV/CC)#16

Open
malaiwah wants to merge 1 commit into
wildekek:mainfrom
malaiwah:fix/cv-cc-mode-sensor
Open

feat: add Regulation Mode text sensor (CV/CC)#16
malaiwah wants to merge 1 commit into
wildekek:mainfrom
malaiwah:fix/cv-cc-mode-sensor

Conversation

@malaiwah
Copy link
Copy Markdown

Closes #15

Adds a single Regulation Mode text_sensor populated from the existing CV binary_sensor's on_state. Reports "CV" or "CC" directly.

Both legacy binary_sensors are preserved with a deprecation comment so existing dashboards / automations keep working.

Verification

  • esphome config passes for both rdtech-controller.yaml and rdtech-controller-c3.yaml
  • Full esphome compile against ESPHome 2025.x with esp01_1m board: clean (no lambda errors, RAM 46.3% / Flash 49.4%)

Disclosure

This change was drafted with assistance from Claude (Anthropic). The author reviewed every line, validated upstream against the codebase, and signed off. The commit carries a Co-Authored-By: Claude trailer per common convention.

The "Constant Voltage" and "Constant Current" binary sensors both derive
from bit 0 of holding register 17 — they are tautologically opposite.
Two entities for one bit is redundant.

Adds a new "Regulation Mode" text_sensor that exposes "CV" / "CC"
directly. The legacy binary sensors are kept for backward compatibility
with existing dashboards and automations; a comment marks them as
preferred-deprecated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

Two binary_sensors for one bit: CV / CC are tautologically opposite

1 participant