Set volume_step in clementine media_player (#105666)
This commit is contained in:
parent
bb8dce6187
commit
36eeb15fee
1 changed files with 1 additions and 10 deletions
|
@ -65,6 +65,7 @@ class ClementineDevice(MediaPlayerEntity):
|
||||||
| MediaPlayerEntityFeature.SELECT_SOURCE
|
| MediaPlayerEntityFeature.SELECT_SOURCE
|
||||||
| MediaPlayerEntityFeature.PLAY
|
| MediaPlayerEntityFeature.PLAY
|
||||||
)
|
)
|
||||||
|
_attr_volume_step = 4 / 100
|
||||||
|
|
||||||
def __init__(self, client, name):
|
def __init__(self, client, name):
|
||||||
"""Initialize the Clementine device."""
|
"""Initialize the Clementine device."""
|
||||||
|
@ -123,16 +124,6 @@ class ClementineDevice(MediaPlayerEntity):
|
||||||
|
|
||||||
return None, None
|
return None, None
|
||||||
|
|
||||||
def volume_up(self) -> None:
|
|
||||||
"""Volume up the media player."""
|
|
||||||
newvolume = min(self._client.volume + 4, 100)
|
|
||||||
self._client.set_volume(newvolume)
|
|
||||||
|
|
||||||
def volume_down(self) -> None:
|
|
||||||
"""Volume down media player."""
|
|
||||||
newvolume = max(self._client.volume - 4, 0)
|
|
||||||
self._client.set_volume(newvolume)
|
|
||||||
|
|
||||||
def mute_volume(self, mute: bool) -> None:
|
def mute_volume(self, mute: bool) -> None:
|
||||||
"""Send mute command."""
|
"""Send mute command."""
|
||||||
self._client.set_volume(0)
|
self._client.set_volume(0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue