Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.mqtt.models.MqttValueTemplate Class Reference

Public Member Functions

None __init__ (self, template.Template|None value_template, *Entity|None entity=None, TemplateVarsType config_attributes=None)
 
ReceivePayloadType async_render_with_possible_json_value (self, ReceivePayloadType payload, ReceivePayloadType|PayloadSentinel default=PayloadSentinel.NONE, TemplateVarsType variables=None)
 

Private Attributes

 _config_attributes
 
 _entity
 
 _template_state
 
 _value_template
 

Detailed Description

Class for rendering MQTT value template with possible json values.

Definition at line 257 of file models.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.mqtt.models.MqttValueTemplate.__init__ (   self,
template.Template | None  value_template,
*Entity | None   entity = None,
TemplateVarsType   config_attributes = None 
)
Instantiate a value template.

Definition at line 260 of file models.py.

Member Function Documentation

◆ async_render_with_possible_json_value()

ReceivePayloadType homeassistant.components.mqtt.models.MqttValueTemplate.async_render_with_possible_json_value (   self,
ReceivePayloadType  payload,
ReceivePayloadType | PayloadSentinel   default = PayloadSentinel.NONE,
TemplateVarsType   variables = None 
)
Render with possible json value or pass-though a received MQTT value.

Definition at line 274 of file models.py.

Member Data Documentation

◆ _config_attributes

homeassistant.components.mqtt.models.MqttValueTemplate._config_attributes
private

Definition at line 270 of file models.py.

◆ _entity

homeassistant.components.mqtt.models.MqttValueTemplate._entity
private

Definition at line 271 of file models.py.

◆ _template_state

homeassistant.components.mqtt.models.MqttValueTemplate._template_state
private

Definition at line 298 of file models.py.

◆ _value_template

homeassistant.components.mqtt.models.MqttValueTemplate._value_template
private

Definition at line 269 of file models.py.


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