Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
Erik
587292ada2 Refresh after setting volume 2023-12-19 13:46:54 +01:00
Erik
c085782a16 Set volume_step in braviatv media_player 2023-12-18 10:53:29 +01:00
2 changed files with 2 additions and 18 deletions

View file

@ -260,16 +260,6 @@ class BraviaTVCoordinator(DataUpdateCoordinator[None]):
"""Set volume level, range 0..1."""
await self.client.volume_level(round(volume * 100))
@catch_braviatv_errors
async def async_volume_up(self) -> None:
"""Send volume up command to device."""
await self.client.volume_up()
@catch_braviatv_errors
async def async_volume_down(self) -> None:
"""Send volume down command to device."""
await self.client.volume_down()
@catch_braviatv_errors
async def async_volume_mute(self, mute: bool) -> None:
"""Send mute command to device."""

View file

@ -58,6 +58,7 @@ class BraviaTVMediaPlayer(BraviaTVEntity, MediaPlayerEntity):
| MediaPlayerEntityFeature.PLAY_MEDIA
| MediaPlayerEntityFeature.BROWSE_MEDIA
)
_attr_volume_step = 1 / 100
@property
def state(self) -> MediaPlayerState:
@ -122,14 +123,7 @@ class BraviaTVMediaPlayer(BraviaTVEntity, MediaPlayerEntity):
async def async_set_volume_level(self, volume: float) -> None:
"""Set volume level, range 0..1."""
await self.coordinator.async_set_volume_level(volume)
async def async_volume_up(self) -> None:
"""Send volume up command."""
await self.coordinator.async_volume_up()
async def async_volume_down(self) -> None:
"""Send volume down command."""
await self.coordinator.async_volume_down()
await self.coordinator.async_refresh()
async def async_mute_volume(self, mute: bool) -> None:
"""Send mute command."""