Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Allow user to show raw position data in logs #407

Merged
merged 2 commits into from
Apr 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion custom_components/audiconnect/audi_connect_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]))
Expand Down