Implement unique_id to prevent duplicate devices
This commit is contained in:
1 parent
b0b88e606c
commit
ce22f3c82d
2 files changed
+6
-1
No files matched your search
@@ -78,6 +78,11 @@ class SonosDevice(MediaPlayerDevice):
|
|||||||
""" Returns the name of the device. """
|
""" Returns the name of the device. """
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def unique_id(self):
|
||||||
|
""" Returns a unique id. """
|
||||||
|
return "{}.{}".format(self.__class__, self._player.uid)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
""" Returns the state of the device. """
|
""" Returns the state of the device. """
|
||||||
|
|||||||
Reference in new issue
Block a user