From ec1b1e6a8ea20f6933830e6b0fe97af0bb9e198b Mon Sep 17 00:00:00 2001 From: "Alan D. Tse" Date: Sat, 30 Jan 2021 19:19:41 -0800 Subject: [PATCH] style: fix lint error --- teslajsonpy/connection.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/teslajsonpy/connection.py b/teslajsonpy/connection.py index b9c64bd0..9143b141 100644 --- a/teslajsonpy/connection.py +++ b/teslajsonpy/connection.py @@ -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): @@ -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."""