/
/
/
1"""
2Hue Lights Sync Plugin for Music Assistant.
3
4Syncs Philips Hue lights in Entertainment Areas to music using the
5Sendspin visualization pipeline and the Hue Entertainment API (DTLS streaming).
6
7Each Entertainment Area on a paired Hue bridge appears as a virtual player
8in Music Assistant. Playing music to the player activates entertainment mode
9and makes the lights react to the music in real time.
10"""
11
12from __future__ import annotations
13
14import logging
15from typing import TYPE_CHECKING
16
17LOGGER = logging.getLogger(__name__)
18
19if TYPE_CHECKING:
20 from music_assistant_models.config_entries import ProviderConfig
21 from music_assistant_models.enums import ProviderFeature
22 from music_assistant_models.provider import ProviderManifest
23
24 from music_assistant.mass import MusicAssistant
25 from music_assistant.models import ProviderInstanceType
26
27SUPPORTED_FEATURES: set[ProviderFeature] = set()
28
29
30async def setup(
31 mass: MusicAssistant,
32 manifest: ProviderManifest,
33 config: ProviderConfig,
34) -> ProviderInstanceType:
35 """Initialize provider(instance) with given configuration."""
36 from .provider import HueEntertainmentProvider # noqa: PLC0415
37
38 # bridge pairing (and thus the credentials) is handled by the setup flow; an
39 # instance only exists once pairing succeeded. A provider that somehow lacks
40 # credentials degrades to unavailable in loaded_in_mass rather than failing here.
41 return HueEntertainmentProvider(mass, manifest, config, SUPPORTED_FEATURES)
42