Skip to content

Commit

Permalink
Merge pull request #129 from alandtse/ci_fix
Browse files Browse the repository at this point in the history
Ci fix
  • Loading branch information
alandtse committed Jan 31, 2021
2 parents bb4283a + ed7a355 commit ec1f18e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
VERSION = None

# What packages are required for this module to be executed?
REQUIRED = ["aiohttp", "backoff", "wrapt"]
REQUIRED = ["aiohttp", "backoff", "bs4", "wrapt"]

# What packages are optional?
EXTRAS = {
Expand Down
8 changes: 4 additions & 4 deletions teslajsonpy/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ async def __open(
f'{data.get("error")}:{data.get("error_description")}'
)
except aiohttp.ClientResponseError as exception_:
raise TeslaException(exception_.status)
raise TeslaException(exception_.status) from exception_
return data

async def websocket_connect(self, vin: int, vehicle_id: int, **kwargs):
Expand Down Expand Up @@ -434,10 +434,10 @@ async def refresh_access_token(self, refresh_token):
"refresh_token": refresh_token,
"scope": "openid email offline_access",
}
auth = await self.__open(
"/oauth2/v3/token", "post", data=oauth, baseurl="https://auth.tesla.com",
auth = await self.websession.post(
"https://auth.tesla.com/oauth2/v3/token", data=oauth,
)
return auth
return await auth.json()

async def get_bearer_token(self, access_token):
"""Get bearer token. This is used by the owners API."""
Expand Down

0 comments on commit ec1f18e

Please sign in to comment.