Skip to content

fix: do not report cable lock state for models that do not provide it - #477

Merged
nanomad merged 1 commit into
developfrom
fix/cable-lock-state
Oct 17, 2026
Merged

nanomad merged 1 commit into
developfrom
fix/cable-lock-state

Conversation

@nanomad

@nanomad nanomad commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Some models, such as the MG ZS EV, do not send ccuEleccLckCtrlDspCmd in the charge management data. The client library's charging_port_locked then returns False, so the gateway always published "unlocked", even with the cable locked (#271).

  • The cable lock topic is published only when the car reports the field. Otherwise nothing is published and HA shows "unknown".
  • After a successful lock or unlock command, the gateway publishes the commanded state. Cars that do report the lock overwrite it on the forced refresh.

Notes:

  • On models that don't report the lock, the shown state is the commanded one. A manual lock or unlock is not reflected.
  • A retained False published by older versions stays on the broker until the first lock or unlock command. It can be cleared with an empty retained publish on .../drivetrain/chargingCableLock.

Closes #271

@nanomad
nanomad merged commit f5d1c52 into develop Oct 17, 2026
6 checks passed
@nanomad
nanomad deleted the fix/cable-lock-state branch October 17, 2026 13:32
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