Add template support to mqtt.publish service payload.

This commit is contained in:
Flyte 2016-02-05 21:47:27 +00:00
parent 2ba237eac8
commit 4cf85294db

View File

@ -131,7 +131,7 @@ def setup(hass, config):
def publish_service(call):
"""Handle MQTT publish service calls."""
msg_topic = call.data.get(ATTR_TOPIC)
payload = call.data.get(ATTR_PAYLOAD)
payload = util.template.render(hass, call.data.get(ATTR_PAYLOAD))
qos = call.data.get(ATTR_QOS, DEFAULT_QOS)
retain = call.data.get(ATTR_RETAIN, DEFAULT_RETAIN)
if msg_topic is None or payload is None: