diff --git a/homeassistant/components/media_player/snapcast.py b/homeassistant/components/media_player/snapcast.py index 793800a3d22..ca7ff17a16a 100644 --- a/homeassistant/components/media_player/snapcast.py +++ b/homeassistant/components/media_player/snapcast.py @@ -104,6 +104,11 @@ class SnapcastGroupDevice(MediaPlayerDevice): 'unknown': STATE_UNKNOWN, }.get(self._group.stream_status, STATE_UNKNOWN) + @property + def unique_id(self): + """Return the ID of snapcast group.""" + return '{}{}'.format(GROUP_PREFIX, self._group.identifier) + @property def name(self): """Return the name of the device.""" @@ -185,6 +190,11 @@ class SnapcastClientDevice(MediaPlayerDevice): client.set_callback(self.schedule_update_ha_state) self._client = client + @property + def unique_id(self): + """Return the ID of this snapcast client.""" + return '{}{}'.format(CLIENT_PREFIX, self._client.identifier) + @property def name(self): """Return the name of the device."""