Skip to content

Commit

Permalink
Log system details json if parsing fails
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewleech committed Mar 13, 2024
1 parent 278640b commit f7db7e3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions custom_components/magiqtouch/magiqtouch.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ async def login(self, hass=None):
## Get system data & MACADDRESS
try:
headers = await self._get_auth(self._IdToken)
redacted = None
async with self.httpsession.get(
ApiUrl + "devices/system",
headers=headers, # {"Authorization": self._cognito.id_token},
Expand All @@ -161,6 +162,8 @@ async def login(self, hass=None):

except Exception:
_LOGGER.exception("failed to query devices/system")
if redacted:
_LOGGER.error(f"Current System State: {json.dumps(redacted)}")
raise

self.logged_in = True
Expand Down

0 comments on commit f7db7e3

Please sign in to comment.