mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Fallback lg_soundbar sound mode on unknown value (#35892)
* fallback if equaliser setting unknown to temescal * fallback if equaliser setting unknown to temescal Change Author * fix return values, moved fallback code * add comment to temporary fix
This commit is contained in:
parent
654195454b
commit
2793e6cdd8
@ -114,6 +114,11 @@ class LGDevice(MediaPlayerEntity):
|
|||||||
self._device.get_settings()
|
self._device.get_settings()
|
||||||
self._device.get_product_info()
|
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
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
"""Return the name of the device."""
|
"""Return the name of the device."""
|
||||||
@ -139,9 +144,8 @@ class LGDevice(MediaPlayerEntity):
|
|||||||
@property
|
@property
|
||||||
def sound_mode(self):
|
def sound_mode(self):
|
||||||
"""Return the current sound mode."""
|
"""Return the current sound mode."""
|
||||||
|
if self._equaliser == -1 or self._equaliser >= len(temescal.equalisers):
|
||||||
if self._equaliser == -1:
|
return None
|
||||||
return ""
|
|
||||||
return temescal.equalisers[self._equaliser]
|
return temescal.equalisers[self._equaliser]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -156,7 +160,7 @@ class LGDevice(MediaPlayerEntity):
|
|||||||
def source(self):
|
def source(self):
|
||||||
"""Return the current input source."""
|
"""Return the current input source."""
|
||||||
if self._function == -1:
|
if self._function == -1:
|
||||||
return ""
|
return None
|
||||||
return temescal.functions[self._function]
|
return temescal.functions[self._function]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user