CONF_VERIFY_SSL: Final[str] = "verify_ssl"
CONF_SSL_FINGERPRINT: Final[str] = "ssl_fingerprint"
CONF_AUTH_ALLOW_SELF_REGISTRATION: Final[str] = "auth_allow_self_registration"
+CONF_ZEROCONF_INTERFACES: Final[str] = "zeroconf_interfaces"
CONF_ENABLED: Final[str] = "enabled"
# config default values
default_value=True,
category="sync_options",
)
+
+
+CONF_ENTRY_ZEROCONF_INTERFACES = ConfigEntry(
+ key=CONF_ZEROCONF_INTERFACES,
+ type=ConfigEntryType.STRING,
+ label="Mdns/Zeroconf discovery interface(s)",
+ description="In normal circumstances, Music Assistant will automatically "
+ "discover all players on the network using multicast discovery on the "
+ "(L2) local network, such as mDNS or UPNP.\n\n"
+ "By default, Music Assistant will only listen on the default interface. "
+ "If you have multiple network interfaces and you want to discover players "
+ "on all interfaces, you can change this setting to 'All interfaces'.",
+ options=[
+ ConfigValueOption("Default interface", "default"),
+ ConfigValueOption("All interfaces", "all"),
+ ],
+ default_value="default",
+ category="advanced",
+)
CONF_ENTRY_LIBRARY_SYNC_ALBUMS = ConfigEntry(
key="library_sync_albums",
type=ConfigEntryType.BOOLEAN,
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,
default_value="GLOBAL",
category="advanced",
),
+ CONF_ENTRY_ZEROCONF_INTERFACES,
)
async def setup(self, config: CoreConfig) -> None:
API_SCHEMA_VERSION,
CONF_PROVIDERS,
CONF_SERVER_ID,
+ CONF_ZEROCONF_INTERFACES,
CONFIGURABLE_CORE_CONTROLLERS,
MASS_LOGGER_NAME,
MIN_SCHEMA_VERSION,
self.loop_thread_id = getattr(self.loop, "_thread_id") # noqa: B009
self.running_as_hass_addon = await is_hass_supervisor()
self.version = await get_package_version("music_assistant") or "0.0.0"
+ # setup config controller first and fetch important config values
+ self.config = ConfigController(self)
+ await self.config.setup()
# create shared zeroconf instance
# TODO: enumerate interfaces and enable IPv6 support
- self.aiozc = AsyncZeroconf(ip_version=IPVersion.V4Only, interfaces=InterfaceChoice.Default)
+ zeroconf_interfaces = self.config.get_raw_core_config_value(
+ "streams", CONF_ZEROCONF_INTERFACES, "default"
+ )
+ self.aiozc = AsyncZeroconf(
+ ip_version=IPVersion.V4Only,
+ interfaces=InterfaceChoice.All
+ if zeroconf_interfaces == "all"
+ else InterfaceChoice.Default,
+ )
# load all available providers from manifest files
await self.__load_provider_manifests()
- # setup config controller first and fetch important config values
- self.config = ConfigController(self)
- await self.config.setup()
# setup/migrate storage
await self._setup_storage()
LOGGER.info(