/
/
1"""
2Spotify Connect plugin for Music Assistant.
3
4We tie a single player to a single Spotify Connect daemon.
5The provider has multi instance support, so multiple players can be linked to
6multiple Spotify Connect daemons.
7
8The MA-facing logic lives in ``provider.py``; everything specific to one
9Spotify Connect implementation (Spotify Soloist or go-librespot) lives behind the
10``SpotifyConnectBackend`` contract in ``base.py`` (one implementation per subdirectory).
11"""
12
13from __future__ import annotations
14
15from typing import TYPE_CHECKING
16
17from .provider import (
18 BACKEND_GO_LIBRESPOT,
19 BACKEND_SOLOIST,
20 CONF_API_KEY,
21 CONF_BACKEND,
22 CONF_MASS_PLAYER_ID,
23 CONF_PUBLISH_NAME,
24 CONF_SOLOIST_CONSENT,
25 CONF_VOLUME_MODE,
26 DEFAULT_PUBLISH_NAME,
27 PLAYER_ID_AUTO,
28 SUPPORTED_FEATURES,
29 VOLUME_MODE_OPTIONS,
30 SpotifyConnectProvider,
31)
32
33if TYPE_CHECKING:
34 from music_assistant_models.config_entries import ProviderConfig
35 from music_assistant_models.provider import ProviderManifest
36
37 from music_assistant.mass import MusicAssistant
38 from music_assistant.models import ProviderInstanceType
39
40__all__ = [
41 "BACKEND_GO_LIBRESPOT",
42 "BACKEND_SOLOIST",
43 "CONF_API_KEY",
44 "CONF_BACKEND",
45 "CONF_MASS_PLAYER_ID",
46 "CONF_PUBLISH_NAME",
47 "CONF_SOLOIST_CONSENT",
48 "CONF_VOLUME_MODE",
49 "DEFAULT_PUBLISH_NAME",
50 "PLAYER_ID_AUTO",
51 "SUPPORTED_FEATURES",
52 "VOLUME_MODE_OPTIONS",
53 "SpotifyConnectProvider",
54 "setup",
55]
56
57
58async def setup(
59 mass: MusicAssistant, manifest: ProviderManifest, config: ProviderConfig
60) -> ProviderInstanceType:
61 """Initialize provider(instance) with given configuration."""
62 return SpotifyConnectProvider(mass, manifest, config)
63