From ffa93d09ace9558d07ce7e2db44e2c717968d897 Mon Sep 17 00:00:00 2001 From: Fabian Munkes <105975993+fmunkes@users.noreply.github.com> Date: Fri, 21 Nov 2025 15:10:51 +0100 Subject: [PATCH] Disable Zone Handling if needed for MusicCast players (#2650) * disable zone handling if desired * bump lib * wording --------- Co-authored-by: OzGav --- .../providers/musiccast/constants.py | 1 + .../providers/musiccast/manifest.json | 2 +- music_assistant/providers/musiccast/player.py | 21 +++++++++++++++++++ requirements_all.txt | 3 +-- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/music_assistant/providers/musiccast/constants.py b/music_assistant/providers/musiccast/constants.py index b85930ce..f680ef88 100644 --- a/music_assistant/providers/musiccast/constants.py +++ b/music_assistant/providers/musiccast/constants.py @@ -22,6 +22,7 @@ PLAYER_ZONE_SPLITTER = "___" # must be url ok # Switch to these non netusb sources when leaving a group as a dev # with multiple zones. Optionally turn device off. +CONF_PLAYER_HANDLE_SOURCE_DISABLED = "handle_source_allowed" CONF_PLAYER_SWITCH_SOURCE_NON_NET = "main_switch_source" CONF_PLAYER_TURN_OFF_ON_LEAVE = "turn_off_on_leave" MAIN_SWITCH_SOURCE_NON_NET = "audio1" diff --git a/music_assistant/providers/musiccast/manifest.json b/music_assistant/providers/musiccast/manifest.json index 803ffbee..14fbabc2 100644 --- a/music_assistant/providers/musiccast/manifest.json +++ b/music_assistant/providers/musiccast/manifest.json @@ -4,7 +4,7 @@ "stage": "stable", "name": "MusicCast", "description": "Stream audio to Yamaha MusicCast speakers — supports multiroom playback.", - "requirements": ["aiomusiccast==0.14.8", "setuptools>=1.0.0"], + "requirements": ["aiomusiccast==0.15.0"], "codeowners": ["@fmunkes"], "mdns_discovery": ["_http._tcp.local."], "documentation": "https://music-assistant.io/player-support/musiccast", diff --git a/music_assistant/providers/musiccast/player.py b/music_assistant/providers/musiccast/player.py index 33feb825..d0270837 100644 --- a/music_assistant/providers/musiccast/player.py +++ b/music_assistant/providers/musiccast/player.py @@ -26,6 +26,7 @@ from music_assistant.providers.musiccast.avt_helpers import ( search_xml, ) from music_assistant.providers.musiccast.constants import ( + CONF_PLAYER_HANDLE_SOURCE_DISABLED, CONF_PLAYER_SWITCH_SOURCE_NON_NET, CONF_PLAYER_TURN_OFF_ON_LEAVE, MC_CONTROL_SOURCE_IDS, @@ -328,6 +329,15 @@ class MusicCastPlayer(Player): # this is not this player's id player_id = self._get_player_id_from_zone_device(zone_player) assert player_id is not None # for TYPE_CHECKING + + # skip zone handling if disabled. + if bool( + await self.mass.config.get_player_config_value( + player_id, CONF_PLAYER_HANDLE_SOURCE_DISABLED + ) + ): + return + _source = str( await self.mass.config.get_player_config_value( player_id, CONF_PLAYER_SWITCH_SOURCE_NON_NET @@ -610,6 +620,17 @@ class MusicCastPlayer(Player): zone_entries = [] else: zone_entries = [ + ConfigEntry( + key=CONF_PLAYER_HANDLE_SOURCE_DISABLED, + type=ConfigEntryType.BOOLEAN, + label="Disable zone handling completely.", + default_value=False, + description="This disables zone handling completely. Other options " + "will be ignored. Enable should you encounter playback issues while " + "e.g. playing to main. You can also hide the player from the UI " + "by taking advantage of 'Hide the player in the user interface' " + "dropdown.", + ), ConfigEntry( key=CONF_PLAYER_SWITCH_SOURCE_NON_NET, label="Switch to this non-net source when leaving a group.", diff --git a/requirements_all.txt b/requirements_all.txt index 15ccfb25..6925af5d 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -8,7 +8,7 @@ aiohttp==3.13.1 aiohttp_asyncmdnsresolver==0.1.1 aiohttp-fast-zlib==0.3.0 aiojellyfin==0.14.1 -aiomusiccast==0.14.8 +aiomusiccast==0.15.0 aioresonate==0.13.1 aiorun==2025.1.1 aioslimproto==3.1.1 @@ -55,7 +55,6 @@ python-slugify==8.0.4 pywidevine==1.8.0 radios==0.3.2 rokuecp==0.19.5 -setuptools>=1.0.0 shortuuid==1.0.13 snapcast==2.3.7 soco==0.30.12 -- 2.34.1