Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.template.template_entity._TemplateAttribute Class Reference

Public Member Functions

None __init__ (self, Entity entity, str attribute, Template template, Callable[[Any], Any]|None validator=None, Callable[[Any], None]|None on_update=None, bool|None none_on_template_error=False)
 
None async_setup (self)
 
None handle_result (self, Event[EventStateChangedData]|None event, Template template, str|TemplateError|None last_result, str|TemplateError result)
 

Public Attributes

 async_update
 
 none_on_template_error
 
 on_update
 
 template
 
 validator
 

Private Member Functions

None _default_update (self, str|TemplateError result)
 

Private Attributes

 _attribute
 
 _entity
 

Detailed Description

Attribute value linked to template result.

Definition at line 156 of file template_entity.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.template.template_entity._TemplateAttribute.__init__ (   self,
Entity  entity,
str  attribute,
Template  template,
Callable[[Any], Any] | None   validator = None,
Callable[[Any], None] | None   on_update = None,
bool | None   none_on_template_error = False 
)
Template attribute.

Definition at line 159 of file template_entity.py.

Member Function Documentation

◆ _default_update()

None homeassistant.components.template.template_entity._TemplateAttribute._default_update (   self,
str | TemplateError  result 
)
private

Definition at line 189 of file template_entity.py.

◆ async_setup()

None homeassistant.components.template.template_entity._TemplateAttribute.async_setup (   self)
Config update path for the attribute.

Definition at line 178 of file template_entity.py.

◆ handle_result()

None homeassistant.components.template.template_entity._TemplateAttribute.handle_result (   self,
Event[EventStateChangedData] | None  event,
Template  template,
str | TemplateError | None  last_result,
str | TemplateError  result 
)
Handle a template result event callback.

Definition at line 194 of file template_entity.py.

Member Data Documentation

◆ _attribute

homeassistant.components.template.template_entity._TemplateAttribute._attribute
private

Definition at line 170 of file template_entity.py.

◆ _entity

homeassistant.components.template.template_entity._TemplateAttribute._entity
private

Definition at line 169 of file template_entity.py.

◆ async_update

homeassistant.components.template.template_entity._TemplateAttribute.async_update

Definition at line 174 of file template_entity.py.

◆ none_on_template_error

homeassistant.components.template.template_entity._TemplateAttribute.none_on_template_error

Definition at line 175 of file template_entity.py.

◆ on_update

homeassistant.components.template.template_entity._TemplateAttribute.on_update

Definition at line 173 of file template_entity.py.

◆ template

homeassistant.components.template.template_entity._TemplateAttribute.template

Definition at line 171 of file template_entity.py.

◆ validator

homeassistant.components.template.template_entity._TemplateAttribute.validator

Definition at line 172 of file template_entity.py.


The documentation for this class was generated from the following file: