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
|
@ -76,13 +76,15 @@ class TriggerSource:
|
|||
automation_info: dict,
|
||||
) -> CALLBACK_TYPE:
|
||||
"""Attach a trigger."""
|
||||
trigger_id = automation_info.get("trigger_id") if automation_info else None
|
||||
trigger_data = (
|
||||
automation_info.get("trigger_data", {}) if automation_info else {}
|
||||
)
|
||||
|
||||
def event_handler(char):
|
||||
if config[CONF_SUBTYPE] != HK_TO_HA_INPUT_EVENT_VALUES[char["value"]]:
|
||||
return
|
||||
self._hass.async_create_task(
|
||||
action({"trigger": {**config, "id": trigger_id}})
|
||||
action({"trigger": {**trigger_data, **config}})
|
||||
)
|
||||
|
||||
trigger = self._triggers[config[CONF_TYPE], config[CONF_SUBTYPE]]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue