1
mirror of https://github.com/home-assistant/core synced 2024-10-04 07:58:43 +02:00

Add check and remove temporary fix for lg soundbar eq and source list (#38798)

This commit is contained in:
Berni Moses 2021-01-27 10:17:04 +01:00 committed by GitHub
parent c225f4b4ea
commit 491e66793e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,11 +121,6 @@ class LGDevice(MediaPlayerEntity):
self._device.get_settings()
self._device.get_product_info()
# Temporary fix until handling of unknown equaliser settings is integrated in the temescal library
for equaliser in self._equalisers:
if equaliser >= len(temescal.equalisers):
temescal.equalisers.append("unknown " + str(equaliser))
@property
def unique_id(self):
"""Return the device's unique ID."""
@ -171,7 +166,7 @@ class LGDevice(MediaPlayerEntity):
@property
def source(self):
"""Return the current input source."""
if self._function == -1:
if self._function == -1 or self._function >= len(temescal.functions):
return None
return temescal.functions[self._function]