Skip to content

Commit

Permalink
Merge pull request #85 from gjohansson-ST/fix_coordinator
Browse files Browse the repository at this point in the history
Fix coordinator
  • Loading branch information
gjohansson-ST authored Jun 11, 2022
2 parents 30dbc8d + acaef1f commit 6474cda
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions custom_components/sector/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ async def _request(
LOGGER.debug("request status: %s", response.status)

output: dict | list = await response.json()
return output

except aiohttp.ContentTypeError as error:
text = await response.text()
Expand All @@ -258,12 +259,10 @@ async def _request(
error,
exc_info=True,
)
if "unauthorized" in str(error.args[0]).lower():
if "unauthorized" in error.message.lower():
raise ConfigEntryAuthFailed from error
raise UpdateFailed from error

return output

async def _login(self) -> None:
"""Login to retrieve access token."""
try:
Expand Down

0 comments on commit 6474cda

Please sign in to comment.