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

Classes

class  SonosMediaPlayerEntity
 

Functions

None async_setup_entry (HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
string ATTR_ALARM_ID = "alarm_id"
 
string ATTR_ENABLED = "enabled"
 
string ATTR_INCLUDE_LINKED_ZONES = "include_linked_zones"
 
string ATTR_MASTER = "master"
 
string ATTR_QUEUE_POSITION = "queue_position"
 
string ATTR_SLEEP_TIME = "sleep_time"
 
string ATTR_VOLUME = "volume"
 
string ATTR_WITH_GROUP = "with_group"
 
float LONG_SERVICE_TIMEOUT = 30.0
 
dictionary REPEAT_TO_SONOS
 
string SERVICE_CLEAR_TIMER = "clear_sleep_timer"
 
string SERVICE_GET_QUEUE = "get_queue"
 
string SERVICE_PLAY_QUEUE = "play_queue"
 
string SERVICE_REMOVE_FROM_QUEUE = "remove_from_queue"
 
string SERVICE_RESTORE = "restore"
 
string SERVICE_SET_TIMER = "set_sleep_timer"
 
string SERVICE_SNAPSHOT = "snapshot"
 
string SERVICE_UPDATE_ALARM = "update_alarm"
 
dictionary SONOS_TO_REPEAT = {meaning: mode for mode, meaning in REPEAT_TO_SONOS.items()}
 
float UNJOIN_SERVICE_TIMEOUT = 0.1
 
list UPNP_ERRORS_TO_IGNORE = ["701", "711", "712"]
 
int VOLUME_INCREMENT = 2
 

Detailed Description

Support to interface with Sonos players.

Function Documentation

◆ async_setup_entry()

None homeassistant.components.sonos.media_player.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  config_entry,
AddEntitiesCallback  async_add_entities 
)
Set up Sonos from a config entry.

Definition at line 108 of file media_player.py.

Variable Documentation

◆ _LOGGER

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

Definition at line 72 of file media_player.py.

◆ ATTR_ALARM_ID

string homeassistant.components.sonos.media_player.ATTR_ALARM_ID = "alarm_id"

Definition at line 99 of file media_player.py.

◆ ATTR_ENABLED

string homeassistant.components.sonos.media_player.ATTR_ENABLED = "enabled"

Definition at line 101 of file media_player.py.

◆ ATTR_INCLUDE_LINKED_ZONES

string homeassistant.components.sonos.media_player.ATTR_INCLUDE_LINKED_ZONES = "include_linked_zones"

Definition at line 102 of file media_player.py.

◆ ATTR_MASTER

string homeassistant.components.sonos.media_player.ATTR_MASTER = "master"

Definition at line 103 of file media_player.py.

◆ ATTR_QUEUE_POSITION

string homeassistant.components.sonos.media_player.ATTR_QUEUE_POSITION = "queue_position"

Definition at line 105 of file media_player.py.

◆ ATTR_SLEEP_TIME

string homeassistant.components.sonos.media_player.ATTR_SLEEP_TIME = "sleep_time"

Definition at line 98 of file media_player.py.

◆ ATTR_VOLUME

string homeassistant.components.sonos.media_player.ATTR_VOLUME = "volume"

Definition at line 100 of file media_player.py.

◆ ATTR_WITH_GROUP

string homeassistant.components.sonos.media_player.ATTR_WITH_GROUP = "with_group"

Definition at line 104 of file media_player.py.

◆ LONG_SERVICE_TIMEOUT

float homeassistant.components.sonos.media_player.LONG_SERVICE_TIMEOUT = 30.0

Definition at line 74 of file media_player.py.

◆ REPEAT_TO_SONOS

dictionary homeassistant.components.sonos.media_player.REPEAT_TO_SONOS
Initial value:
1 = {
2  RepeatMode.OFF: False,
3  RepeatMode.ALL: True,
4  RepeatMode.ONE: "ONE",
5 }

Definition at line 78 of file media_player.py.

◆ SERVICE_CLEAR_TIMER

string homeassistant.components.sonos.media_player.SERVICE_CLEAR_TIMER = "clear_sleep_timer"

Definition at line 92 of file media_player.py.

◆ SERVICE_GET_QUEUE

string homeassistant.components.sonos.media_player.SERVICE_GET_QUEUE = "get_queue"

Definition at line 96 of file media_player.py.

◆ SERVICE_PLAY_QUEUE

string homeassistant.components.sonos.media_player.SERVICE_PLAY_QUEUE = "play_queue"

Definition at line 94 of file media_player.py.

◆ SERVICE_REMOVE_FROM_QUEUE

string homeassistant.components.sonos.media_player.SERVICE_REMOVE_FROM_QUEUE = "remove_from_queue"

Definition at line 95 of file media_player.py.

◆ SERVICE_RESTORE

string homeassistant.components.sonos.media_player.SERVICE_RESTORE = "restore"

Definition at line 90 of file media_player.py.

◆ SERVICE_SET_TIMER

string homeassistant.components.sonos.media_player.SERVICE_SET_TIMER = "set_sleep_timer"

Definition at line 91 of file media_player.py.

◆ SERVICE_SNAPSHOT

string homeassistant.components.sonos.media_player.SERVICE_SNAPSHOT = "snapshot"

Definition at line 89 of file media_player.py.

◆ SERVICE_UPDATE_ALARM

string homeassistant.components.sonos.media_player.SERVICE_UPDATE_ALARM = "update_alarm"

Definition at line 93 of file media_player.py.

◆ SONOS_TO_REPEAT

dictionary homeassistant.components.sonos.media_player.SONOS_TO_REPEAT = {meaning: mode for mode, meaning in REPEAT_TO_SONOS.items()}

Definition at line 84 of file media_player.py.

◆ UNJOIN_SERVICE_TIMEOUT

float homeassistant.components.sonos.media_player.UNJOIN_SERVICE_TIMEOUT = 0.1

Definition at line 75 of file media_player.py.

◆ UPNP_ERRORS_TO_IGNORE

list homeassistant.components.sonos.media_player.UPNP_ERRORS_TO_IGNORE = ["701", "711", "712"]

Definition at line 86 of file media_player.py.

◆ VOLUME_INCREMENT

int homeassistant.components.sonos.media_player.VOLUME_INCREMENT = 2

Definition at line 76 of file media_player.py.