mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Revert "Set volume_step in cmus media_player" (#106579)
Revert "Set volume_step in cmus media_player (#105667)" This reverts commit c10b460c6bf71cb0329dca991b7a09fc5cd963c4.
This commit is contained in:
parent
52cc6a1008
commit
744f06b5a8
@ -94,7 +94,6 @@ class CmusDevice(MediaPlayerEntity):
|
||||
| MediaPlayerEntityFeature.SEEK
|
||||
| MediaPlayerEntityFeature.PLAY
|
||||
)
|
||||
_attr_volume_step = 5 / 100
|
||||
|
||||
def __init__(self, device, name, server):
|
||||
"""Initialize the CMUS device."""
|
||||
@ -154,6 +153,30 @@ class CmusDevice(MediaPlayerEntity):
|
||||
"""Set volume level, range 0..1."""
|
||||
self._remote.cmus.set_volume(int(volume * 100))
|
||||
|
||||
def volume_up(self) -> None:
|
||||
"""Set the volume up."""
|
||||
left = self.status["set"].get("vol_left")
|
||||
right = self.status["set"].get("vol_right")
|
||||
if left != right:
|
||||
current_volume = float(left + right) / 2
|
||||
else:
|
||||
current_volume = left
|
||||
|
||||
if current_volume <= 100:
|
||||
self._remote.cmus.set_volume(int(current_volume) + 5)
|
||||
|
||||
def volume_down(self) -> None:
|
||||
"""Set the volume down."""
|
||||
left = self.status["set"].get("vol_left")
|
||||
right = self.status["set"].get("vol_right")
|
||||
if left != right:
|
||||
current_volume = float(left + right) / 2
|
||||
else:
|
||||
current_volume = left
|
||||
|
||||
if current_volume <= 100:
|
||||
self._remote.cmus.set_volume(int(current_volume) - 5)
|
||||
|
||||
def play_media(
|
||||
self, media_type: MediaType | str, media_id: str, **kwargs: Any
|
||||
) -> None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user