Skip to content

Commit

Permalink
Added support for Lexus
Browse files Browse the repository at this point in the history
  • Loading branch information
tibor19 committed Jul 4, 2023
1 parent bd2ee9f commit 48c32db
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ from mytoyota.client import MyT

username = "[email protected]"
password = "MyPassword"
brand = "toyota" # or lexus

# Get supported regions, can be passed to the optional 'region' argument of MyT
# At this moment, only the 'europe' region is supported
print(MyT.get_supported_regions())

client = MyT(username=username, password=password)

client = MyT(username=username, password=password, brand=brand)

async def get_information():
print("Logging in...")
Expand Down
4 changes: 3 additions & 1 deletion mytoyota/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ def __init__(
password: str,
locale: str = "da-dk",
region: str = "europe",
uuid: str = None,
brand: str = "toyota",
uuid: str | None = None,
controller_class=Controller,
disable_locale_check: bool = False,
) -> None:
Expand All @@ -87,6 +88,7 @@ def __init__(
password=password,
locale=locale,
region=region,
brand=brand,
uuid=uuid,
)
)
Expand Down
1 change: 0 additions & 1 deletion mytoyota/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"Content-Type": "application/json;charset=UTF-8",
"Accept": "application/json, text/plain, */*",
"Sec-Fetch-Dest": "empty",
"X-TME-BRAND": "TOYOTA",
"User-Agent": (
"Mozilla/5.0 (X11; Linux x86_64) "
"AppleWebKit/537.36 (KHTML, like Gecko) "
Expand Down
3 changes: 3 additions & 0 deletions mytoyota/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ def __init__(
region: str,
username: str,
password: str,
brand: str,
uuid: str | None = None,
) -> None:
self._locale = locale
self._region = region
self._username = username
self._password = password
self._brand = brand
self._uuid = uuid

@property
Expand Down Expand Up @@ -176,6 +178,7 @@ async def request( # pylint: disable=too-many-branches
"X-TME-LOCALE": self._locale,
"X-TME-TOKEN": self._token,
"X-TME-APP-VERSION": "4.10.0",
"X-TME-BRAND": self._brand.upper(),
}
)

Expand Down

0 comments on commit 48c32db

Please sign in to comment.