From ce22f3c82dd7d36c6b2fffa5860f91ad2ccbc58e Mon Sep 17 00:00:00 2001 From: Roy Hooper Date: Sun, 13 Sep 2015 16:52:15 -0400 Subject: [PATCH] Implement unique_id to prevent duplicate devices --- .../components/frontend/www_static/home-assistant-polymer | 2 +- homeassistant/components/media_player/sonos.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/frontend/www_static/home-assistant-polymer b/homeassistant/components/frontend/www_static/home-assistant-polymer index 9637d5d2651..b0b12e20e0f 160000 --- a/homeassistant/components/frontend/www_static/home-assistant-polymer +++ b/homeassistant/components/frontend/www_static/home-assistant-polymer @@ -1 +1 @@ -Subproject commit 9637d5d26516873b8a04a3c62b9596163c822a2d +Subproject commit b0b12e20e0f61df849c414c2dfbcf9923f784631 diff --git a/homeassistant/components/media_player/sonos.py b/homeassistant/components/media_player/sonos.py index 3deacd84e10..058a676ebc8 100644 --- a/homeassistant/components/media_player/sonos.py +++ b/homeassistant/components/media_player/sonos.py @@ -78,6 +78,11 @@ class SonosDevice(MediaPlayerDevice): """ Returns the name of the device. """ return self._name + @property + def unique_id(self): + """ Returns a unique id. """ + return "{}.{}".format(self.__class__, self._player.uid) + @property def state(self): """ Returns the state of the device. """