Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.control4.media_player.Control4Room Class Reference
Inheritance diagram for homeassistant.components.control4.media_player.Control4Room:
[legend]
Collaboration diagram for homeassistant.components.control4.media_player.Control4Room:
[legend]

Public Member Functions

None __init__ (self, dict entry_data, DataUpdateCoordinator[dict[int, dict[str, Any]]] coordinator, str name, int room_id, dict[int, int] id_to_parent, dict[int, _RoomSource] sources, bool room_hidden)
 
def async_media_pause (self)
 
def async_media_play (self)
 
def async_media_play_pause (self)
 
def async_media_stop (self)
 
def async_mute_volume (self, mute)
 
def async_select_source (self, source)
 
def async_set_volume_level (self, volume)
 
def async_turn_off (self)
 
def async_volume_down (self)
 
def async_volume_up (self)
 
MediaPlayerDeviceClass|None device_class (self)
 
def is_volume_muted (self)
 
def media_content_type (self)
 
str|None media_title (self)
 
def source (self)
 
list[strsource_list (self)
 
def state (self)
 
def volume_level (self)
 
- Public Member Functions inherited from homeassistant.components.control4.entity.Control4Entity
None __init__ (self, dict entry_data, DataUpdateCoordinator[Any] coordinator, str|None name, int idx, str|None device_name, str|None device_manufacturer, str|None device_model, int device_id)
 
DeviceInfo device_info (self)
 
- Public Member Functions inherited from homeassistant.helpers.update_coordinator.CoordinatorEntity
None __init__ (self, _DataUpdateCoordinatorT coordinator, Any context=None)
 
None async_update (self)
 
bool available (self)
 
- Public Member Functions inherited from homeassistant.components.media_player.MediaPlayerEntity
str access_token (self)
 
str|None app_id (self)
 
str|None app_name (self)
 
BrowseMedia async_browse_media (self, MediaType|str|None media_content_type=None, str|None media_content_id=None)
 
None async_clear_playlist (self)
 
tuple[bytes|None, str|Noneasync_get_browse_image (self, str media_content_type, str media_content_id, str|None media_image_id=None)
 
tuple[bytes|None, str|Noneasync_get_media_image (self)
 
None async_join_players (self, list[str] group_members)
 
None async_media_next_track (self)
 
None async_media_previous_track (self)
 
None async_media_seek (self, float position)
 
None async_mute_volume (self, bool mute)
 
None async_play_media (self, MediaType|str media_type, str media_id, **Any kwargs)
 
None async_select_sound_mode (self, str sound_mode)
 
None async_select_source (self, str source)
 
None async_set_repeat (self, RepeatMode repeat)
 
None async_set_shuffle (self, bool shuffle)
 
None async_set_volume_level (self, float volume)
 
None async_toggle (self)
 
None async_turn_on (self)
 
None async_unjoin_player (self)
 
dict[str, Any] capability_attributes (self)
 
None clear_playlist (self)
 
str|None entity_picture (self)
 
str get_browse_image_url (self, str media_content_type, str media_content_id, str|None media_image_id=None)
 
list[str]|None group_members (self)
 
None join_players (self, list[str] group_members)
 
str|None media_album_artist (self)
 
str|None media_album_name (self)
 
str|None media_artist (self)
 
str|None media_channel (self)
 
str|None media_content_id (self)
 
int|None media_duration (self)
 
str|None media_episode (self)
 
str|None media_image_hash (self)
 
str|None media_image_local (self)
 
bool media_image_remotely_accessible (self)
 
str|None media_image_url (self)
 
None media_next_track (self)
 
None media_pause (self)
 
None media_play (self)
 
str|None media_playlist (self)
 
int|None media_position (self)
 
dt.datetime|None media_position_updated_at (self)
 
None media_previous_track (self)
 
str|None media_season (self)
 
None media_seek (self, float position)
 
str|None media_series_title (self)
 
None media_stop (self)
 
int|None media_track (self)
 
None mute_volume (self, bool mute)
 
None play_media (self, MediaType|str media_type, str media_id, **Any kwargs)
 
RepeatMode|str|None repeat (self)
 
None select_sound_mode (self, str sound_mode)
 
None select_source (self, str source)
 
None set_repeat (self, RepeatMode repeat)
 
None set_shuffle (self, bool shuffle)
 
None set_volume_level (self, float volume)
 
bool|None shuffle (self)
 
str|None sound_mode (self)
 
list[str]|None sound_mode_list (self)
 
dict[str, Any] state_attributes (self)
 
bool support_clear_playlist (self)
 
bool support_grouping (self)
 
bool support_next_track (self)
 
bool support_pause (self)
 
bool support_play (self)
 
bool support_play_media (self)
 
bool support_previous_track (self)
 
bool support_seek (self)
 
bool support_select_sound_mode (self)
 
bool support_select_source (self)
 
bool support_shuffle_set (self)
 
bool support_stop (self)
 
bool support_volume_mute (self)
 
bool support_volume_set (self)
 
MediaPlayerEntityFeature supported_features (self)
 
MediaPlayerEntityFeature supported_features_compat (self)
 
None turn_off (self)
 
None turn_on (self)
 
None unjoin_player (self)
 
float volume_step (self)
 
- Public Member Functions inherited from homeassistant.helpers.entity.Entity
None __init_subclass__ (cls, **Any kwargs)
 
str __repr__ (self)
 
None add_to_platform_abort (self)
 
None add_to_platform_finish (self)
 
None add_to_platform_start (self, HomeAssistant hass, EntityPlatform platform, asyncio.Semaphore|None parallel_updates)
 
bool assumed_state (self)
 
None async_added_to_hass (self)
 
None async_device_update (self, bool warning=True)
 
None async_internal_added_to_hass (self)
 
None async_internal_will_remove_from_hass (self)
 
None async_on_remove (self, CALLBACK_TYPE func)
 
None async_registry_entry_updated (self)
 
None async_remove (self, *bool force_remove=False)
 
None async_removed_from_registry (self)
 
None async_schedule_update_ha_state (self, bool force_refresh=False)
 
None async_set_context (self, Context context)
 
None async_update_ha_state (self, bool force_refresh=False)
 
None async_will_remove_from_hass (self)
 
None async_write_ha_state (self)
 
str|None attribution (self)
 
bool available (self)
 
DeviceInfo|None device_info (self)
 
bool enabled (self)
 
EntityCategory|None entity_category (self)
 
bool entity_registry_enabled_default (self)
 
bool entity_registry_visible_default (self)
 
Mapping[str, Any]|None extra_state_attributes (self)
 
bool force_update (self)
 
HassJobType get_hassjob_type (self, str function_name)
 
er.EntityOptionsType|None get_initial_entity_options (self)
 
bool has_entity_name (self)
 
str|None icon (self)
 
str|UndefinedType|None name (self)
 
None schedule_update_ha_state (self, bool force_refresh=False)
 
bool should_poll (self)
 
str|None suggested_object_id (self)
 
str|None translation_key (self)
 
Mapping[str, strtranslation_placeholders (self)
 
str|None unique_id (self)
 
str|None unit_of_measurement (self)
 
bool use_device_name (self)
 
- Public Member Functions inherited from homeassistant.helpers.entity.CachedProperties
None __init__ (cls, str name, tuple[type,...] bases, dict[Any, Any] namespace, **Any kwargs)
 
Any __new__ (mcs, str name, tuple[type,...] bases, dict[Any, Any] namespace, set[str]|None cached_properties=None, **Any kwargs)
 

Private Member Functions

def _create_api_object (self)
 
int|None _get_current_playing_device_id (self)
 
str|None _get_current_source_state (self)
 
int|None _get_current_video_device_id (self)
 
int|None _get_device_from_variable (self, str var)
 
dict|None _get_media_info (self)
 

Private Attributes

 _attr_entity_registry_enabled_default
 
 _attr_supported_features
 
 _id_to_parent
 
 _sources
 

Static Private Attributes

bool _attr_has_entity_name = True
 

Additional Inherited Members

- Public Attributes inherited from homeassistant.components.control4.entity.Control4Entity
 entry_data
 
- Public Attributes inherited from homeassistant.components.media_player.MediaPlayerEntity
 state
 
- Public Attributes inherited from homeassistant.helpers.entity.Entity
 device_entry
 
 entity_id
 
 hass
 
 parallel_updates
 
 platform
 
 registry_entry
 
- Static Public Attributes inherited from homeassistant.components.media_player.MediaPlayerEntity
 bool
 
 MediaPlayerEntityFeature
 
 None
 
- Static Public Attributes inherited from homeassistant.helpers.entity.Entity
 bool
 
 EntityPlatform
 
 HomeAssistant
 
 None
 
 StateInfo
 
 StateType
 
 str
 

Detailed Description

Control4 Room entity.

Definition at line 178 of file media_player.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.control4.media_player.Control4Room.__init__ (   self,
dict  entry_data,
DataUpdateCoordinator[dict[int, dict[str, Any]]]  coordinator,
str  name,
int  room_id,
dict[int, int]  id_to_parent,
dict[int, _RoomSource sources,
bool  room_hidden 
)
Initialize Control4 room entity.

Definition at line 183 of file media_player.py.

Member Function Documentation

◆ _create_api_object()

def homeassistant.components.control4.media_player.Control4Room._create_api_object (   self)
private
Create a pyControl4 device object.

This exists so the director token used is always the latest one, without needing to re-init the entire entity.

Definition at line 218 of file media_player.py.

◆ _get_current_playing_device_id()

int | None homeassistant.components.control4.media_player.Control4Room._get_current_playing_device_id (   self)
private

Definition at line 235 of file media_player.py.

◆ _get_current_source_state()

str | None homeassistant.components.control4.media_player.Control4Room._get_current_source_state (   self)
private

Definition at line 251 of file media_player.py.

◆ _get_current_video_device_id()

int | None homeassistant.components.control4.media_player.Control4Room._get_current_video_device_id (   self)
private

Definition at line 232 of file media_player.py.

◆ _get_device_from_variable()

int | None homeassistant.components.control4.media_player.Control4Room._get_device_from_variable (   self,
str  var 
)
private

Definition at line 225 of file media_player.py.

◆ _get_media_info()

dict | None homeassistant.components.control4.media_player.Control4Room._get_media_info (   self)
private
Get the Media Info Dictionary if populated.

Definition at line 244 of file media_player.py.

◆ async_media_pause()

def homeassistant.components.control4.media_player.Control4Room.async_media_pause (   self)
Issue a pause command.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 384 of file media_player.py.

◆ async_media_play()

def homeassistant.components.control4.media_player.Control4Room.async_media_play (   self)
Issue a play command.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 389 of file media_player.py.

◆ async_media_play_pause()

def homeassistant.components.control4.media_player.Control4Room.async_media_play_pause (   self)
If possible, toggle the current play/pause state.

Not every source supports play/pause.
Unfortunately MediaPlayer capabilities are not dynamic,
so we must determine if play/pause is supported here

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 316 of file media_player.py.

◆ async_media_stop()

def homeassistant.components.control4.media_player.Control4Room.async_media_stop (   self)
Issue a stop command.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 394 of file media_player.py.

◆ async_mute_volume()

def homeassistant.components.control4.media_player.Control4Room.async_mute_volume (   self,
  mute 
)
Mute the room.

Definition at line 361 of file media_player.py.

◆ async_select_source()

def homeassistant.components.control4.media_player.Control4Room.async_select_source (   self,
  source 
)
Select a new source.

Definition at line 341 of file media_player.py.

◆ async_set_volume_level()

def homeassistant.components.control4.media_player.Control4Room.async_set_volume_level (   self,
  volume 
)
Set room volume, 0-1 scale.

Definition at line 369 of file media_player.py.

◆ async_turn_off()

def homeassistant.components.control4.media_player.Control4Room.async_turn_off (   self)
Turn off the room.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 356 of file media_player.py.

◆ async_volume_down()

def homeassistant.components.control4.media_player.Control4Room.async_volume_down (   self)
Decrease the volume by 1.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 379 of file media_player.py.

◆ async_volume_up()

def homeassistant.components.control4.media_player.Control4Room.async_volume_up (   self)
Increase the volume by 1.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 374 of file media_player.py.

◆ device_class()

MediaPlayerDeviceClass | None homeassistant.components.control4.media_player.Control4Room.device_class (   self)
Return the class of this entity.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 266 of file media_player.py.

◆ is_volume_muted()

def homeassistant.components.control4.media_player.Control4Room.is_volume_muted (   self)
Check if the volume is muted.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 337 of file media_player.py.

◆ media_content_type()

def homeassistant.components.control4.media_player.Control4Room.media_content_type (   self)
Get current content type if available.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 307 of file media_player.py.

◆ media_title()

str | None homeassistant.components.control4.media_player.Control4Room.media_title (   self)
Get the Media Title.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 294 of file media_player.py.

◆ source()

def homeassistant.components.control4.media_player.Control4Room.source (   self)
Get the current source.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 286 of file media_player.py.

◆ source_list()

list[str] homeassistant.components.control4.media_player.Control4Room.source_list (   self)
Get the available source.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 327 of file media_player.py.

◆ state()

def homeassistant.components.control4.media_player.Control4Room.state (   self)
Return whether this room is on or idle.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 274 of file media_player.py.

◆ volume_level()

def homeassistant.components.control4.media_player.Control4Room.volume_level (   self)
Get the volume level.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 332 of file media_player.py.

Member Data Documentation

◆ _attr_entity_registry_enabled_default

homeassistant.components.control4.media_player.Control4Room._attr_entity_registry_enabled_default
private

Definition at line 204 of file media_player.py.

◆ _attr_has_entity_name

bool homeassistant.components.control4.media_player.Control4Room._attr_has_entity_name = True
staticprivate

Definition at line 181 of file media_player.py.

◆ _attr_supported_features

homeassistant.components.control4.media_player.Control4Room._attr_supported_features
private

Definition at line 207 of file media_player.py.

◆ _id_to_parent

homeassistant.components.control4.media_player.Control4Room._id_to_parent
private

Definition at line 205 of file media_player.py.

◆ _sources

homeassistant.components.control4.media_player.Control4Room._sources
private

Definition at line 206 of file media_player.py.


The documentation for this class was generated from the following file: