B5r1oJ0A9G / teufel_raumfeld

Integration for Teufel smart speaker (aka Raumfeld Multiroom) into https://www.home-assistant.io/.
GNU General Public License v3.0
33 stars 7 forks source link

Volume goes up at media_player.volume_down #54

Closed balk77 closed 2 months ago

balk77 commented 1 year ago

Hi, it seems that volume is going up at media_player.volume_down instead of down. Could this be the issue? First DEFAULT_CHANGE_STEP_VOLUME_DOWN is set to -2 and subsequently it is multiplied with -1, rendering a positive number. Just tested it and it seems to work when the -1 is removed.

https://github.com/B5r1oJ0A9G/teufel_raumfeld/blob/8e0f9fbdbf762b84f9406de881c539fde00cd927/custom_components/teufel_raumfeld/const.py#L6

https://github.com/B5r1oJ0A9G/teufel_raumfeld/blob/8e0f9fbdbf762b84f9406de881c539fde00cd927/custom_components/teufel_raumfeld/media_player.py#L647

B5r1oJ0A9G commented 1 year ago

Hi, maybe this is a duplicate of #52 which is fixed in the current master branch. Can you please check with the master branch and report back if it can be repruduced there?

gormed commented 10 months ago

I am using version v0.1.15-alpha3, installed via HACS and I have the same issue (using the media control component).


Fixed it like above, removing the -1 in /root/homeassistant/custom_components/teufel_raumfeld/media_player.py - searched for OPTION_CHANGE_STEP_VOLUME_DOWN to get to the line.

B5r1oJ0A9G commented 4 months ago

Menionted fix of #52 is now released with version 0.1.16-alpha1. On my side I could not reproduce the error. Can you please check whether the problem still exists with 0.1.16-alpha1?

mathebox commented 2 months ago

I did run into this bug using version 0.1.16-alpha1. So I also took a look at the code.

As it turns out, removing the multiplication with -1 as suggested above will not provide an adequate fix for this issue. This only works in combination with a negative value for OPTION_CHANGE_STEP_VOLUME_DOWN. As soon as you change the step value in the config panel of the integration, it will be a positive integer (enforced by the config flow), then everything works as expected and you can't reproduce the bug anymore.

Hence, the value of DEFAULT_CHANGE_STEP_VOLUME_DOWN should be adjusted. I will prepare a PR 😉