Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.template.cover Namespace Reference

Classes

class  CoverTemplate
 

Functions

def _async_create_entities (hass, config)
 
None async_setup_platform (HomeAssistant hass, ConfigType config, AddEntitiesCallback async_add_entities, DiscoveryInfoType|None discovery_info=None)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
list _VALID_STATES
 
string CLOSE_ACTION = "close_cover"
 
string CLOSED_STATE = "closed"
 
string CLOSING_STATE = "closing"
 
string CONF_OPEN_AND_CLOSE = "open_or_close"
 
string CONF_POSITION_TEMPLATE = "position_template"
 
string CONF_TILT_OPTIMISTIC = "tilt_optimistic"
 
string CONF_TILT_TEMPLATE = "tilt_template"
 
 COVER_SCHEMA
 
string OPEN_ACTION = "open_cover"
 
string OPEN_STATE = "open"
 
string OPENING_STATE = "opening"
 
 PLATFORM_SCHEMA
 
string POSITION_ACTION = "set_cover_position"
 
string STOP_ACTION = "stop_cover"
 
string TILT_ACTION = "set_cover_tilt_position"
 
tuple TILT_FEATURES
 

Detailed Description

Support for covers which integrate with other components.

Function Documentation

◆ _async_create_entities()

def homeassistant.components.template.cover._async_create_entities (   hass,
  config 
)
private
Create the Template cover.

Definition at line 106 of file cover.py.

◆ async_setup_platform()

None homeassistant.components.template.cover.async_setup_platform ( HomeAssistant  hass,
ConfigType  config,
AddEntitiesCallback  async_add_entities,
DiscoveryInfoType | None   discovery_info = None 
)
Set up the Template cover.

Definition at line 127 of file cover.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.template.cover._LOGGER = logging.getLogger(__name__)
private

Definition at line 43 of file cover.py.

◆ _VALID_STATES

list homeassistant.components.template.cover._VALID_STATES
private
Initial value:
1 = [
2  OPEN_STATE,
3  OPENING_STATE,
4  CLOSED_STATE,
5  CLOSING_STATE,
6  "true",
7  "false",
8  "none",
9 ]

Definition at line 50 of file cover.py.

◆ CLOSE_ACTION

string homeassistant.components.template.cover.CLOSE_ACTION = "close_cover"

Definition at line 63 of file cover.py.

◆ CLOSED_STATE

string homeassistant.components.template.cover.CLOSED_STATE = "closed"

Definition at line 47 of file cover.py.

◆ CLOSING_STATE

string homeassistant.components.template.cover.CLOSING_STATE = "closing"

Definition at line 48 of file cover.py.

◆ CONF_OPEN_AND_CLOSE

string homeassistant.components.template.cover.CONF_OPEN_AND_CLOSE = "open_or_close"

Definition at line 69 of file cover.py.

◆ CONF_POSITION_TEMPLATE

string homeassistant.components.template.cover.CONF_POSITION_TEMPLATE = "position_template"

Definition at line 60 of file cover.py.

◆ CONF_TILT_OPTIMISTIC

string homeassistant.components.template.cover.CONF_TILT_OPTIMISTIC = "tilt_optimistic"

Definition at line 67 of file cover.py.

◆ CONF_TILT_TEMPLATE

string homeassistant.components.template.cover.CONF_TILT_TEMPLATE = "tilt_template"

Definition at line 61 of file cover.py.

◆ COVER_SCHEMA

homeassistant.components.template.cover.COVER_SCHEMA
Initial value:
1 = vol.All(
2  cv.deprecated(CONF_ENTITY_ID),
3  vol.Schema(
4  {
5  vol.Inclusive(OPEN_ACTION, CONF_OPEN_AND_CLOSE): cv.SCRIPT_SCHEMA,
6  vol.Inclusive(CLOSE_ACTION, CONF_OPEN_AND_CLOSE): cv.SCRIPT_SCHEMA,
7  vol.Optional(STOP_ACTION): cv.SCRIPT_SCHEMA,
8  vol.Optional(CONF_VALUE_TEMPLATE): cv.template,
9  vol.Optional(CONF_POSITION_TEMPLATE): cv.template,
10  vol.Optional(CONF_TILT_TEMPLATE): cv.template,
11  vol.Optional(CONF_DEVICE_CLASS): DEVICE_CLASSES_SCHEMA,
12  vol.Optional(CONF_OPTIMISTIC): cv.boolean,
13  vol.Optional(CONF_TILT_OPTIMISTIC): cv.boolean,
14  vol.Optional(POSITION_ACTION): cv.SCRIPT_SCHEMA,
15  vol.Optional(TILT_ACTION): cv.SCRIPT_SCHEMA,
16  vol.Optional(CONF_FRIENDLY_NAME): cv.string,
17  vol.Optional(CONF_ENTITY_ID): cv.entity_ids,
18  vol.Optional(CONF_UNIQUE_ID): cv.string,
19  }
20  ).extend(TEMPLATE_ENTITY_COMMON_SCHEMA_LEGACY.schema),
21  cv.has_at_least_one_key(OPEN_ACTION, POSITION_ACTION),
22 )

Definition at line 78 of file cover.py.

◆ OPEN_ACTION

string homeassistant.components.template.cover.OPEN_ACTION = "open_cover"

Definition at line 62 of file cover.py.

◆ OPEN_STATE

string homeassistant.components.template.cover.OPEN_STATE = "open"

Definition at line 45 of file cover.py.

◆ OPENING_STATE

string homeassistant.components.template.cover.OPENING_STATE = "opening"

Definition at line 46 of file cover.py.

◆ PLATFORM_SCHEMA

homeassistant.components.template.cover.PLATFORM_SCHEMA
Initial value:
1 = COVER_PLATFORM_SCHEMA.extend(
2  {vol.Required(CONF_COVERS): cv.schema_with_slug_keys(COVER_SCHEMA)}
3 )

Definition at line 101 of file cover.py.

◆ POSITION_ACTION

string homeassistant.components.template.cover.POSITION_ACTION = "set_cover_position"

Definition at line 65 of file cover.py.

◆ STOP_ACTION

string homeassistant.components.template.cover.STOP_ACTION = "stop_cover"

Definition at line 64 of file cover.py.

◆ TILT_ACTION

string homeassistant.components.template.cover.TILT_ACTION = "set_cover_tilt_position"

Definition at line 66 of file cover.py.

◆ TILT_FEATURES

tuple homeassistant.components.template.cover.TILT_FEATURES
Initial value:
1 = (
2  CoverEntityFeature.OPEN_TILT
3  | CoverEntityFeature.CLOSE_TILT
4  | CoverEntityFeature.STOP_TILT
5  | CoverEntityFeature.SET_TILT_POSITION
6 )

Definition at line 71 of file cover.py.