1
mirror of https://github.com/home-assistant/core synced 2024-08-28 03:36:46 +02:00

Revert "Set volume_step in sonos media_player" (#106581)

Revert "Set volume_step in sonos media_player (#105671)"

This reverts commit 6dc8c2c370.
This commit is contained in:
Erik Montnemery 2023-12-28 19:48:34 +01:00 committed by GitHub
parent 43384effcd
commit fb280229c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,6 +67,7 @@ _LOGGER = logging.getLogger(__name__)
LONG_SERVICE_TIMEOUT = 30.0
UNJOIN_SERVICE_TIMEOUT = 0.1
VOLUME_INCREMENT = 2
REPEAT_TO_SONOS = {
RepeatMode.OFF: False,
@ -211,7 +212,6 @@ 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,6 +373,16 @@ 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."""