fix: filter unsupported SoC options for vehicles without target SoC#403
Merged
nanomad merged 1 commit intoSAIC-iSmart-API:developfrom Feb 19, 2026
Merged
Conversation
…AIC-iSmart-API#399) Vehicles like MG4 Standard (LFP battery) support scheduled charging but not target SoC control. Previously the gateway offered UNTIL_CONFIGURED_SOC as a charging schedule mode and showed a disabled Target SoC slider that users could manually enable, leading to unsupported API calls. Layer 1 — HA discovery: - Don't publish the Target SoC number entity at all (unpublish it) when the vehicle doesn't support target SoC - Filter UNTIL_CONFIGURED_SOC from the scheduled charging mode options Layer 2 — Command handler guards: - Reject target SoC changes with RESULT_DO_NOTHING - Reject UNTIL_CONFIGURED_SOC schedule mode with RESULT_DO_NOTHING
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #399. Vehicles like MG4 Standard (LFP battery) support scheduled charging but not target SoC control. Previously the gateway offered
UNTIL_CONFIGURED_SOCas a charging schedule mode and showed a disabled Target SoC slider that users could manually enable, leading to unsupported API calls.Two-layer defense:
UNTIL_CONFIGURED_SOCfrom the scheduled charging mode optionsUNTIL_CONFIGURED_SOCschedule mode withRESULT_DO_NOTHINGwhen unsupportedTest plan
supports_target_soc=True(NMC battery): Target SoC slider and all scheduled charging modes still availablesupports_target_soc=False(LFP battery): Target SoC entity removed from HA,UNTIL_CONFIGURED_SOCnot offered🤖 Generated with Claude Code