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

Classes

class  _TemplateAttribute
 
class  TemplateEntity
 

Functions

vol.Schema make_template_entity_common_schema (str default_name)
 
dict[str, Any] rewrite_common_legacy_to_modern_conf (HomeAssistant hass, dict[str, Any] entity_cfg, dict[str, str]|None extra_legacy_fields=None)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
dictionary LEGACY_FIELDS
 
 TEMPLATE_ENTITY_ATTRIBUTES_SCHEMA_LEGACY
 
 TEMPLATE_ENTITY_AVAILABILITY_SCHEMA
 
 TEMPLATE_ENTITY_AVAILABILITY_SCHEMA_LEGACY
 
 TEMPLATE_ENTITY_COMMON_SCHEMA
 
 TEMPLATE_ENTITY_COMMON_SCHEMA_LEGACY
 
 TEMPLATE_ENTITY_ICON_SCHEMA
 

Detailed Description

TemplateEntity utility class.

Function Documentation

◆ make_template_entity_common_schema()

vol.Schema homeassistant.components.template.template_entity.make_template_entity_common_schema ( str  default_name)
Return a schema with default name.

Definition at line 88 of file template_entity.py.

◆ rewrite_common_legacy_to_modern_conf()

dict[str, Any] homeassistant.components.template.template_entity.rewrite_common_legacy_to_modern_conf ( HomeAssistant  hass,
dict[str, Any]  entity_cfg,
dict[str, str] | None   extra_legacy_fields = None 
)
Rewrite legacy config.

Definition at line 129 of file template_entity.py.

Variable Documentation

◆ _LOGGER

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

Definition at line 65 of file template_entity.py.

◆ LEGACY_FIELDS

dictionary homeassistant.components.template.template_entity.LEGACY_FIELDS
Initial value:
1 = {
2  CONF_ICON_TEMPLATE: CONF_ICON,
3  CONF_ENTITY_PICTURE_TEMPLATE: CONF_PICTURE,
4  CONF_AVAILABILITY_TEMPLATE: CONF_AVAILABILITY,
5  CONF_ATTRIBUTE_TEMPLATES: CONF_ATTRIBUTES,
6  CONF_FRIENDLY_NAME: CONF_NAME,
7 }

Definition at line 120 of file template_entity.py.

◆ TEMPLATE_ENTITY_ATTRIBUTES_SCHEMA_LEGACY

homeassistant.components.template.template_entity.TEMPLATE_ENTITY_ATTRIBUTES_SCHEMA_LEGACY
Initial value:
1 = vol.Schema(
2  {
3  vol.Optional(CONF_ATTRIBUTE_TEMPLATES, default={}): vol.Schema(
4  {cv.string: cv.template}
5  ),
6  }
7 )

Definition at line 98 of file template_entity.py.

◆ TEMPLATE_ENTITY_AVAILABILITY_SCHEMA

homeassistant.components.template.template_entity.TEMPLATE_ENTITY_AVAILABILITY_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Optional(CONF_AVAILABILITY): cv.template,
4  }
5 )

Definition at line 67 of file template_entity.py.

◆ TEMPLATE_ENTITY_AVAILABILITY_SCHEMA_LEGACY

homeassistant.components.template.template_entity.TEMPLATE_ENTITY_AVAILABILITY_SCHEMA_LEGACY
Initial value:
1 = vol.Schema(
2  {
3  vol.Optional(CONF_AVAILABILITY_TEMPLATE): cv.template,
4  }
5 )

Definition at line 106 of file template_entity.py.

◆ TEMPLATE_ENTITY_COMMON_SCHEMA

homeassistant.components.template.template_entity.TEMPLATE_ENTITY_COMMON_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Optional(CONF_ATTRIBUTES): vol.Schema({cv.string: cv.template}),
4  vol.Optional(CONF_AVAILABILITY): cv.template,
5  vol.Optional(CONF_VARIABLES): cv.SCRIPT_VARIABLES_SCHEMA,
6  }
7 ).extend(TEMPLATE_ENTITY_BASE_SCHEMA.schema)

Definition at line 79 of file template_entity.py.

◆ TEMPLATE_ENTITY_COMMON_SCHEMA_LEGACY

homeassistant.components.template.template_entity.TEMPLATE_ENTITY_COMMON_SCHEMA_LEGACY
Initial value:
1 = vol.Schema(
2  {
3  vol.Optional(CONF_ENTITY_PICTURE_TEMPLATE): cv.template,
4  vol.Optional(CONF_ICON_TEMPLATE): cv.template,
5  }
6 ).extend(TEMPLATE_ENTITY_AVAILABILITY_SCHEMA_LEGACY.schema)

Definition at line 112 of file template_entity.py.

◆ TEMPLATE_ENTITY_ICON_SCHEMA

homeassistant.components.template.template_entity.TEMPLATE_ENTITY_ICON_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Optional(CONF_ICON): cv.template,
4  }
5 )

Definition at line 73 of file template_entity.py.