From f7db7e326099971f982f823f8885c5cd5255ae02 Mon Sep 17 00:00:00 2001 From: Andrew Leech Date: Wed, 13 Mar 2024 20:04:02 +1100 Subject: [PATCH] Log system details json if parsing fails --- custom_components/magiqtouch/magiqtouch.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/custom_components/magiqtouch/magiqtouch.py b/custom_components/magiqtouch/magiqtouch.py index aeb1a2d..6e235ac 100644 --- a/custom_components/magiqtouch/magiqtouch.py +++ b/custom_components/magiqtouch/magiqtouch.py @@ -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}, @@ -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