-
- ${this._uiWarnings!.map(
- (warning) => html`
- ${warning} ` - )} -
diff --git a/src/panels/lovelace/editor/conditions/ha-card-condition-editor.ts b/src/panels/lovelace/editor/conditions/ha-card-condition-editor.ts index d97264de1598..bf1841d22d04 100644 --- a/src/panels/lovelace/editor/conditions/ha-card-condition-editor.ts +++ b/src/panels/lovelace/editor/conditions/ha-card-condition-editor.ts @@ -8,10 +8,12 @@ import { fireEvent } from "../../../../common/dom/fire_event"; import { stopPropagation } from "../../../../common/dom/stop_propagation"; import { handleStructError } from "../../../../common/structs/handle-errors"; import "../../../../components/ha-button-menu"; +import "../../../../components/ha-expansion-panel"; import "../../../../components/ha-icon-button"; import "../../../../components/ha-list-item"; import "../../../../components/ha-svg-icon"; import "../../../../components/ha-yaml-editor"; +import "../../../../components/ha-alert"; import { haStyle } from "../../../../resources/styles"; import type { HomeAssistant } from "../../../../types"; import { ICON_CONDITION } from "../../common/icon-condition"; @@ -19,7 +21,7 @@ import { Condition, LegacyCondition } from "../../common/validate-condition"; import type { LovelaceConditionEditorConstructor } from "./types"; @customElement("ha-card-condition-editor") -export default class HaCardConditionEditor extends LitElement { +export class HaCardConditionEditor extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; @property({ attribute: false }) condition!: Condition | LegacyCondition; @@ -39,6 +41,12 @@ export default class HaCardConditionEditor extends LitElement { ) as LovelaceConditionEditorConstructor | undefined; } + public expand() { + this.updateComplete.then(() => { + this.shadowRoot!.querySelector("ha-expansion-panel")!.expanded = true; + }); + } + protected willUpdate(changedProperties: PropertyValues): void { if (changedProperties.has("condition")) { this._condition = { @@ -75,110 +83,130 @@ export default class HaCardConditionEditor extends LitElement { if (!condition) return nothing; return html` -