# 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"
"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",
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,
# 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
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.",