From a46e72ffbdcec197a0428a11567837f68055141f Mon Sep 17 00:00:00 2001 From: Brandon Rothweiler Date: Thu, 20 Oct 2022 05:20:46 -0400 Subject: [PATCH] Fix duplicate trigger IDs showing in the Triggered By condition (#14122) --- .../condition/types/ha-automation-condition-trigger.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-trigger.ts b/src/panels/config/automation/condition/types/ha-automation-condition-trigger.ts index ef4e22d56f..8c5e54f645 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-trigger.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-trigger.ts @@ -70,8 +70,11 @@ export class HaTriggerCondition extends LitElement { } private _automationUpdated(config?: AutomationConfig) { + const seenIds = new Set(); this._triggers = config?.trigger - ? ensureArray(config.trigger).filter((t) => t.id) + ? ensureArray(config.trigger).filter( + (t) => t.id && (seenIds.has(t.id) ? false : seenIds.add(t.id)) + ) : []; }