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

Functions

CALLBACK_TYPE async_attach_trigger (HomeAssistant hass, ConfigType config, TriggerActionType action, TriggerInfo trigger_info)
 
dict[str, vol.Schema] async_get_trigger_capabilities (HomeAssistant hass, ConfigType config)
 
list[dict[str, str]] async_get_triggers (HomeAssistant hass, str device_id)
 

Variables

 MEDIA_PLAYER_TRIGGER_SCHEMA
 
 TRIGGER_SCHEMA
 
dictionary TRIGGER_TYPES = {"turned_on", "turned_off", "buffering", "idle", "paused", "playing"}
 

Detailed Description

Provides device automations for Media player.

Function Documentation

◆ async_attach_trigger()

CALLBACK_TYPE homeassistant.components.media_player.device_trigger.async_attach_trigger ( HomeAssistant  hass,
ConfigType  config,
TriggerActionType  action,
TriggerInfo  trigger_info 
)
Attach a trigger.

Definition at line 92 of file device_trigger.py.

◆ async_get_trigger_capabilities()

dict[str, vol.Schema] homeassistant.components.media_player.device_trigger.async_get_trigger_capabilities ( HomeAssistant  hass,
ConfigType   config 
)
List trigger capabilities.

Definition at line 79 of file device_trigger.py.

◆ async_get_triggers()

list[dict[str, str]] homeassistant.components.media_player.device_trigger.async_get_triggers ( HomeAssistant  hass,
str   device_id 
)
List device triggers for Media player entities.

Definition at line 52 of file device_trigger.py.

Variable Documentation

◆ MEDIA_PLAYER_TRIGGER_SCHEMA

homeassistant.components.media_player.device_trigger.MEDIA_PLAYER_TRIGGER_SCHEMA
Initial value:
1 = DEVICE_TRIGGER_BASE_SCHEMA.extend(
2  {
3  vol.Required(CONF_ENTITY_ID): cv.entity_id_or_uuid,
4  vol.Required(CONF_TYPE): vol.In(TRIGGER_TYPES),
5  vol.Optional(CONF_FOR): cv.positive_time_period_dict,
6  }
7 )

Definition at line 35 of file device_trigger.py.

◆ TRIGGER_SCHEMA

homeassistant.components.media_player.device_trigger.TRIGGER_SCHEMA
Initial value:
1 = vol.All(
2  vol.Any(
3  MEDIA_PLAYER_TRIGGER_SCHEMA,
4  entity.TRIGGER_SCHEMA,
5  ),
6  vol.Schema({vol.Required(CONF_DOMAIN): DOMAIN}, extra=vol.ALLOW_EXTRA),
7 )

Definition at line 43 of file device_trigger.py.

◆ TRIGGER_TYPES

dictionary homeassistant.components.media_player.device_trigger.TRIGGER_TYPES = {"turned_on", "turned_off", "buffering", "idle", "paused", "playing"}

Definition at line 33 of file device_trigger.py.