Fix duplicate lg_soundbar entities and disable polling (#42044)

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
Berni Moses 2021-02-03 17:06:02 +01:00 committed by GitHub
parent 6458ff774f
commit a584ad5ac3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,12 +29,11 @@ class LGDevice(MediaPlayerEntity):
def __init__(self, discovery_info):
"""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._host = discovery_info["host"]
self._port = discovery_info["port"]
self._hostname = discovery_info["hostname"]
self._name = ""
self._name = self._hostname.split(".")[0]
self._volume = 0
self._volume_min = 0
self._volume_max = 0
@ -122,9 +121,9 @@ class LGDevice(MediaPlayerEntity):
self._device.get_product_info()
@property
def unique_id(self):
"""Return the device's unique ID."""
return self._uuid
def should_poll(self):
"""No polling needed."""
return False
@property
def name(self):