Skip to content

fix: charge current limit on vehicles without target SoC support - #537

Merged
nanomad merged 2 commits into
SAIC-iSmart-API:developfrom
jay23606:pr-go-simple/467
Nov 22, 2026
Merged

nanomad merged 2 commits into
SAIC-iSmart-API:developfrom
jay23606:pr-go-simple/467

Conversation

@jay23606

@jay23606 jay23606 commented Nov 19, 2026 •

Copy link
Copy Markdown

Setting drivetrain/chargeCurrentLimit/set failed with 'remote control instruction failed' (return code 4) on an MG5 (LFP, no target SoC support).

The charge current handler always passed the stored target SoC to set_target_battery_soc. The SoC-target and charging-schedule handlers already reject or skip target SoC for vehicles where supports_target_soc is False, but this handler did not. The change makes __desired_target_soc return TargetBatteryCode.P_IGNORE when the vehicle does not support target SoC, and leaves the NMC path unchanged.

Not verified against the vehicle or the saic_ismart_client_ng source, which is not installed in this environment; the root cause is inferred from the code path and the existing guards. Regression tests added in tests/handlers/command/test_drivetrain_chargecurrent_limit.py cover the LFP case (ignore target SoC sent) and the NMC case (known target SoC kept).

Tests: not run here (dependencies not installed; CI runs them).

🤖 Generated with Claude Code

Tests not run here: poetry run pytest tests/handlers/command/test_drivetrain_chargecurrent_limit.py -- not run: project dependencies (saic_ismart_client_ng) are not installed here and the task forbids installing them, poetry run mypy -- not run: dependencies not installed, poetry run ruff check . / ruff format --check . -- not run: ruff not available in this session

Refs #467

🤖 Generated with Claude Code

@jay23606
jay23606 marked this pull request as ready for review November 19, 2026 15:03
@nanomad
nanomad changed the base branch from main to develop November 22, 2026 10:10
@nanomad
nanomad merged commit 1de4160 into SAIC-iSmart-API:develop Nov 22, 2026
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.

Set Charging current failed on my MGS5

2 participants