diff --git a/custom_components/porscheconnect/binary_sensor.py b/custom_components/porscheconnect/binary_sensor.py index f0b7f0a..c5fb068 100644 --- a/custom_components/porscheconnect/binary_sensor.py +++ b/custom_components/porscheconnect/binary_sensor.py @@ -125,7 +125,7 @@ def __init__( self.coordinator = coordinator self.entity_description = description - self._attr_unique_id = f'{vehicle.data["name"]}-{description.key}' + self._attr_unique_id = f'{vehicle.vin}-{description.key}' @callback def _handle_coordinator_update(self) -> None: diff --git a/custom_components/porscheconnect/image.py b/custom_components/porscheconnect/image.py index fa8dae5..110fd19 100644 --- a/custom_components/porscheconnect/image.py +++ b/custom_components/porscheconnect/image.py @@ -99,7 +99,7 @@ def __init__( self.entity_description = description self._attr_content_type = CONTENT_TYPE - self._attr_unique_id = f'{vehicle.data["name"]}-{description.key}' + self._attr_unique_id = f'{vehicle.vin}-{description.key}' self._attr_image_url = vehicle.picture_locations[description.view] async def async_added_to_hass(self): diff --git a/custom_components/porscheconnect/lock.py b/custom_components/porscheconnect/lock.py index bc06d98..c88376c 100644 --- a/custom_components/porscheconnect/lock.py +++ b/custom_components/porscheconnect/lock.py @@ -48,7 +48,7 @@ def __init__( """Initialize the lock.""" super().__init__(coordinator, vehicle) - self._attr_unique_id = f'{vehicle.data["name"]}-lock' + self._attr_unique_id = f'{vehicle.vin}-lock' self.door_lock_state_available = vehicle.has_remote_services async def async_lock(self) -> None: diff --git a/custom_components/porscheconnect/number.py b/custom_components/porscheconnect/number.py index c70da3e..b6e773b 100644 --- a/custom_components/porscheconnect/number.py +++ b/custom_components/porscheconnect/number.py @@ -94,7 +94,7 @@ def __init__( super().__init__(coordinator, vehicle) self.entity_description = description - self._attr_unique_id = f"{vehicle.data['name']}-{description.key}" + self._attr_unique_id = f"{vehicle.vin}-{description.key}" @property def native_value(self) -> float | None: diff --git a/custom_components/porscheconnect/sensor.py b/custom_components/porscheconnect/sensor.py index ca76df6..59541cd 100644 --- a/custom_components/porscheconnect/sensor.py +++ b/custom_components/porscheconnect/sensor.py @@ -188,7 +188,7 @@ def __init__( super().__init__(coordinator, vehicle) self.entity_description = description - self._attr_unique_id = f"{vehicle.data['name']}-{description.key}" + self._attr_unique_id = f"{vehicle.vin}-{description.key}" @callback def _handle_coordinator_update(self) -> None: