/
/
/
1"""Sync Group Player constants."""
2
3from __future__ import annotations
4
5from typing import Final
6
7from music_assistant_models.config_entries import ConfigEntry
8from music_assistant_models.enums import ConfigEntryType, PlayerFeature
9
10SGP_PREFIX: Final[str] = "syncgroup_"
11
12CONF_ENTRY_SGP_NOTE = ConfigEntry(
13 key="sgp_note",
14 type=ConfigEntryType.ALERT,
15 label="Sync groups allow you to group compatible players together to play audio in sync. "
16 "Players can only be grouped together if they support the same sync protocol",
17 required=False,
18)
19
20SUPPORT_DYNAMIC_LEADER = {
21 # providers that support dynamic leader selection in a syncgroup
22 # meaning that if you would remove the current leader from the group,
23 # the provider will automatically select a new leader from the remaining members
24 # and the music keeps playing uninterrupted.
25 "airplay",
26 "squeezelite",
27 "snapcast",
28 # TODO: Get this working with Sonos as well (need to handle range requests)
29}
30
31
32EXTRA_FEATURES_FROM_MEMBERS: Final[set[PlayerFeature]] = {
33 PlayerFeature.ENQUEUE,
34 PlayerFeature.GAPLESS_PLAYBACK,
35 PlayerFeature.VOLUME_SET,
36 PlayerFeature.VOLUME_MUTE,
37 PlayerFeature.MULTI_DEVICE_DSP,
38}
39