Revert "Set volume_step in bluesound media_player" (#106582)

Revert "Set volume_step in bluesound media_player (#105672)"

This reverts commit 7fa55ffdd2.
pull/106970/head
Erik Montnemery 2023-12-28 19:54:51 +01:00 committed by Bram Kragten
parent 35b9044187
commit 5125d8622d
1 changed files with 14 additions and 1 deletions

View File

@ -200,7 +200,6 @@ class BluesoundPlayer(MediaPlayerEntity):
"""Representation of a Bluesound Player.""" """Representation of a Bluesound Player."""
_attr_media_content_type = MediaType.MUSIC _attr_media_content_type = MediaType.MUSIC
_attr_volume_step = 0.01
def __init__(self, hass, host, port=None, name=None, init_callback=None): def __init__(self, hass, host, port=None, name=None, init_callback=None):
"""Initialize the media player.""" """Initialize the media player."""
@ -1028,6 +1027,20 @@ class BluesoundPlayer(MediaPlayerEntity):
return await self.send_bluesound_command(url) return await self.send_bluesound_command(url)
async def async_volume_up(self) -> None:
"""Volume up the media player."""
current_vol = self.volume_level
if not current_vol or current_vol >= 1:
return
return await self.async_set_volume_level(current_vol + 0.01)
async def async_volume_down(self) -> None:
"""Volume down the media player."""
current_vol = self.volume_level
if not current_vol or current_vol <= 0:
return
return await self.async_set_volume_level(current_vol - 0.01)
async def async_set_volume_level(self, volume: float) -> None: async def async_set_volume_level(self, volume: float) -> None:
"""Send volume_up command to media player.""" """Send volume_up command to media player."""
if volume < 0: if volume < 0: