Set volume_step in sonos media_player (#105671)

pull/105647/head
Erik Montnemery 2023-12-13 19:40:51 +01:00 committed by GitHub
parent 5f69749420
commit 6dc8c2c370
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 11 deletions

View File

@ -67,7 +67,6 @@ _LOGGER = logging.getLogger(__name__)
LONG_SERVICE_TIMEOUT = 30.0
UNJOIN_SERVICE_TIMEOUT = 0.1
VOLUME_INCREMENT = 2
REPEAT_TO_SONOS = {
RepeatMode.OFF: False,
@ -212,6 +211,7 @@ class SonosMediaPlayerEntity(SonosEntity, MediaPlayerEntity):
)
_attr_media_content_type = MediaType.MUSIC
_attr_device_class = MediaPlayerDeviceClass.SPEAKER
_attr_volume_step = 2 / 100
def __init__(self, speaker: SonosSpeaker) -> None:
"""Initialize the media player entity."""
@ -373,16 +373,6 @@ class SonosMediaPlayerEntity(SonosEntity, MediaPlayerEntity):
"""Name of the current input source."""
return self.media.source_name or None
@soco_error()
def volume_up(self) -> None:
"""Volume up media player."""
self.soco.volume += VOLUME_INCREMENT
@soco_error()
def volume_down(self) -> None:
"""Volume down media player."""
self.soco.volume -= VOLUME_INCREMENT
@soco_error()
def set_volume_level(self, volume: float) -> None:
"""Set volume level, range 0..1."""