Correct trace path for trigger with custom id (#51847)
This commit is contained in:
parent
a989677bef
commit
4c9f12b9c5
20 changed files with 46 additions and 42 deletions
|
@ -37,7 +37,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||
|
||||
async def async_attach_trigger(hass, config, action, automation_info):
|
||||
"""Listen for state changes based on configuration."""
|
||||
trigger_id = automation_info.get("trigger_id") if automation_info else None
|
||||
trigger_data = automation_info.get("trigger_data", {}) if automation_info else {}
|
||||
topic = config[CONF_TOPIC]
|
||||
wanted_payload = config.get(CONF_PAYLOAD)
|
||||
value_template = config.get(CONF_VALUE_TEMPLATE)
|
||||
|
@ -74,12 +74,12 @@ async def async_attach_trigger(hass, config, action, automation_info):
|
|||
|
||||
if wanted_payload is None or wanted_payload == payload:
|
||||
data = {
|
||||
**trigger_data,
|
||||
"platform": "mqtt",
|
||||
"topic": mqttmsg.topic,
|
||||
"payload": mqttmsg.payload,
|
||||
"qos": mqttmsg.qos,
|
||||
"description": f"mqtt topic {mqttmsg.topic}",
|
||||
"id": trigger_id,
|
||||
}
|
||||
|
||||
with suppress(ValueError):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue