From f131e93e63a5fb11c5e94587e80b0aedcb58e0af Mon Sep 17 00:00:00 2001 From: Philipp Waller <1090452+philippwaller@users.noreply.github.com> Date: Thu, 21 Aug 2025 12:23:59 +0200 Subject: [PATCH] Refactor automation editor event naming for consistency (#26634) --- src/data/automation.ts | 10 ---------- src/state/automation-editor-mixin.ts | 12 +++++++++++- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/data/automation.ts b/src/data/automation.ts index 506453a4f2..9e5c5310e6 100644 --- a/src/data/automation.ts +++ b/src/data/automation.ts @@ -15,16 +15,6 @@ import { migrateAutomationAction } from "./script"; export const AUTOMATION_DEFAULT_MODE: (typeof MODES)[number] = "single"; export const AUTOMATION_DEFAULT_MAX = 10; -declare global { - interface HASSDomEvents { - /** - * Dispatched to open the automation editor. - * Used by custom cards/panels to trigger the editor view. - */ - "show-automation-editor": ShowAutomationEditorParams; - } -} - export interface AutomationEntity extends HassEntityBase { attributes: HassEntityAttributeBase & { id?: string; diff --git a/src/state/automation-editor-mixin.ts b/src/state/automation-editor-mixin.ts index 458c02702c..6a833d703a 100644 --- a/src/state/automation-editor-mixin.ts +++ b/src/state/automation-editor-mixin.ts @@ -7,11 +7,21 @@ import { import type { Constructor } from "../types"; import type { HassBaseEl } from "./hass-base-mixin"; +declare global { + interface HASSDomEvents { + /** + * Dispatched to open the automation editor. + * Used by custom cards/panels to trigger the editor view. + */ + "hass-automation-editor": ShowAutomationEditorParams; + } +} + export default >(superClass: T) => class extends superClass { protected firstUpdated(changedProps: PropertyValues) { super.firstUpdated(changedProps); - this.addEventListener("show-automation-editor", (ev) => + this.addEventListener("hass-automation-editor", (ev) => this._handleShowAutomationEditor( ev as HASSDomEvent )