diff --git a/homeassistant/components/snapcast/media_player.py b/homeassistant/components/snapcast/media_player.py index 9dadae2e3e2..f0b6eccf8b4 100644 --- a/homeassistant/components/snapcast/media_player.py +++ b/homeassistant/components/snapcast/media_player.py @@ -160,7 +160,7 @@ class SnapcastGroupDevice(MediaPlayerEntity): self._attr_available = True self._group = group self._entry_id = entry_id - self._uid = f"{GROUP_PREFIX}{uid_part}_{self._group.identifier}" + self._attr_unique_id = f"{GROUP_PREFIX}{uid_part}_{self._group.identifier}" async def async_added_to_hass(self) -> None: """Subscribe to group events.""" @@ -184,11 +184,6 @@ class SnapcastGroupDevice(MediaPlayerEntity): return MediaPlayerState.IDLE return STREAM_STATUS.get(self._group.stream_status) - @property - def unique_id(self): - """Return the ID of snapcast group.""" - return self._uid - @property def identifier(self): """Return the snapcast identifier.""" @@ -260,7 +255,8 @@ class SnapcastClientDevice(MediaPlayerEntity): """Initialize the Snapcast client device.""" self._attr_available = True self._client = client - self._uid = f"{CLIENT_PREFIX}{uid_part}_{self._client.identifier}" + # Note: Host part is needed, when using multiple snapservers + self._attr_unique_id = f"{CLIENT_PREFIX}{uid_part}_{self._client.identifier}" self._entry_id = entry_id async def async_added_to_hass(self) -> None: @@ -278,14 +274,6 @@ class SnapcastClientDevice(MediaPlayerEntity): self._attr_available = available self.schedule_update_ha_state() - @property - def unique_id(self): - """Return the ID of this snapcast client. - - Note: Host part is needed, when using multiple snapservers - """ - return self._uid - @property def identifier(self): """Return the snapcast identifier."""