Public Member Functions | |
| 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) |
| str | __repr__ (self) |
| 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 Member Functions | |
| None | _collect_state (self) |
Private Attributes | |
| _collect | |
| _entity_id | |
| _hass | |
Static Private Attributes | |
| __delitem__ = _readonly | |
| __setitem__ = _readonly | |
| tuple | __slots__ = ("_hass", "_collect", "_entity_id", "_state") |
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 | |
Class to represent a state object in a template.
Definition at line 1023 of file template.py.
| None homeassistant.helpers.template.TemplateStateBase.__init__ | ( | self, | |
| HomeAssistant | hass, | ||
| bool | collect, | ||
| str | entity_id | ||
| ) |
Initialize template state.
Definition at line 1035 of file template.py.
| bool homeassistant.helpers.template.TemplateStateBase.__eq__ | ( | self, | |
| object | other | ||
| ) |
Ensure we collect on equality check.
Definition at line 1146 of file template.py.
| Any homeassistant.helpers.template.TemplateStateBase.__getitem__ | ( | self, | |
| str | item | ||
| ) |
Return a property as an attribute for jinja.
Definition at line 1048 of file template.py.
|
private |
Definition at line 1042 of file template.py.
| ReadOnlyDict[str, Any] homeassistant.helpers.template.TemplateStateBase.attributes | ( | self | ) |
Wrap State.attributes.
Definition at line 1076 of file template.py.
| Context homeassistant.helpers.template.TemplateStateBase.context | ( | self | ) |
Wrap State.context.
Definition at line 1100 of file template.py.
| str homeassistant.helpers.template.TemplateStateBase.domain | ( | self | ) |
Wrap State.domain.
Definition at line 1106 of file template.py.
| str homeassistant.helpers.template.TemplateStateBase.entity_id | ( | self | ) |
Wrap State.entity_id. Intentionally does not collect state
Definition at line 1062 of file template.py.
| str homeassistant.helpers.template.TemplateStateBase.format_state | ( | self, | |
| bool | rounded, | ||
| bool | with_unit | ||
| ) |
Return a formatted version of the state.
Definition at line 1128 of file template.py.
| datetime homeassistant.helpers.template.TemplateStateBase.last_changed | ( | self | ) |
Wrap State.last_changed.
Definition at line 1082 of file template.py.
| datetime homeassistant.helpers.template.TemplateStateBase.last_reported | ( | self | ) |
Wrap State.last_reported.
Definition at line 1088 of file template.py.
| datetime homeassistant.helpers.template.TemplateStateBase.last_updated | ( | self | ) |
Wrap State.last_updated.
Definition at line 1094 of file template.py.
| str homeassistant.helpers.template.TemplateStateBase.name | ( | self | ) |
Wrap State.name.
Reimplemented from homeassistant.core.State.
Definition at line 1118 of file template.py.
| str homeassistant.helpers.template.TemplateStateBase.object_id | ( | self | ) |
Wrap State.object_id.
Definition at line 1112 of file template.py.
| str homeassistant.helpers.template.TemplateStateBase.state | ( | self | ) |
Wrap State.state.
Definition at line 1070 of file template.py.
| str homeassistant.helpers.template.TemplateStateBase.state_with_unit | ( | self | ) |
Return the state concatenated with the unit if available.
Definition at line 1124 of file template.py.
|
staticprivate |
Definition at line 1031 of file template.py.
|
staticprivate |
Definition at line 1030 of file template.py.
|
staticprivate |
Definition at line 1026 of file template.py.
|
private |
Definition at line 1038 of file template.py.
|
private |
Definition at line 1039 of file template.py.
|
private |
Definition at line 1037 of file template.py.