Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.cover.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

 POSITION_TRIGGER_SCHEMA
 
dictionary POSITION_TRIGGER_TYPES = {"position", "tilt_position"}
 
 STATE_TRIGGER_SCHEMA
 
dictionary STATE_TRIGGER_TYPES = {"opened", "closed", "opening", "closing"}
 
 TRIGGER_SCHEMA = vol.Any(POSITION_TRIGGER_SCHEMA, STATE_TRIGGER_SCHEMA)
 

Detailed Description

Provides device automations for Cover.

Function Documentation

◆ async_attach_trigger()

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

Definition at line 137 of file device_trigger.py.

◆ async_get_trigger_capabilities()

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

Definition at line 112 of file device_trigger.py.

◆ async_get_triggers()

list[dict[str, str]] homeassistant.components.cover.device_trigger.async_get_triggers ( HomeAssistant  hass,
str   device_id 
)
List device triggers for Cover devices.

Definition at line 61 of file device_trigger.py.

Variable Documentation

◆ POSITION_TRIGGER_SCHEMA

homeassistant.components.cover.device_trigger.POSITION_TRIGGER_SCHEMA
Initial value:
1 = vol.All(
2  DEVICE_TRIGGER_BASE_SCHEMA.extend(
3  {
4  vol.Required(CONF_ENTITY_ID): cv.entity_id_or_uuid,
5  vol.Required(CONF_TYPE): vol.In(POSITION_TRIGGER_TYPES),
6  vol.Optional(CONF_ABOVE): vol.All(
7  vol.Coerce(int), vol.Range(min=0, max=100)
8  ),
9  vol.Optional(CONF_BELOW): vol.All(
10  vol.Coerce(int), vol.Range(min=0, max=100)
11  ),
12  }
13  ),
14  cv.has_at_least_one_key(CONF_BELOW, CONF_ABOVE),
15 )

Definition at line 34 of file device_trigger.py.

◆ POSITION_TRIGGER_TYPES

dictionary homeassistant.components.cover.device_trigger.POSITION_TRIGGER_TYPES = {"position", "tilt_position"}

Definition at line 31 of file device_trigger.py.

◆ STATE_TRIGGER_SCHEMA

homeassistant.components.cover.device_trigger.STATE_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(STATE_TRIGGER_TYPES),
5  vol.Optional(CONF_FOR): cv.positive_time_period_dict,
6  }
7 )

Definition at line 50 of file device_trigger.py.

◆ STATE_TRIGGER_TYPES

dictionary homeassistant.components.cover.device_trigger.STATE_TRIGGER_TYPES = {"opened", "closed", "opening", "closing"}

Definition at line 32 of file device_trigger.py.

◆ TRIGGER_SCHEMA

homeassistant.components.cover.device_trigger.TRIGGER_SCHEMA = vol.Any(POSITION_TRIGGER_SCHEMA, STATE_TRIGGER_SCHEMA)

Definition at line 58 of file device_trigger.py.