mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Widen songpal volume step change compatibility (#36152)
* Update songpal / media_player.py Based on issue https://github.com/home-assistant/core/issues/36135 * Update test_media_player.py
This commit is contained in:
parent
a7842b6301
commit
f14a4935df
@ -316,11 +316,11 @@ class SongpalEntity(MediaPlayerEntity):
|
||||
|
||||
async def async_volume_up(self):
|
||||
"""Set volume up."""
|
||||
return await self._volume_control.set_volume("+1")
|
||||
return await self._volume_control.set_volume(self._volume + 1)
|
||||
|
||||
async def async_volume_down(self):
|
||||
"""Set volume down."""
|
||||
return await self._volume_control.set_volume("-1")
|
||||
return await self._volume_control.set_volume(self._volume - 1)
|
||||
|
||||
async def async_turn_on(self):
|
||||
"""Turn the device on."""
|
||||
|
@ -156,9 +156,7 @@ async def test_services(hass):
|
||||
await _call(media_player.SERVICE_VOLUME_UP)
|
||||
await _call(media_player.SERVICE_VOLUME_DOWN)
|
||||
assert mocked_device.volume1.set_volume.call_count == 3
|
||||
mocked_device.volume1.set_volume.assert_has_calls(
|
||||
[call(60), call("+1"), call("-1")]
|
||||
)
|
||||
mocked_device.volume1.set_volume.assert_has_calls([call(60), call(51), call(49)])
|
||||
|
||||
await _call(media_player.SERVICE_VOLUME_MUTE, is_volume_muted=True)
|
||||
mocked_device.volume1.set_mute.assert_called_once_with(True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user