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

Namespaces

 browse_media
 
 const
 
 device_condition
 
 device_trigger
 
 errors
 
 intent
 
 reproduce_state
 
 significant_change
 

Classes

class  _CacheImage
 
class  _ImageCache
 
class  MediaPlayerDeviceClass
 
class  MediaPlayerEnqueue
 
class  MediaPlayerEntity
 
class  MediaPlayerEntityDescription
 
class  MediaPlayerImageView
 

Functions

Callable[[dict[str, Any]], dict[str, Any]] _rename_keys (**Any keys)
 
str _url_hash (str url)
 
tuple[bytes|None, str|None] async_fetch_image (logging.Logger logger, HomeAssistant hass, str url)
 
bool async_setup (HomeAssistant hass, ConfigType config)
 
bool async_setup_entry (HomeAssistant hass, ConfigEntry entry)
 
bool async_unload_entry (HomeAssistant hass, ConfigEntry entry)
 
bool is_on (HomeAssistant hass, str|None entity_id=None)
 
None websocket_browse_media (HomeAssistant hass, websocket_api.connection.ActiveConnection connection, dict[str, Any] msg)
 

Variables

 __all__
 
 __dir__
 
 __getattr__
 
 _DEPRECATED_DEVICE_CLASS_RECEIVER
 
 _DEPRECATED_DEVICE_CLASS_SPEAKER
 
 _DEPRECATED_DEVICE_CLASS_TV
 
 _ENTITY_IMAGE_CACHE
 
 _FETCH_TIMEOUT
 
 ATTR_MEDIA_EXTRA
 
 ATTR_TO_PROPERTY
 
 CACHED_PROPERTIES_WITH_ATTR_
 
 check_if_deprecated_constant
 
 default
 
 DEVICE_CLASSES
 
 DEVICE_CLASSES_SCHEMA
 
 dir_with_deprecated_constants
 
 ENTITY_ID_FORMAT
 
 Final
 
 images
 
 maxsize
 
 MEDIA_PLAYER_PLAY_MEDIA_SCHEMA
 
 module_globals
 
 module_globals_keys
 
 PLATFORM_SCHEMA
 
 PLATFORM_SCHEMA_BASE
 
 SCAN_INTERVAL
 
 seconds
 
 total
 

Detailed Description

Component to interface with various media players.

Function Documentation

◆ _rename_keys()

Callable[[dict[str, Any]], dict[str, Any]] homeassistant.components.media_player._rename_keys ( **Any  keys)
private
Create validator that renames keys.

Necessary because the service schema names do not match the command parameters.

Async friendly.

Definition at line 263 of file __init__.py.

◆ _url_hash()

str homeassistant.components.media_player._url_hash ( str  url)
private
Create hash for media image url.

Definition at line 508 of file __init__.py.

◆ async_fetch_image()

tuple[bytes | None, str | None] homeassistant.components.media_player.async_fetch_image ( logging.Logger  logger,
HomeAssistant  hass,
str   url 
)
Retrieve an image.

Definition at line 1351 of file __init__.py.

◆ async_setup()

bool homeassistant.components.media_player.async_setup ( HomeAssistant  hass,
ConfigType  config 
)
Track states and offer events for media_players.

Definition at line 280 of file __init__.py.

◆ async_setup_entry()

bool homeassistant.components.media_player.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  entry 
)
Set up a config entry.

Definition at line 454 of file __init__.py.

◆ async_unload_entry()

bool homeassistant.components.media_player.async_unload_entry ( HomeAssistant  hass,
ConfigEntry  entry 
)
Unload a config entry.

Definition at line 459 of file __init__.py.

◆ is_on()

bool homeassistant.components.media_player.is_on ( HomeAssistant  hass,
str | None   entity_id = None 
)
Return true if specified media player entity_id is on.

Check all media player if no entity_id specified.

Definition at line 251 of file __init__.py.

◆ websocket_browse_media()

None homeassistant.components.media_player.websocket_browse_media ( HomeAssistant  hass,
websocket_api.connection.ActiveConnection  connection,
dict[str, Any]  msg 
)
Browse media available to the media_player entity.

To use, media_player integrations can implement
MediaPlayerEntity.async_browse_media()

Definition at line 1288 of file __init__.py.

Variable Documentation

◆ __all__

homeassistant.components.media_player.__all__
private

Definition at line 1383 of file __init__.py.

◆ __dir__

homeassistant.components.media_player.__dir__
private

Definition at line 1380 of file __init__.py.

◆ __getattr__

homeassistant.components.media_player.__getattr__
private

Definition at line 1379 of file __init__.py.

◆ _DEPRECATED_DEVICE_CLASS_RECEIVER

homeassistant.components.media_player._DEPRECATED_DEVICE_CLASS_RECEIVER
private

Definition at line 188 of file __init__.py.

◆ _DEPRECATED_DEVICE_CLASS_SPEAKER

homeassistant.components.media_player._DEPRECATED_DEVICE_CLASS_SPEAKER
private

Definition at line 185 of file __init__.py.

◆ _DEPRECATED_DEVICE_CLASS_TV

homeassistant.components.media_player._DEPRECATED_DEVICE_CLASS_TV
private

Definition at line 182 of file __init__.py.

◆ _ENTITY_IMAGE_CACHE

homeassistant.components.media_player._ENTITY_IMAGE_CACHE
private

Definition at line 247 of file __init__.py.

◆ _FETCH_TIMEOUT

homeassistant.components.media_player._FETCH_TIMEOUT
private

Definition at line 1348 of file __init__.py.

◆ ATTR_MEDIA_EXTRA

homeassistant.components.media_player.ATTR_MEDIA_EXTRA

Definition at line 201 of file __init__.py.

◆ ATTR_TO_PROPERTY

homeassistant.components.media_player.ATTR_TO_PROPERTY

Definition at line 204 of file __init__.py.

◆ CACHED_PROPERTIES_WITH_ATTR_

homeassistant.components.media_player.CACHED_PROPERTIES_WITH_ATTR_

Definition at line 471 of file __init__.py.

◆ check_if_deprecated_constant

homeassistant.components.media_player.check_if_deprecated_constant

Definition at line 1379 of file __init__.py.

◆ default

homeassistant.components.media_player.default

Definition at line 201 of file __init__.py.

◆ DEVICE_CLASSES

homeassistant.components.media_player.DEVICE_CLASSES

Definition at line 191 of file __init__.py.

◆ DEVICE_CLASSES_SCHEMA

homeassistant.components.media_player.DEVICE_CLASSES_SCHEMA

Definition at line 177 of file __init__.py.

◆ dir_with_deprecated_constants

homeassistant.components.media_player.dir_with_deprecated_constants

Definition at line 1381 of file __init__.py.

◆ ENTITY_ID_FORMAT

homeassistant.components.media_player.ENTITY_ID_FORMAT

Definition at line 144 of file __init__.py.

◆ Final

homeassistant.components.media_player.Final

Definition at line 149 of file __init__.py.

◆ images

homeassistant.components.media_player.images

Definition at line 247 of file __init__.py.

◆ maxsize

homeassistant.components.media_player.maxsize

Definition at line 247 of file __init__.py.

◆ MEDIA_PLAYER_PLAY_MEDIA_SCHEMA

homeassistant.components.media_player.MEDIA_PLAYER_PLAY_MEDIA_SCHEMA

Definition at line 194 of file __init__.py.

◆ module_globals

homeassistant.components.media_player.module_globals

Definition at line 1379 of file __init__.py.

◆ module_globals_keys

homeassistant.components.media_player.module_globals_keys

Definition at line 1381 of file __init__.py.

◆ PLATFORM_SCHEMA

homeassistant.components.media_player.PLATFORM_SCHEMA

Definition at line 145 of file __init__.py.

◆ PLATFORM_SCHEMA_BASE

homeassistant.components.media_player.PLATFORM_SCHEMA_BASE

Definition at line 146 of file __init__.py.

◆ SCAN_INTERVAL

homeassistant.components.media_player.SCAN_INTERVAL

Definition at line 147 of file __init__.py.

◆ seconds

homeassistant.components.media_player.seconds

Definition at line 147 of file __init__.py.

◆ total

homeassistant.components.media_player.total

Definition at line 1348 of file __init__.py.