From 1f276306df140373077ceb2f2ce1b5e3f4483303 Mon Sep 17 00:00:00 2001 From: Marvin Schenkel Date: Mon, 23 Feb 2026 08:18:53 +0100 Subject: [PATCH] Fix bluesound volume jumping back after volume_set. --- music_assistant/providers/bluesound/player.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/music_assistant/providers/bluesound/player.py b/music_assistant/providers/bluesound/player.py index 2086f343..4ae2cc39 100644 --- a/music_assistant/providers/bluesound/player.py +++ b/music_assistant/providers/bluesound/player.py @@ -25,7 +25,6 @@ from music_assistant.providers.bluesound.const import ( IDLE_POLL_INTERVAL, PLAYBACK_POLL_INTERVAL, PLAYBACK_STATE_MAP, - PLAYBACK_STATE_POLL_MAP, PLAYER_FEATURES_BASE, PLAYER_SOURCE_MAP, POLL_STATE_DYNAMIC, @@ -147,8 +146,10 @@ class BluesoundPlayer(Player): async def volume_set(self, volume_level: int) -> None: """Send VOLUME_SET command to BluOS player.""" - await self.client.volume(level=volume_level, timeout=1) - self.logger.debug("Set BluOS speaker volume to %s", volume_level) + volume_response = await self.client.volume(level=volume_level, timeout=1) + self.logger.debug( + "Set BluOS speaker volume to %s, response: %s", volume_level, volume_response + ) self._attr_volume_level = volume_level self._set_polling_dynamic() self.update_state() @@ -341,9 +342,7 @@ class BluesoundPlayer(Player): self.update_state() return - if ( - self.poll_state == POLL_STATE_DYNAMIC and self.dynamic_poll_count <= 0 - ) or self._attr_playback_state == PLAYBACK_STATE_POLL_MAP[self.status.state]: + if self.poll_state == POLL_STATE_DYNAMIC and self.dynamic_poll_count <= 0: self.logger.debug(f"Changing bluos poll state from {self.poll_state} to static") self.poll_state = POLL_STATE_STATIC @@ -374,6 +373,10 @@ class BluesoundPlayer(Player): self._attr_volume_level = self.sync_status.volume self._attr_volume_muted = self.status.mute + self.logger.debug( + f"Volume from sync_status: {self.sync_status.volume}, from status: {self.status.volume}" + ) + if not self.sync_status.leader: # Player not grouped or player is group leader if self.sync_status.followers: -- 2.34.1