mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-07 08:37:21 +00:00
Add show-automation-editor event for custom cards & panels (#26613)
* expose showAutomationEditor functionality in ha-panel-custom * drop connectedCallback change (leftover from earlier test) * enhance documentation for showAutomationEditor method * Add automation editor mixin and event declaration for show-automation-editor
This commit is contained in:
@@ -15,6 +15,16 @@ import { CONDITION_BUILDING_BLOCKS } from "./condition";
|
||||
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;
|
||||
@@ -546,3 +556,8 @@ export interface AutomationClipboard {
|
||||
condition?: Condition;
|
||||
action?: Action;
|
||||
}
|
||||
|
||||
export interface ShowAutomationEditorParams {
|
||||
data?: Partial<AutomationConfig>;
|
||||
expanded?: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user