Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.spotify.media_player Namespace Reference

Classes

class  SpotifyMediaPlayer
 

Functions

Callable[[SpotifyMediaPlayer], _R|None] _R (Callable[[SpotifyMediaPlayer, Item], _R] func)
 
def _T
 
None async_setup_entry (HomeAssistant hass, SpotifyConfigEntry entry, AddEntitiesCallback async_add_entities)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
int AFTER_REQUEST_SLEEP = 1
 
dictionary REPEAT_MODE_MAPPING_TO_HA
 
dictionary REPEAT_MODE_MAPPING_TO_SPOTIFY
 
tuple SUPPORT_SPOTIFY
 

Detailed Description

Support for interacting with Spotify Connect.

Function Documentation

◆ _R()

Callable[[SpotifyMediaPlayer], _R | None] homeassistant.components.spotify.media_player._R ( Callable[[SpotifyMediaPlayer, Item], _R]  func)
private
Ensure that the currently playing item is available.

Definition at line 85 of file media_player.py.

◆ _T()

def homeassistant.components.spotify.media_player._T
private

Definition at line 98 of file media_player.py.

◆ async_setup_entry()

None homeassistant.components.spotify.media_player.async_setup_entry ( HomeAssistant  hass,
SpotifyConfigEntry  entry,
AddEntitiesCallback  async_add_entities 
)
Set up Spotify based on a config entry.

Definition at line 70 of file media_player.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.spotify.media_player._LOGGER = logging.getLogger(__name__)
private

Definition at line 42 of file media_player.py.

◆ AFTER_REQUEST_SLEEP

int homeassistant.components.spotify.media_player.AFTER_REQUEST_SLEEP = 1

Definition at line 67 of file media_player.py.

◆ REPEAT_MODE_MAPPING_TO_HA

dictionary homeassistant.components.spotify.media_player.REPEAT_MODE_MAPPING_TO_HA
Initial value:
1 = {
2  SpotifyRepeatMode.CONTEXT: RepeatMode.ALL,
3  SpotifyRepeatMode.OFF: RepeatMode.OFF,
4  SpotifyRepeatMode.TRACK: RepeatMode.ONE,
5 }

Definition at line 58 of file media_player.py.

◆ REPEAT_MODE_MAPPING_TO_SPOTIFY

dictionary homeassistant.components.spotify.media_player.REPEAT_MODE_MAPPING_TO_SPOTIFY
Initial value:
1 = {
2  value: key for key, value in REPEAT_MODE_MAPPING_TO_HA.items()
3 }

Definition at line 64 of file media_player.py.

◆ SUPPORT_SPOTIFY

tuple homeassistant.components.spotify.media_player.SUPPORT_SPOTIFY
Initial value:
1 = (
2  MediaPlayerEntityFeature.BROWSE_MEDIA
3  | MediaPlayerEntityFeature.NEXT_TRACK
4  | MediaPlayerEntityFeature.PAUSE
5  | MediaPlayerEntityFeature.PLAY
6  | MediaPlayerEntityFeature.PLAY_MEDIA
7  | MediaPlayerEntityFeature.PREVIOUS_TRACK
8  | MediaPlayerEntityFeature.REPEAT_SET
9  | MediaPlayerEntityFeature.SEEK
10  | MediaPlayerEntityFeature.SELECT_SOURCE
11  | MediaPlayerEntityFeature.SHUFFLE_SET
12  | MediaPlayerEntityFeature.VOLUME_SET
13 )

Definition at line 44 of file media_player.py.