New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fallback lg_soundbar sound mode on unknown value #35892
Conversation
Hi @homeassistant, I fixed the cla-error. Do I nned to do something to get this label removed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it should be fixed in the library instead.
return temescal.equalisers[self._equaliser] | ||
|
||
@property | ||
def sound_mode_list(self): | ||
"""Return the available sound modes.""" | ||
modes = [] | ||
for equaliser in self._equalisers: | ||
if equaliser >= len(temescal.equalisers): | ||
temescal.equalisers.append("unknown " + str(equaliser)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Entity state properties should not have side effects. Please move this to eg update
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it should be fixed in the library instead.
I agree that it would be the optimum that it麓s handeled by the library.
But it麓s not the case and changing that would require changes in the lib as well as in this component.
This hacky approch is for sure not the optimum, but I麓m as a user prefer to have a equaliser setting named e.g.: "unknown 18" instead of not beeing able to select the setting at all.
Because the side effect is also that if I select the unknown setting using the lg app or the soundbars remote, in the lovelace dashboard I don麓t see any selected sound mode.
I made a PR in the librarys repro to fix the missing sound mode. If that get麓s accepted I would do another PR to there to handle that problem in the lib it麓s self. It just seems kind if inactive to me and I麓m not expecting too much.
Sorry writing half a book in this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's ok for now if we add a comment.
Proposed change
Make the "lg_soundbar" component crash free in case of equaliser settings that the temescal library does not know.
A issue has been created in the temescal repro to fix the unknown equaliser.
google/python-temescal#2
It麓s most likley that LG will extend the equalisers in their soundbar(s) in future again. This fix or something similar should be applied in order to prevent bad user experience in that case.
Type of change
Example entry for
configuration.yaml
:Additional information
Python Issue for Media_Player聽#35825
Error in homeassistant/components/lg_soundbar/media_player.py聽#32832
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale: