Skip to content

Commit

Permalink
Merge pull request #132 from Robbe-B/unhandledexception
Browse files Browse the repository at this point in the history
Fix unexpected error fetching MCZ Stove data
  • Loading branch information
Robbe-B authored Apr 19, 2024
2 parents a609434 + 7300dc1 commit a06a855
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ async def Login(self):
headers["tenantid"] = "7c201fd8-42bd-4333-914d-0f5822070757"

async with aiohttp.ClientSession() as session:
async with session.post(
LOGIN_URL, json=LOGIN_BODY, headers=headers
) as resp:
response = await resp.json()
self._token = response["Token"]
self._connected = True
async with session.post(LOGIN_URL, json=LOGIN_BODY, headers=headers) as resp:
if resp is not None:
response = await resp.json()
if "Token" in response:
self._token = response["Token"]
self._connected = True

await self.StoveInfo()

Expand Down

0 comments on commit a06a855

Please sign in to comment.