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 wirelesstag unique_id to use uuid instead of tag_id #104394

Merged
merged 12 commits into from
Nov 30, 2023
Merged
2 changes: 1 addition & 1 deletion homeassistant/components/wirelesstag/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def __init__(self, api, tag, sensor_type):
super().__init__(api, tag)
self._sensor_type = sensor_type
self._name = f"{self._tag.name} {self.event.human_readable_name}"
self._attr_unique_id = f"{self.tag_id}_{self._sensor_type}"
frenck marked this conversation as resolved.
Show resolved Hide resolved
self._attr_unique_id = f"{self._uuid}_{self._sensor_type}"

async def async_added_to_hass(self) -> None:
"""Register callbacks."""
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/wirelesstag/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def __init__(self, api, tag, description):
self._sensor_type = description.key
self.entity_description = description
self._name = self._tag.name
self._attr_unique_id = f"{self.tag_id}_{self._sensor_type}"
self._attr_unique_id = f"{self._uuid}_{self._sensor_type}"

# I want to see entity_id as:
# sensor.wirelesstag_bedroom_temperature
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/wirelesstag/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def __init__(self, api, tag, description: SwitchEntityDescription) -> None:
super().__init__(api, tag)
self.entity_description = description
self._name = f"{self._tag.name} {description.name}"
self._attr_unique_id = f"{self.tag_id}_{description.key}"
self._attr_unique_id = f"{self._uuid}_{description.key}"

def turn_on(self, **kwargs: Any) -> None:
"""Turn on the switch."""
Expand Down