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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Presets are classmethods on `SaicApiConfiguration`. Each takes `(username, passw
| `mg_eu()` | `https://gateway-mg-eu.soimt.com/api.app/v1/` | `eu` | `459771` | `com.saicmotor.europecar` |
| `mg_au()` | `https://gateway-mg-au.soimt.com/api.app/v1/` | `au` | `459771` | `com.saicmotor.europecar` |
| `mg_tr()` | `https://gateway-mg-tr.soimt.com/api.app/v1/` | `tr` | `459771` | `com.saicmotor.europecar` |
| `mg_br()` | `https://gateway-mg-br.soimt.com/api.app/v1/` | `br` | `459771` | `com.saicmotor.europecar` |
| `maxus_eu()` | `https://gateway-maxus-eu.soimt.com/api.app/v1/` | `eu` | `590224` | `com.saicmaxus.ismarteu` |

MAXUS Europe vehicles use the same API. The `maxus_eu()` values were confirmed by a live traffic capture of the MAXUS app.
Expand Down
8 changes: 8 additions & 0 deletions src/saic_ismart_client_ng/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
MG_EU_BASE_URI = "https://gateway-mg-eu.soimt.com/api.app/v1/"
MG_AU_BASE_URI = "https://gateway-mg-au.soimt.com/api.app/v1/"
MG_TR_BASE_URI = "https://gateway-mg-tr.soimt.com/api.app/v1/"
MG_BR_BASE_URI = "https://gateway-mg-br.soimt.com/api.app/v1/"
MAXUS_EU_BASE_URI = "https://gateway-maxus-eu.soimt.com/api.app/v1/"
MAXUS_EU_TENANT_ID = "590224"
MAXUS_EU_DEVICE_APP_ID = "com.saicmaxus.ismarteu"
Expand Down Expand Up @@ -57,6 +58,13 @@ def mg_tr(cls, username: str, password: str, **kwargs: Any) -> SaicApiConfigurat
kwargs.setdefault("region", "tr")
return cls(username, password, **kwargs)

@classmethod
def mg_br(cls, username: str, password: str, **kwargs: Any) -> SaicApiConfiguration:
"""Build the configuration for MG iSMART in Brazil (the "MG i-SMART LATAM" app)."""
kwargs.setdefault("base_uri", MG_BR_BASE_URI)
kwargs.setdefault("region", "br")
return cls(username, password, **kwargs)

@classmethod
def maxus_eu(
cls,
Expand Down
1 change: 1 addition & 0 deletions tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def test_mg_presets(self) -> None:
(SaicApiConfiguration.mg_eu, "gateway-mg-eu", "eu"),
(SaicApiConfiguration.mg_au, "gateway-mg-au", "au"),
(SaicApiConfiguration.mg_tr, "gateway-mg-tr", "tr"),
(SaicApiConfiguration.mg_br, "gateway-mg-br", "br"),
):
config = factory("u", "p")
assert config.base_uri == f"https://{host}.soimt.com/api.app/v1/"
Expand Down
Loading