CONF_ENTRY_ANNOUNCE_VOLUME_MIN,
CONF_ENTRY_ANNOUNCE_VOLUME_STRATEGY,
CONF_ENTRY_TTS_PRE_ANNOUNCE,
+ CONF_ENTRY_ZEROCONF_INTERFACES,
CONF_PLAYER_DSP,
CONF_PLAYERS,
CONF_PRE_ANNOUNCE_CHIME_URL,
if TYPE_CHECKING:
from collections.abc import Iterator
- from music_assistant_models.config_entries import CoreConfig, PlayerConfig
+ from music_assistant_models.config_entries import (
+ ConfigEntry,
+ ConfigValueType,
+ CoreConfig,
+ PlayerConfig,
+ )
from music_assistant_models.player_queue import PlayerQueue
from music_assistant import MusicAssistant
self._player_command_locks: dict[str, asyncio.Lock] = {}
self._sync_groups: SyncGroupController = SyncGroupController(self)
+ async def get_config_entries(
+ self,
+ action: str | None = None,
+ values: dict[str, ConfigValueType] | None = None,
+ ) -> tuple[ConfigEntry, ...]:
+ """Return Config Entries for the Player Controller."""
+ return (CONF_ENTRY_ZEROCONF_INTERFACES,)
+
async def setup(self, config: CoreConfig) -> None:
"""Async initialize of module."""
self._poll_task = self.mass.create_task(self._poll_players())
CONF_ENTRY_ENABLE_ICY_METADATA,
CONF_ENTRY_LOG_LEVEL,
CONF_ENTRY_SUPPORT_GAPLESS_DIFFERENT_SAMPLE_RATES,
- CONF_ENTRY_ZEROCONF_INTERFACES,
CONF_HTTP_PROFILE,
CONF_OUTPUT_CHANNELS,
CONF_OUTPUT_CODEC,
category="generic",
advanced=True,
),
- CONF_ENTRY_ZEROCONF_INTERFACES,
)
async def setup(self, config: CoreConfig) -> None:
await self.config.setup()
# create shared zeroconf instance
zeroconf_interfaces = self.config.get_raw_core_config_value(
- "streams", CONF_ZEROCONF_INTERFACES, "default"
+ "players", CONF_ZEROCONF_INTERFACES, "default"
)
+ # IPv6 requires InterfaceChoice.All, so only enable when zeroconf_interfaces is "all"
+ use_all_interfaces = zeroconf_interfaces == "all"
self.aiozc = AsyncZeroconf(
- ip_version=IPVersion.All,
- interfaces=InterfaceChoice.All
- if zeroconf_interfaces == "all"
- else InterfaceChoice.Default,
+ ip_version=IPVersion.All if use_all_interfaces else IPVersion.V4Only,
+ interfaces=InterfaceChoice.All if use_all_interfaces else InterfaceChoice.Default,
)
# load all available providers from manifest files
await self.__load_provider_manifests()