Skip to content

Commit 332996c

Browse files
peteS-UKballoob
authored andcommitted
Fix volume step error in Squeezebox media player (home-assistant#150760)
1 parent 199b7e8 commit 332996c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

homeassistant/components/squeezebox/media_player.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ async def async_will_remove_from_hass(self) -> None:
326326
def volume_level(self) -> float | None:
327327
"""Volume level of the media player (0..1)."""
328328
if self._player.volume is not None:
329-
return int(float(self._player.volume)) / 100.0
329+
return float(self._player.volume) / 100.0
330330

331331
return None
332332

@@ -435,7 +435,7 @@ async def async_turn_off(self) -> None:
435435

436436
async def async_set_volume_level(self, volume: float) -> None:
437437
"""Set volume level, range 0..1."""
438-
volume_percent = str(int(volume * 100))
438+
volume_percent = str(round(volume * 100))
439439
await self._player.async_set_volume(volume_percent)
440440
await self.coordinator.async_refresh()
441441

0 commit comments

Comments
 (0)