Disable Zone Handling if needed for MusicCast players (#2650)
authorFabian Munkes <105975993+fmunkes@users.noreply.github.com>
Fri, 21 Nov 2025 14:10:51 +0000 (15:10 +0100)
committerGitHub <noreply@github.com>
Fri, 21 Nov 2025 14:10:51 +0000 (15:10 +0100)
* disable zone handling if desired

* bump lib

* wording

---------

Co-authored-by: OzGav <gavnosp@hotmail.com>
music_assistant/providers/musiccast/constants.py
music_assistant/providers/musiccast/manifest.json
music_assistant/providers/musiccast/player.py
requirements_all.txt

index b85930cedfc4878ed9b98e5b0a972d944a0fd7ca..f680ef88c69a4869f2c1909d8ad00c699b385e57 100644 (file)
@@ -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"
index 803ffbee4e4c921d3cf313bf0ab696868372f238..14fbabc20110c965602faaaadcee27d856a3bfd9 100644 (file)
@@ -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",
index 33feb82552c13b9337218feceda74d8a391d5b36..d0270837889cd51048f048c482730815004bb005 100644 (file)
@@ -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.",
index 15ccfb25e7fbf57977e9a7a463b54bad059614c3..6925af5d98832f84af2599812ad4cab22a8eae09 100644 (file)
@@ -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