Skip to content

Restore DC charger control compatibility (v1.2.7.1) - #404

Merged
TypQxQ merged 2 commits into
mainfrom
Dev-1.2.7.1
Aug 24, 2026
Merged

TypQxQ merged 2 commits into
mainfrom
Dev-1.2.7.1

Conversation

@TypQxQ

@TypQxQ TypQxQ commented Aug 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • keep the write-only DC charger start/stop controls independent of optional running-state register 31513
  • keep the deprecated DC charging switch available and off for a valid Idle state
  • when 31513 is unavailable, use other responding DC telemetry for command availability and use output power as the deprecated switch's legacy state fallback
  • restore DC controls that v1.2.7 previously marked hidden_by=integration
  • bump the integration version to 1.2.7.1

Root cause

PR #398 in v1.2.7 added register_support_keys=("dc_charger_running_state",) to the deprecated DC switch and both DC command buttons. When a charger does not expose register 31513, the new unsupported-register lifecycle hides and unloads all three controls even though their command register is a separate write-only register. The deprecated switch's availability function also treated the valid Idle value (0x00) as unavailable instead of off.

An explicit empty dependency tuple now represents controls backed only by a write-only register and is treated as structurally supported. This allows registry entries hidden by v1.2.7 to be restored while preserving user-hidden entries. Runtime availability remains telemetry-based, unsupported-register filtering remains active for raw sensors and other entities, and missing Modbus data is not converted into a false Idle sensor value.

Validation

  • parsed all 17 integration Python modules with ast.parse
  • validated Idle, Occupied, Charging, Unavailable, missing-state/responding-telemetry, and no-telemetry behavior
  • validated running-state preference and output-power fallback for the deprecated switch
  • validated the three DC controls opt out of inferred readable-register filtering
  • validated v1.2.7 integration-hidden registry entries are restored
  • validated user-hidden registry entries remain unchanged
  • validated ordinary raw-register True / False / None support behavior remains unchanged
  • validated manifest.json version 1.2.7.1
  • git diff --check

Addresses #403

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c6b889961e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread custom_components/sigen/common.py
@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR restores DC charger controls on devices that do not expose the optional running-state register and ensures integration-hidden controls return after upgrading.

  • Treats explicit empty register dependencies as structurally supported.
  • Uses responding DC telemetry for runtime command availability when running state is absent.
  • Preserves Idle as an available, off state for the deprecated switch and falls back to output power for legacy state.
  • Updates the integration version to 1.2.7.1.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the current support result is explicitly true for dependency-free controls, and both registry reconciliation paths can restore entries previously hidden by the integration.

Important Files Changed

Filename Overview
custom_components/sigen/common.py Distinguishes explicit empty register dependencies from inferred dependencies, returns structural support for dependency-free controls, and adds telemetry-based DC command availability.
custom_components/sigen/button.py Marks both write-only DC charger command buttons as independent of the optional running-state register.
custom_components/sigen/switch.py Restores the deprecated DC switch without register 31513, keeps Idle available as off, and adds the documented output-power fallback.
custom_components/sigen/manifest.json Bumps the integration version from 1.2.7 to 1.2.7.1.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[DC control description] --> B{Register dependencies}
    B -->|Explicit empty tuple| C[Structurally supported]
    C --> D[Restore integration-hidden registry entry]
    D --> E{Running-state register available?}
    E -->|Yes| F[Use running state]
    E -->|No| G[Use responding DC telemetry]
    F --> H[Determine runtime availability and switch state]
    G --> H
Loading

Reviews (2): Last reviewed commit: "Restore integration-hidden DC controls" | Re-trigger Greptile

Comment thread custom_components/sigen/common.py
@TypQxQ

TypQxQ commented Aug 24, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 74b37064e4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@TypQxQ
TypQxQ merged commit b240ac3 into main Aug 24, 2026
4 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