Home Assistant Unofficial Reference 2024.12.1
const.py
Go to the documentation of this file.
1 """Define constants for the Spotify integration."""
2 
3 import logging
4 
5 from homeassistant.components.media_player import MediaType
6 
7 DOMAIN = "spotify"
8 
9 LOGGER = logging.getLogger(__package__)
10 
11 SPOTIFY_SCOPES = [
12  # Needed to be able to control playback
13  "user-modify-playback-state",
14  # Needed in order to read available devices
15  "user-read-playback-state",
16  # Needed to determine if the user has Spotify Premium
17  "user-read-private",
18  # Needed for media browsing
19  "playlist-read-private",
20  "playlist-read-collaborative",
21  "user-library-read",
22  "user-top-read",
23  "user-read-playback-position",
24  "user-read-recently-played",
25  "user-follow-read",
26 ]
27 
28 MEDIA_PLAYER_PREFIX = "spotify://"
29 MEDIA_TYPE_SHOW = "show"
30 
31 PLAYABLE_MEDIA_TYPES = [
32  MediaType.PLAYLIST,
33  MediaType.ALBUM,
34  MediaType.ARTIST,
35  MediaType.EPISODE,
36  MEDIA_TYPE_SHOW,
37  MediaType.TRACK,
38 ]