We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cfd081e commit 16959acCopy full SHA for 16959ac
1 file changed
pyhilo/oauth2.py
@@ -7,6 +7,7 @@
7
8
from homeassistant.helpers.aiohttp_client import async_create_clientsession
9
from aiohttp import CookieJar
10
+
11
from pyhilo.const import AUTH_AUTHORIZE, AUTH_CLIENT_ID, AUTH_TOKEN, DOMAIN
12
from pyhilo.oauth2helper import OAuth2Helper
13
@@ -61,12 +62,5 @@ async def _token_request(self, data: dict) -> dict:
61
62
data["client_secret"] = self.client_secret
63
64
resp = await self.session.post(self.token_url, data=data)
- if resp.status >= 400:
65
- try:
66
- error_response = await resp.json()
67
- except (ClientError, JSONDecodeError):
68
- error_response = {}
69
- error_code = error_response.get("error", "unknown")
70
- error_description = error_response.get("error_description", "unknown error")
71
resp.raise_for_status()
72
return cast(dict, await resp.json())
0 commit comments