Skip to content

Commit

Permalink
hassagent-168
Browse files Browse the repository at this point in the history
  • Loading branch information
LAB02 Research committed Nov 3, 2022
1 parent 725b77e commit af0d3d0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions custom_components/hass_agent/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
| MediaPlayerEntityFeature.PLAY_MEDIA
| MediaPlayerEntityFeature.SEEK
| MediaPlayerEntityFeature.BROWSE_MEDIA
| MediaPlayerEntityFeature.VOLUME_SET
)


Expand Down Expand Up @@ -207,6 +208,11 @@ def available(self):
def volume_level(self):
"""Return the volume level of the media player (0..1)"""
return self._volume_level / 100.0

async def async_set_volume_level(self, volume: float) -> None:
"""Send new volume_level to device."""
volume = round(volume * 100)
await self._send_command("setvolume", volume)

@property
def is_volume_muted(self):
Expand Down

0 comments on commit af0d3d0

Please sign in to comment.