Home Assistant Unofficial Reference 2024.12.1
homeassistant.helpers.template.TemplateState Class Reference
Inheritance diagram for homeassistant.helpers.template.TemplateState:
[legend]
Collaboration diagram for homeassistant.helpers.template.TemplateState:
[legend]

Public Member Functions

None __init__ (self, HomeAssistant hass, State state, bool collect=True)
 
str __repr__ (self)
 
- Public Member Functions inherited from homeassistant.helpers.template.TemplateStateBase
bool __eq__ (self, object other)
 
Any __getitem__ (self, str item)
 
None __init__ (self, HomeAssistant hass, bool collect, str entity_id)
 
ReadOnlyDict[str, Any] attributes (self)
 
Context context (self)
 
str domain (self)
 
str entity_id (self)
 
str format_state (self, bool rounded, bool with_unit)
 
datetime last_changed (self)
 
datetime last_reported (self)
 
datetime last_updated (self)
 
str name (self)
 
str object_id (self)
 
str state (self)
 
str state_with_unit (self)
 
- Public Member Functions inherited from homeassistant.core.State
None __init__ (self, str entity_id, str state, Mapping[str, Any]|None attributes=None, datetime.datetime|None last_changed=None, datetime.datetime|None last_reported=None, datetime.datetime|None last_updated=None, Context|None context=None, bool|None validate_entity_id=True, StateInfo|None state_info=None, float|None last_updated_timestamp=None)
 
CompressedState as_compressed_state (self)
 
bytes as_compressed_state_json (self)
 
ReadOnlyDict[str, datetime.datetime|Collection[Any]] as_dict (self)
 
bytes as_dict_json (self)
 
None expire (self)
 
Self|None from_dict (cls, dict[str, Any] json_dict)
 
json_fragment json_fragment (self)
 
float last_changed_timestamp (self)
 
float last_reported_timestamp (self)
 

Private Attributes

 _state
 

Static Private Attributes

tuple __slots__ = ()
 

Additional Inherited Members

- Public Attributes inherited from homeassistant.core.State
 attributes
 
 context
 
 entity_id
 
 last_changed
 
 last_reported
 
 last_updated
 
 last_updated_timestamp
 
 object_id
 
 state
 
 state_info
 

Detailed Description

Class to represent a state object in a template.

Definition at line 1152 of file template.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.helpers.template.TemplateState.__init__ (   self,
HomeAssistant  hass,
State  state,
bool   collect = True 
)
Initialize template state.

Definition at line 1158 of file template.py.

Member Function Documentation

◆ __repr__()

str homeassistant.helpers.template.TemplateState.__repr__ (   self)
Representation of Template State.

Reimplemented from homeassistant.core.State.

Definition at line 1163 of file template.py.

Member Data Documentation

◆ __slots__

tuple homeassistant.helpers.template.TemplateState.__slots__ = ()
staticprivate

Definition at line 1155 of file template.py.

◆ _state

homeassistant.helpers.template.TemplateState._state
private

Definition at line 1161 of file template.py.


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