1
mirror of https://github.com/home-assistant/core synced 2024-10-10 12:28:01 +02:00

Revert "Set volume_step in enigma2 media_player" (#106584)

This commit is contained in:
Erik Montnemery 2023-12-28 21:08:16 +01:00 committed by GitHub
parent 67629111f9
commit 90744b0a8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -119,7 +119,6 @@ class Enigma2Device(MediaPlayerEntity):
| MediaPlayerEntityFeature.PAUSE
| MediaPlayerEntityFeature.SELECT_SOURCE
)
_attr_volume_step = 5 / 100
def __init__(self, name: str, device: OpenWebIfDevice, about: dict) -> None:
"""Initialize the Enigma2 device."""
@ -141,6 +140,18 @@ class Enigma2Device(MediaPlayerEntity):
"""Set volume level, range 0..1."""
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:
"""Send stop command."""
await self._device.send_remote_control_action(RemoteControlCodes.STOP)