Skip to content

Commit f131e93

Browse files
Refactor automation editor event naming for consistency (#26634)
1 parent 5a540dd commit f131e93

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/data/automation.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@ import { migrateAutomationAction } from "./script";
1515
export const AUTOMATION_DEFAULT_MODE: (typeof MODES)[number] = "single";
1616
export const AUTOMATION_DEFAULT_MAX = 10;
1717

18-
declare global {
19-
interface HASSDomEvents {
20-
/**
21-
* Dispatched to open the automation editor.
22-
* Used by custom cards/panels to trigger the editor view.
23-
*/
24-
"show-automation-editor": ShowAutomationEditorParams;
25-
}
26-
}
27-
2818
export interface AutomationEntity extends HassEntityBase {
2919
attributes: HassEntityAttributeBase & {
3020
id?: string;

src/state/automation-editor-mixin.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,21 @@ import {
77
import type { Constructor } from "../types";
88
import type { HassBaseEl } from "./hass-base-mixin";
99

10+
declare global {
11+
interface HASSDomEvents {
12+
/**
13+
* Dispatched to open the automation editor.
14+
* Used by custom cards/panels to trigger the editor view.
15+
*/
16+
"hass-automation-editor": ShowAutomationEditorParams;
17+
}
18+
}
19+
1020
export default <T extends Constructor<HassBaseEl>>(superClass: T) =>
1121
class extends superClass {
1222
protected firstUpdated(changedProps: PropertyValues) {
1323
super.firstUpdated(changedProps);
14-
this.addEventListener("show-automation-editor", (ev) =>
24+
this.addEventListener("hass-automation-editor", (ev) =>
1525
this._handleShowAutomationEditor(
1626
ev as HASSDomEvent<ShowAutomationEditorParams>
1727
)

0 commit comments

Comments
 (0)