mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Revert "Set volume_step in sonos media_player" (#106581)
Revert "Set volume_step in sonos media_player (#105671)" This reverts commit 6dc8c2c37014de201578b5cbe880f7a1bbcecfc4.
This commit is contained in:
parent
43384effcd
commit
fb280229c2
@ -67,6 +67,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
|
|
||||||
LONG_SERVICE_TIMEOUT = 30.0
|
LONG_SERVICE_TIMEOUT = 30.0
|
||||||
UNJOIN_SERVICE_TIMEOUT = 0.1
|
UNJOIN_SERVICE_TIMEOUT = 0.1
|
||||||
|
VOLUME_INCREMENT = 2
|
||||||
|
|
||||||
REPEAT_TO_SONOS = {
|
REPEAT_TO_SONOS = {
|
||||||
RepeatMode.OFF: False,
|
RepeatMode.OFF: False,
|
||||||
@ -211,7 +212,6 @@ class SonosMediaPlayerEntity(SonosEntity, MediaPlayerEntity):
|
|||||||
)
|
)
|
||||||
_attr_media_content_type = MediaType.MUSIC
|
_attr_media_content_type = MediaType.MUSIC
|
||||||
_attr_device_class = MediaPlayerDeviceClass.SPEAKER
|
_attr_device_class = MediaPlayerDeviceClass.SPEAKER
|
||||||
_attr_volume_step = 2 / 100
|
|
||||||
|
|
||||||
def __init__(self, speaker: SonosSpeaker) -> None:
|
def __init__(self, speaker: SonosSpeaker) -> None:
|
||||||
"""Initialize the media player entity."""
|
"""Initialize the media player entity."""
|
||||||
@ -373,6 +373,16 @@ class SonosMediaPlayerEntity(SonosEntity, MediaPlayerEntity):
|
|||||||
"""Name of the current input source."""
|
"""Name of the current input source."""
|
||||||
return self.media.source_name or None
|
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()
|
@soco_error()
|
||||||
def set_volume_level(self, volume: float) -> None:
|
def set_volume_level(self, volume: float) -> None:
|
||||||
"""Set volume level, range 0..1."""
|
"""Set volume level, range 0..1."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user