mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
Revert "Set volume_step in enigma2 media_player" (#106584)
This commit is contained in:
parent
9de482f429
commit
2ffb033a46
@ -119,7 +119,6 @@ class Enigma2Device(MediaPlayerEntity):
|
|||||||
| MediaPlayerEntityFeature.PAUSE
|
| MediaPlayerEntityFeature.PAUSE
|
||||||
| MediaPlayerEntityFeature.SELECT_SOURCE
|
| MediaPlayerEntityFeature.SELECT_SOURCE
|
||||||
)
|
)
|
||||||
_attr_volume_step = 5 / 100
|
|
||||||
|
|
||||||
def __init__(self, name: str, device: OpenWebIfDevice, about: dict) -> None:
|
def __init__(self, name: str, device: OpenWebIfDevice, about: dict) -> None:
|
||||||
"""Initialize the Enigma2 device."""
|
"""Initialize the Enigma2 device."""
|
||||||
@ -141,6 +140,18 @@ class Enigma2Device(MediaPlayerEntity):
|
|||||||
"""Set volume level, range 0..1."""
|
"""Set volume level, range 0..1."""
|
||||||
await self._device.set_volume(int(volume * 100))
|
await self._device.set_volume(int(volume * 100))
|
||||||
|
|
||||||
|
async def async_volume_up(self) -> None:
|
||||||
|
"""Volume up the media player."""
|
||||||
|
if self._attr_volume_level is None:
|
||||||
|
return
|
||||||
|
await self._device.set_volume(int(self._attr_volume_level * 100) + 5)
|
||||||
|
|
||||||
|
async def async_volume_down(self) -> None:
|
||||||
|
"""Volume down media player."""
|
||||||
|
if self._attr_volume_level is None:
|
||||||
|
return
|
||||||
|
await self._device.set_volume(int(self._attr_volume_level * 100) - 5)
|
||||||
|
|
||||||
async def async_media_stop(self) -> None:
|
async def async_media_stop(self) -> None:
|
||||||
"""Send stop command."""
|
"""Send stop command."""
|
||||||
await self._device.send_remote_control_action(RemoteControlCodes.STOP)
|
await self._device.send_remote_control_action(RemoteControlCodes.STOP)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user