From 84acb1b08d32ca883dbb0d2e22b0ac5c709c1592 Mon Sep 17 00:00:00 2001 From: coreywillwhat <104224685+coreywillwhat@users.noreply.github.com> Date: Tue, 23 Apr 2024 09:49:55 -0600 Subject: [PATCH 1/2] fix: Allow user to show raw position data in logs --- custom_components/audiconnect/audi_connect_account.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/custom_components/audiconnect/audi_connect_account.py b/custom_components/audiconnect/audi_connect_account.py index 260a0e8d..82748978 100644 --- a/custom_components/audiconnect/audi_connect_account.py +++ b/custom_components/audiconnect/audi_connect_account.py @@ -599,7 +599,14 @@ async def update_vehicle_position(self): redacted_vin, ) resp = await self._audi_service.get_stored_position(self._vehicle.vin) - + # To enable detailed logging of raw vehicle position data for debugging purposes: + # 1. Remove the '#' from the start of the _LOGGER.debug line below. + # 2. Save the file. + # 3. Restart Home Assistant to apply the changes. + # Note: This will log sensitive data. To stop logging this data: + # 1. Add the '#' back at the start of the _LOGGER.debug line. + # 2. Save the file and restart Home Assistant again. + #_LOGGER.debug("POSITION - UNREDACTED SENSITIVE DATA: Raw vehicle position data: %s", resp) if resp is not None: redacted_lat = re.sub(r"\d", "#", str(resp["data"]["lat"])) redacted_lon = re.sub(r"\d", "#", str(resp["data"]["lon"])) From 503bdafbfc70a88128f2a2a619b80b8b4412eca9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 15:54:15 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- custom_components/audiconnect/audi_connect_account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/audiconnect/audi_connect_account.py b/custom_components/audiconnect/audi_connect_account.py index 82748978..869b68e0 100644 --- a/custom_components/audiconnect/audi_connect_account.py +++ b/custom_components/audiconnect/audi_connect_account.py @@ -606,7 +606,7 @@ async def update_vehicle_position(self): # Note: This will log sensitive data. To stop logging this data: # 1. Add the '#' back at the start of the _LOGGER.debug line. # 2. Save the file and restart Home Assistant again. - #_LOGGER.debug("POSITION - UNREDACTED SENSITIVE DATA: Raw vehicle position data: %s", resp) + # _LOGGER.debug("POSITION - UNREDACTED SENSITIVE DATA: Raw vehicle position data: %s", resp) if resp is not None: redacted_lat = re.sub(r"\d", "#", str(resp["data"]["lat"])) redacted_lon = re.sub(r"\d", "#", str(resp["data"]["lon"]))