Skip to content

Commit

Permalink
Merge pull request #278 from CJNE/device-tracker-naming
Browse files Browse the repository at this point in the history
Avoid double naming of device tracker
  • Loading branch information
fredriklj authored Dec 19, 2024
2 parents 5038735 + 3a4022c commit 51ae5a6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion custom_components/porscheconnect/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ def __init__(
super().__init__(coordinator, vehicle)

self._attr_unique_id = vehicle.vin
self._attr_name = vehicle.model_name
if (
vehicle.data["customName"] != vehicle.model_name
and vehicle.data["customName"] is not None
):
self._attr_name = vehicle.data["customName"]
else:
self._attr_name = ""
self._tracking_enabled = True
self._attr_icon = "mdi:crosshairs-gps"

Expand Down

0 comments on commit 51ae5a6

Please sign in to comment.