mirror of
https://github.com/home-assistant/core.git
synced 2025-08-28 08:51:41 +02:00
Adjust mqtt integration
This commit is contained in:
@@ -338,7 +338,7 @@ class MqttAlarm(
|
|||||||
"""Publish via mqtt."""
|
"""Publish via mqtt."""
|
||||||
command_template = self._config[CONF_COMMAND_TEMPLATE]
|
command_template = self._config[CONF_COMMAND_TEMPLATE]
|
||||||
values = {"action": action, "code": code}
|
values = {"action": action, "code": code}
|
||||||
payload = command_template.async_render(**values)
|
payload = command_template.async_render(**values, parse_result=False)
|
||||||
mqtt.async_publish(
|
mqtt.async_publish(
|
||||||
self.hass,
|
self.hass,
|
||||||
self._config[CONF_COMMAND_TOPIC],
|
self._config[CONF_COMMAND_TOPIC],
|
||||||
|
@@ -557,7 +557,7 @@ class MqttCover(
|
|||||||
position = kwargs[ATTR_POSITION]
|
position = kwargs[ATTR_POSITION]
|
||||||
percentage_position = position
|
percentage_position = position
|
||||||
if set_position_template is not None:
|
if set_position_template is not None:
|
||||||
position = set_position_template.async_render(**kwargs)
|
position = set_position_template.async_render(parse_result=False, **kwargs)
|
||||||
else:
|
else:
|
||||||
position = self.find_in_range_from_percent(position, COVER_PAYLOAD)
|
position = self.find_in_range_from_percent(position, COVER_PAYLOAD)
|
||||||
|
|
||||||
|
@@ -441,7 +441,9 @@ class MqttLightTemplate(
|
|||||||
mqtt.async_publish(
|
mqtt.async_publish(
|
||||||
self.hass,
|
self.hass,
|
||||||
self._topics[CONF_COMMAND_TOPIC],
|
self._topics[CONF_COMMAND_TOPIC],
|
||||||
self._templates[CONF_COMMAND_ON_TEMPLATE].async_render(**values),
|
self._templates[CONF_COMMAND_ON_TEMPLATE].async_render(
|
||||||
|
parse_result=False, **values
|
||||||
|
),
|
||||||
self._config[CONF_QOS],
|
self._config[CONF_QOS],
|
||||||
self._config[CONF_RETAIN],
|
self._config[CONF_RETAIN],
|
||||||
)
|
)
|
||||||
@@ -464,7 +466,9 @@ class MqttLightTemplate(
|
|||||||
mqtt.async_publish(
|
mqtt.async_publish(
|
||||||
self.hass,
|
self.hass,
|
||||||
self._topics[CONF_COMMAND_TOPIC],
|
self._topics[CONF_COMMAND_TOPIC],
|
||||||
self._templates[CONF_COMMAND_OFF_TEMPLATE].async_render(**values),
|
self._templates[CONF_COMMAND_OFF_TEMPLATE].async_render(
|
||||||
|
parse_result=False, **values
|
||||||
|
),
|
||||||
self._config[CONF_QOS],
|
self._config[CONF_QOS],
|
||||||
self._config[CONF_RETAIN],
|
self._config[CONF_RETAIN],
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user