Skip to main content

MG iSMART India Client

Python client for the MG iSMART India TAP/gateway API.

This package contains the protocol/client layer used by the MG iSMART India Home Assistant work. It is intentionally separate from Home Assistant so it can be tested and released independently.

Install

pip install mg-ismart-india-client

Basic use

import aiohttp
from mg_ismart_india_client import MgIndiaClient, hash_control_pin

async with aiohttp.ClientSession() as session:
    client = MgIndiaClient(
        session,
        phone="9876543210",
        password="your-password",
        vin="YOURVINHERE",
        pin_hash=hash_control_pin("1234"),
    )

    await client.login()
    vehicles = await client.vehicles()
    status = await client.status()

    # On an EV, ask the same poll for the charging frame too: it lands on
    # status.charge (None when none arrived -- routine, not an error), and
    # saves the second round trip a separate charge_status() would cost.
    #
    # Only set this where a charging frame is expected. The loop waits for one,
    # so a vehicle that never sends it spends the full poll budget on every call.
    status = await client.status(include_charge=True)
    print(status.charge)

Control methods require a configured PIN hash. The raw 4-digit control PIN is not stored by the client.

Development

python -m venv .venv
. .venv/bin/activate
pip install -e '.[dev]'
pytest -q
ruff check src tests

License

MIT License. Copyright (c) 2026 John Lazarus.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mg_ismart_india_client-0.2.0.tar.gz (33.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mg_ismart_india_client-0.2.0-py3-none-any.whl (26.2 kB view details)

Uploaded Python 3

File details

Details for the file mg_ismart_india_client-0.2.0.tar.gz.

File metadata

  • Download URL: mg_ismart_india_client-0.2.0.tar.gz
  • Upload date:
  • Size: 33.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mg_ismart_india_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 73fa6d51b9c6c31a4d9acc930b171668ef5b1a7f46ffabb05a01245b8467d6b6
MD5 2d00848f0e68a30f11c2052df15de653
BLAKE2b-256 74f5de991c3ec24552b7d4375a02655004ebd8468a279f62841939fae89ed98e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mg_ismart_india_client-0.2.0.tar.gz:

Publisher: publish.yml on john-lazarus/mg-ismart-india-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mg_ismart_india_client-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mg_ismart_india_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8eb47b66be7f54df0651740173119b6d8d88e6823b09901252f0357a32779377
MD5 88c2238810186a03c3fd66c8f9d5f9b8
BLAKE2b-256 79a421b5b83018286c9258a0a6ed527a1b926170e4c84ed2b546c3fb3e71d177

See more details on using hashes here.

Provenance

The following attestation bundles were made for mg_ismart_india_client-0.2.0-py3-none-any.whl:

Publisher: publish.yml on john-lazarus/mg-ismart-india-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page