Skip to content
Snippets Groups Projects
Unverified Commit 76b46b91 authored by Matthew Garrett's avatar Matthew Garrett Committed by GitHub
Browse files

Provide a unique entity ID for lgsoundbar (#38494)

The device gives us a UUID, so let's just use that to construct a unique
ID.
parent 542c6cce
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,8 @@ class LGDevice(MediaPlayerEntity):
"""Initialize the LG speakers."""
self._host = discovery_info.get("host")
self._port = discovery_info.get("port")
properties = discovery_info.get("properties")
self._uuid = properties.get("UUID")
self._name = ""
self._volume = 0
......@@ -128,6 +130,11 @@ class LGDevice(MediaPlayerEntity):
if equaliser >= len(temescal.equalisers):
temescal.equalisers.append("unknown " + str(equaliser))
@property
def unique_id(self):
"""Return the device's unique ID."""
return self._uuid
@property
def name(self):
"""Return the name of the device."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment