mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Fix duplicate lg_soundbar entities and disable polling (#42044)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
parent
6458ff774f
commit
a584ad5ac3
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user