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

Public Member Functions

None __init__ (self, template.Template|None command_template, *Entity|None entity=None)
 
PublishPayloadType async_render (self, PublishPayloadType value=None, TemplateVarsType variables=None)
 

Private Attributes

 _command_template
 
 _entity
 
 _template_state
 

Detailed Description

Class for rendering MQTT payload with command templates.

Definition at line 171 of file models.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.mqtt.models.MqttCommandTemplate.__init__ (   self,
template.Template | None  command_template,
*Entity | None   entity = None 
)
Instantiate a command template.

Definition at line 174 of file models.py.

Member Function Documentation

◆ async_render()

PublishPayloadType homeassistant.components.mqtt.models.MqttCommandTemplate.async_render (   self,
PublishPayloadType   value = None,
TemplateVarsType   variables = None 
)
Render or convert the command template with given value or variables.

Definition at line 186 of file models.py.

Member Data Documentation

◆ _command_template

homeassistant.components.mqtt.models.MqttCommandTemplate._command_template
private

Definition at line 182 of file models.py.

◆ _entity

homeassistant.components.mqtt.models.MqttCommandTemplate._entity
private

Definition at line 183 of file models.py.

◆ _template_state

homeassistant.components.mqtt.models.MqttCommandTemplate._template_state
private

Definition at line 200 of file models.py.


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