Skip to content

Commit

Permalink
doctweak
Browse files Browse the repository at this point in the history
  • Loading branch information
zxdavb committed Jan 4, 2025
1 parent f66bc91 commit 314c05e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/evohomeasync/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ async def _get_config(self) -> list[EvoTcsInfoDictT]:
self._user_info = await self.auth.get(url, schema=SCH_GET_ACCOUNT_INFO) # type: ignore[assignment]

except exc.ApiRequestFailedError as err: # check if 401 - bad session_id
# as the accountInfo URL is open to all authenticated users, any 401 is
# due the (albeit valid) session_id being rejected by the server (why?)

if err.status != HTTPStatus.UNAUTHORIZED: # 401
raise

# as the accountInfo URL is open to all authenticated users, any 401 is
# due the (albeit valid) session_id being rejected by the server (why?)

self.logger.warning(
f"The session_id appears invalid (will re-authenticate): {err}"
)
Expand Down
6 changes: 3 additions & 3 deletions src/evohomeasync2/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ async def _get_config(
self._user_info = await self.auth.get(url, schema=SCH_USER_ACCOUNT) # type: ignore[assignment]

except exc.ApiRequestFailedError as err: # check if 401 - bad access_token
# as the userAccount URL is open to all authenticated users, any 401 is
# due the (albeit valid) access_token being rejected by the server (why?)

if err.status != HTTPStatus.UNAUTHORIZED: # 401
raise

# as the userAccount URL is open to all authenticated users, any 401 is
# due the (albeit valid) access_token being rejected by the server (why?)

self.logger.warning(
f"The access_token appears invalid (will re-authenticate): {err}"
)
Expand Down

0 comments on commit 314c05e

Please sign in to comment.