Numeric volume in HASS same as Soundbar - #11
Open
aabafra wants to merge 22 commits into
Open
Conversation
turning off still not working
fix typo
typo in device source selection
initial support for fetching radio info when listening to TuneIn
change MediaPlayerDevice to MediaPlayerEntity
Breaking change in HA with new version requirement for all custom components.
Update manifest.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
First of all, thanks a million for this great add-on. I really love it!
I use Alexa to control the soundbar thanks to your integration. However, if you put a max_volume parameter, I found difficult to accurate change the volume with my voice as I ordered a number and it calculates a different one as a multiple of the limit.
I made a small change to make it work as I wanted. I set a limit and if I ask for a greater number it just sets that limit. If I order any number under it, I get that exact volumen.
Please find attached the code.
The only chages are the following:
async def async_set_volume_level(self, volume):
"""Sets the volume level."""
newVolume = volume * 100 # * self._max_volume
#newVolume = min(volume,self._max_volume)*100
await self.api.set_volume(newVolume)
self._volume = volume
__
__
async def set_volume(self, volume):
await self._exec_set('UIC','SetVolume', 'volume', min(int(volume),40))
NOTE: I tried to put here the variable max_volume but didn't get it work so I put manually my desired real volumen limit as 40..
__
Once again, thanks for your great add-on.
media_player_modified.zip