diff --git a/src/panels/config/automation/manual-automation-editor.ts b/src/panels/config/automation/manual-automation-editor.ts index 464e1b9ffc..8610c8e6b0 100644 --- a/src/panels/config/automation/manual-automation-editor.ts +++ b/src/panels/config/automation/manual-automation-editor.ts @@ -1,8 +1,8 @@ import "@material/mwc-button/mwc-button"; import { mdiHelpCircle, mdiRobot } from "@mdi/js"; import { HassEntity } from "home-assistant-js-websocket"; -import { css, CSSResultGroup, html, LitElement, PropertyValues } from "lit"; -import { customElement, property, state } from "lit/decorators"; +import { css, CSSResultGroup, html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../common/dom/fire_event"; import "../../../components/entity/ha-entity-toggle"; import "../../../components/ha-card"; @@ -35,20 +35,16 @@ export class HaManualAutomationEditor extends LitElement { @property({ attribute: false }) public stateObj?: HassEntity; - @state() private _showDescription = false; - protected render() { return html` - ${ - this.stateObj && this.stateObj.state === "off" - ? html`
- ${this.hass.localize( - "ui.panel.config.automation.editor.disabled" - )} -
` - : "" - } + ${this.stateObj && this.stateObj.state === "off" + ? html`
+ ${this.hass.localize( + "ui.panel.config.automation.editor.disabled" + )} +
` + : ""}
@@ -58,33 +54,18 @@ export class HaManualAutomationEditor extends LitElement { )}
- - ${ - this._showDescription - ? html` - - ` - : html` - - ` - } + - ${ - this.config.mode && isMaxMode(this.config.mode) - ? html` -
- - ` - : html`` - } + ${this.config.mode && isMaxMode(this.config.mode) + ? html` +
+ + ` + : html``}
@@ -216,17 +195,6 @@ export class HaManualAutomationEditor extends LitElement { `; } - protected willUpdate(changedProps: PropertyValues): void { - super.willUpdate(changedProps); - if ( - !this._showDescription && - changedProps.has("config") && - this.config.description - ) { - this._showDescription = true; - } - } - private _valueChanged(ev: CustomEvent) { ev.stopPropagation(); const target = ev.target as any; @@ -293,10 +261,6 @@ export class HaManualAutomationEditor extends LitElement { }); } - private _addDescription() { - this._showDescription = true; - } - static get styles(): CSSResultGroup { return [ haStyle, @@ -346,6 +310,9 @@ export class HaManualAutomationEditor extends LitElement { .card-content { padding: 16px; } + .card-content ha-textarea:first-child { + margin-top: -16px; + } .settings-icon { display: none; }