Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
app ID sent at login with `--saic-device-app-id` (`SAIC_DEVICE_APP_ID`)
(#508, #509).

* Add the `mg_br` API preset for MG i-SMART LATAM (Brazil), tested on an MG4
Urban. Requires client 0.16.0.

* Open and close a power tailgate with `doors/boot/powerTailgate/set`
(`open`/`close`), also available as a Home Assistant "Power Tailgate" cover
that is disabled by default. The state comes from `doors/boot`. Nothing in
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ When using combinations of configuration methods, the order of precedence is as
| -u or --saic-user | SAIC_USER | SAIC user name - **required** |
| -p or --saic-password | SAIC_PASSWORD | SAIC password - **required** |
| --saic-phone-country-code | SAIC_PHONE_COUNTRY_CODE | Phone country code, used if the username is not an email address |
| --saic-preset | SAIC_PRESET | Preset for the SAIC API: mg_eu (default), mg_au, mg_tr or maxus_eu. Sets the URI, region, tenant ID and app ID. The options below override single values. |
| --saic-preset | SAIC_PRESET | Preset for the SAIC API: mg_eu (default), mg_au, mg_tr, mg_br or maxus_eu. Sets the URI, region, tenant ID and app ID. The options below override single values. |
| --saic-rest-uri | SAIC_REST_URI | SAIC API URI. Default comes from the preset (mg_eu: https://gateway-mg-eu.soimt.com/api.app/v1/) |
| --saic-region | SAIC_REGION | SAIC API region. Default comes from the preset. |
| --saic-tenant-id | SAIC_TENANT_ID | SAIC API tenant ID. Default comes from the preset (459771 for MG, 590224 for MAXUS). |
Expand All @@ -57,7 +57,7 @@ The following are the known available endpoints:
| https://gateway-mg-au.soimt.com/api.app/v1/ | au | This endpoint is not used by the iSmart app for Australia and New Zealand but has been tested and proven to work in these countries. |
| https://gateway-mg-eu.soimt.com/api.app/v1/ | eu | |
| https://gateway-mg-tr.soimt.com/api.app/v1/ | tr | This endpoint is valid for the country of Türkiye. |
| https://gateway-mg-br.soimt.com/api.app/v1/ | br | Used by the "MG i-SMART LATAM" app (Brazil). Tested with the default tenant ID and a secondary account on an MG4 Urban. |
| https://gateway-mg-br.soimt.com/api.app/v1/ | br | Used by the "MG i-SMART LATAM" app (Brazil). Use SAIC_PRESET=mg_br. |
| https://gateway-maxus-eu.soimt.com/api.app/v1/ | eu | MAXUS Europe app. Use SAIC_PRESET=maxus_eu. Values confirmed by capture. |

### MQTT Broker
Expand Down
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ classifiers = [

requires-python = '>=3.12,<4.0'
dependencies = [
"saic-ismart-client-ng (>=0.15.0,<0.16.0)",
"saic-ismart-client-ng (>=0.16.0,<0.17.0)",
'httpx (>=0.28.1,<0.29.0)',
'inflection (>=0.5.1,<0.6.0)',
'apscheduler (>=3.11.0,<4.0.0)',
Expand Down
4 changes: 2 additions & 2 deletions src/configuration/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,9 @@ def __add_saic_api_argument_group(
)
saic_api.add_argument(
"--saic-preset",
help="""The SAIC API preset: mg_eu, mg_au, mg_tr or maxus_eu.""",
help="""The SAIC API preset: mg_eu, mg_au, mg_tr, mg_br or maxus_eu.""",
default="mg_eu",
choices=["mg_eu", "mg_au", "mg_tr", "maxus_eu"],
choices=["mg_eu", "mg_au", "mg_tr", "mg_br", "maxus_eu"],
dest="saic_preset",
required=False,
action=EnvDefault,
Expand Down
19 changes: 19 additions & 0 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,25 @@ def test_process_command_line_sets_preset(
assert config.saic_rest_uri is None


def test_process_command_line_accepts_mg_br_preset(
monkeypatch: pytest.MonkeyPatch,
) -> None:
monkeypatch.setattr(
"sys.argv",
[
"prog",
"--saic-user",
"user@example.com",
"--saic-password",
"secret",
"--saic-preset",
"mg_br",
],
)
config = process_command_line()
assert config.saic_preset == "mg_br"


def test_process_command_line_rejects_unknown_preset(
monkeypatch: pytest.MonkeyPatch,
) -> None:
Expand Down
Loading