From: Santiago Soto Date: Tue, 11 Jun 2024 10:14:12 +0000 (-0300) Subject: Refactor SnapCastProvider cmd_volume_set method (#1324) X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=deee077c16ba6010250d451130c50cadf00587cc;p=music-assistant-server.git Refactor SnapCastProvider cmd_volume_set method (#1324) --- diff --git a/music_assistant/server/providers/snapcast/__init__.py b/music_assistant/server/providers/snapcast/__init__.py index 9c636d21..352b8fad 100644 --- a/music_assistant/server/providers/snapcast/__init__.py +++ b/music_assistant/server/providers/snapcast/__init__.py @@ -318,9 +318,8 @@ class SnapCastProvider(PlayerProvider): async def cmd_volume_set(self, player_id: str, volume_level: int) -> None: """Send VOLUME_SET command to given player.""" snap_client_id = self._get_snapclient_id(player_id) - await self._snapserver.client_volume( - snap_client_id, {"percent": volume_level, "muted": volume_level == 0} - ) + await self._snapserver.client(snap_client_id).set_volume(volume_level) + self.mass.players.update(snap_client_id) async def cmd_stop(self, player_id: str) -> None: """Send STOP command to given player."""