Skip to content

Commit

Permalink
Fix scopes and requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
Bre77 committed Dec 5, 2024
1 parent bfc4f32 commit a9de23b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ aiohttp==3.*
aiolimiter==1.*
cryptography==43.*
protobuf==5.*
aiofiles=24.*
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
"Operating System :: OS Independent",
],
python_requires=">=3.10",
install_requires=["aiohttp", "aiolimiter", "cryptography", "protobuf"],
install_requires=["aiohttp", "aiofiles", "aiolimiter", "cryptography", "protobuf"],
)
1 change: 1 addition & 0 deletions tesla_fleet_api/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ class Scope(StrEnum):
OFFLINE_ACCESS = "offline_access"
USER_DATA = "user_data"
VEHICLE_DEVICE_DATA = "vehicle_device_data"
VEHICLE_LOCATION = "vehicle_location"
VEHICLE_CMDS = "vehicle_cmds"
VEHICLE_CHARGING_CMDS = "vehicle_charging_cmds"
ENERGY_DEVICE_DATA = "energy_device_data"
Expand Down
2 changes: 1 addition & 1 deletion tesla_fleet_api/teslafleetoauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def get_login_url(self, scopes: list[Scope], state: str = "login") -> str:
"""Get the login URL."""
if self.redirect_uri is None:
raise ValueError("Redirect URI is missing")
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}"
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}"

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

0 comments on commit a9de23b

Please sign in to comment.