feat(india): expose EV charging status sensors - #302
Draft
Dr-Blank wants to merge 3 commits into
Draft
Conversation
…o method for India backend Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… conversion Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Resolve conflict in india.py: purely additive, both charging-current/ duration helpers (ours) and GPS-position mapping (upstream) kept. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Dr-Blank
force-pushed
the
feat/india-charging
branch
from
August 19, 2026 06:06
9f231ad to
f0171c4
Compare
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.
What
Wires MG iSMART India EV vehicles into the existing charging sensors. The
India backend's
get_charging_infonow fetches the decoded charging frame fromthe client and maps it onto the
chrgMgmtData/rvsChargeStatusshapes theshared charging sensors already read — so India EVs get charging state, SOC,
voltage, current, power, range, session duration and odometer with no new
sensor code.
How it maps
The client returns charging values in declared real units (volts, amps,
percent, km). This backend re-encodes them onto the global SAIC raw scales
the shared sensors decode (
CHARGING_VOLTAGE_FACTOR,CHARGING_CURRENT_FACTOR,tenths), rather than assuming the India protocol's raw field values happen to
share the global scale.
rvsChargeStatusis built field by field, so everyvalue a sensor reads has a named source and a stated scale assumption.
is_charging/is_plugged_in→bmsChrgSts(charging / plugged-in / unplugged)since last charge) are forwarded as the vehicle's own integer, flagged in a
comment as the line to correct if a sensor reads wrong.
Nonewhen the vehicle sends no charging frame (coordinator handlesit); session/protocol errors propagate so they're logged, not silently
reported as "not charging".
Dependency
(
charge_status()→ChargeStatus). Merge + release that, then bump the pinnedclient in
manifest.jsonbefore this lands. Draft until then.Scope
Diff is two files (
backends/india.py,backends/__init__.py). Branch is behindbeta; will rebase before un-drafting.