Skip to content

Commit a9de23b

Browse files
committed
Fix scopes and requirements
1 parent bfc4f32 commit a9de23b

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ aiohttp==3.*
22
aiolimiter==1.*
33
cryptography==43.*
44
protobuf==5.*
5+
aiofiles=24.*

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@
2020
"Operating System :: OS Independent",
2121
],
2222
python_requires=">=3.10",
23-
install_requires=["aiohttp", "aiolimiter", "cryptography", "protobuf"],
23+
install_requires=["aiohttp", "aiofiles", "aiolimiter", "cryptography", "protobuf"],
2424
)

tesla_fleet_api/const.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ class Scope(StrEnum):
125125
OFFLINE_ACCESS = "offline_access"
126126
USER_DATA = "user_data"
127127
VEHICLE_DEVICE_DATA = "vehicle_device_data"
128+
VEHICLE_LOCATION = "vehicle_location"
128129
VEHICLE_CMDS = "vehicle_cmds"
129130
VEHICLE_CHARGING_CMDS = "vehicle_charging_cmds"
130131
ENERGY_DEVICE_DATA = "energy_device_data"

tesla_fleet_api/teslafleetoauth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def get_login_url(self, scopes: list[Scope], state: str = "login") -> str:
4545
"""Get the login URL."""
4646
if self.redirect_uri is None:
4747
raise ValueError("Redirect URI is missing")
48-
return f"https://auth.tesla.com/oauth2/v3/authorize?response_type=code&prompt=login&client_id={self.client_id}&redirect_uri={self.redirect_uri}&scope={' '.join(scopes)}&state={state}"
48+
return f"https://auth.tesla.com/oauth2/v3/authorize?response_type=code&prompt=login&client_id={self.client_id}&redirect_uri={self.redirect_uri}&scope={'+'.join(scopes)}&state={state}"
4949

5050
async def get_refresh_token(self, code: str) -> None:
5151
"""Get the refresh token."""

0 commit comments

Comments
 (0)