From d7aaed05b7bbcb878ece722784952ffe77c3c325 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 28 Feb 2020 13:35:42 -0800 Subject: [PATCH] Clean up generic row (#5022) --- src/data/sensor.ts | 1 + .../more-info/controls/more-info-camera.ts | 2 +- .../notifications/notification-item.ts | 4 +- .../persistent-notification-item.ts | 2 +- .../ha-automation-condition-numeric_state.ts | 2 +- .../ha-automation-trigger-numeric_state.ts | 2 +- .../config/cloud/account/cloud-google-pref.ts | 2 +- src/panels/config/zha/zha-add-devices-page.ts | 2 +- .../config/zha/zha-cluster-attributes.ts | 4 +- src/panels/config/zha/zha-cluster-commands.ts | 4 +- src/panels/config/zha/zha-device-card.ts | 4 +- src/panels/config/zha/zha-device-page.ts | 12 +- .../lovelace/components/hui-action-editor.ts | 2 +- .../lovelace/components/hui-entity-editor.ts | 4 +- .../components/hui-generic-entity-row.ts | 119 +++++++++--------- src/panels/lovelace/components/hui-image.ts | 2 +- .../card-editor/hui-dialog-edit-card.ts | 6 +- .../card-editor/hui-dialog-suggest-card.ts | 2 +- .../hui-alarm-panel-card-editor.ts | 4 +- .../config-elements/hui-button-card-editor.ts | 8 +- .../hui-entities-card-editor.ts | 4 +- .../config-elements/hui-gauge-card-editor.ts | 4 +- .../config-elements/hui-glance-card-editor.ts | 4 +- .../hui-history-graph-card-editor.ts | 2 +- .../config-elements/hui-light-card-editor.ts | 4 +- .../config-elements/hui-map-card-editor.ts | 4 +- .../hui-markdown-card-editor.ts | 2 +- .../hui-media-control-card-editor.ts | 2 +- .../hui-picture-card-editor.ts | 6 +- .../hui-picture-entity-card-editor.ts | 10 +- .../hui-picture-glance-card-editor.ts | 12 +- .../hui-plant-status-card-editor.ts | 4 +- .../config-elements/hui-sensor-card-editor.ts | 4 +- .../hui-shopping-list-editor.ts | 2 +- .../config-elements/hui-stack-card-editor.ts | 2 +- .../hui-thermostat-card-editor.ts | 4 +- .../hui-weather-forecast-card-editor.ts | 4 +- .../hui-dialog-edit-lovelace.ts | 2 +- .../view-editor/hui-dialog-edit-view.ts | 2 +- .../editor/view-editor/hui-edit-view.ts | 4 +- .../lovelace/elements/hui-image-element.ts | 2 +- .../elements/hui-service-button-element.ts | 2 +- .../elements/hui-state-badge-element.ts | 2 +- .../elements/hui-state-icon-element.ts | 2 +- .../entity-rows/hui-climate-entity-row.ts | 6 +- .../entity-rows/hui-cover-entity-row.ts | 10 +- .../entity-rows/hui-group-entity-row.ts | 8 +- .../hui-input-datetime-entity-row.ts | 2 +- .../hui-input-number-entity-row.ts | 60 +++++---- .../entity-rows/hui-input-text-entity-row.ts | 2 +- .../entity-rows/hui-lock-entity-row.ts | 4 +- .../hui-media-player-entity-row.ts | 9 +- .../entity-rows/hui-scene-entity-row.ts | 19 +-- .../entity-rows/hui-script-entity-row.ts | 8 +- .../entity-rows/hui-sensor-entity-row.ts | 14 ++- .../entity-rows/hui-text-entity-row.ts | 4 +- .../entity-rows/hui-timer-entity-row.ts | 4 +- .../entity-rows/hui-toggle-entity-row.ts | 8 +- src/panels/lovelace/ha-panel-lovelace.ts | 2 +- src/panels/lovelace/hui-editor.ts | 2 +- 60 files changed, 213 insertions(+), 227 deletions(-) diff --git a/src/data/sensor.ts b/src/data/sensor.ts index e4da2f9825..7c05a30c08 100644 --- a/src/data/sensor.ts +++ b/src/data/sensor.ts @@ -1 +1,2 @@ export const SENSOR_DEVICE_CLASS_BATTERY = "battery"; +export const SENSOR_DEVICE_CLASS_TIMESTAMP = "timestamp"; diff --git a/src/dialogs/more-info/controls/more-info-camera.ts b/src/dialogs/more-info/controls/more-info-camera.ts index 2d2b3eece7..3dda7275b0 100644 --- a/src/dialogs/more-info/controls/more-info-camera.ts +++ b/src/dialogs/more-info/controls/more-info-camera.ts @@ -45,7 +45,7 @@ class MoreInfoCamera extends LitElement { return html` diff --git a/src/dialogs/notifications/notification-item.ts b/src/dialogs/notifications/notification-item.ts index d953a8b510..12c96da45e 100644 --- a/src/dialogs/notifications/notification-item.ts +++ b/src/dialogs/notifications/notification-item.ts @@ -36,13 +36,13 @@ export class HuiNotificationItem extends LitElement { return "entity_id" in this.notification ? html` ` : html` `; diff --git a/src/dialogs/notifications/persistent-notification-item.ts b/src/dialogs/notifications/persistent-notification-item.ts index bd87f7d885..3ef90bba41 100644 --- a/src/dialogs/notifications/persistent-notification-item.ts +++ b/src/dialogs/notifications/persistent-notification-item.ts @@ -39,7 +39,7 @@ export class HuiPersistentNotificationItem extends LitElement {
${this.device && this.device.device_type !== "Coordinator" ? html` @@ -92,7 +92,7 @@ export class ZHADevicePage extends LitElement { ? html` @@ -103,7 +103,7 @@ export class ZHADevicePage extends LitElement { diff --git a/src/panels/lovelace/components/hui-action-editor.ts b/src/panels/lovelace/components/hui-action-editor.ts index 0969574766..1fdd456131 100644 --- a/src/panels/lovelace/components/hui-action-editor.ts +++ b/src/panels/lovelace/components/hui-action-editor.ts @@ -106,7 +106,7 @@ export class HuiActionEditor extends LitElement { ${this.config && this.config.action === "call-service" ? html`
diff --git a/src/panels/lovelace/components/hui-generic-entity-row.ts b/src/panels/lovelace/components/hui-generic-entity-row.ts index 50fa3cb1ed..2a0336bb09 100644 --- a/src/panels/lovelace/components/hui-generic-entity-row.ts +++ b/src/panels/lovelace/components/hui-generic-entity-row.ts @@ -32,7 +32,7 @@ class HuiGenericEntityRow extends LitElement { @property() public config?: EntitiesCardEntityConfig; - @property() public showSecondary: boolean = true; + @property() public secondaryText?: string; protected render(): TemplateResult { if (!this.hass || !this.config) { @@ -59,6 +59,8 @@ class HuiGenericEntityRow extends LitElement { (this.config.entity && !DOMAINS_HIDE_MORE_INFO.includes(computeDomain(this.config.entity))); + const hasSecondary = this.secondaryText || this.config.secondary_info; + return html` -
-
- ${this.config.name || computeStateName(stateObj)} -
- ${!this.showSecondary - ? html` - - ` - : this.config.secondary_info === "entity-id" - ? stateObj.entity_id - : this.config.secondary_info === "last-changed" - ? html` - - ` - : this.config.secondary_info === "last-triggered" - ? stateObj.attributes.last_triggered - ? html` - - ` - : this.hass.localize( - "ui.panel.lovelace.cards.entities.never_triggered" - ) - : ""} -
-
- - +
+ ${this.config.name || computeStateName(stateObj)} + ${hasSecondary + ? html` +
+ ${this.secondaryText || + this.config.secondary_info === "entity-id" + ? stateObj.entity_id + : this.config.secondary_info === "last-changed" + ? html` + + ` + : this.config.secondary_info === "last-triggered" + ? stateObj.attributes.last_triggered + ? html` + + ` + : this.hass.localize( + "ui.panel.lovelace.cards.entities.never_triggered" + ) + : ""} + } +
+ ` + : ""}
+ `; } protected updated(changedProps: PropertyValues): void { super.updated(changedProps); + toggleAttribute( + this, + "no-secondary", + !this.secondaryText && !this.config?.secondary_info + ); if (changedProps.has("hass")) { toggleAttribute(this, "rtl", computeRTL(this.hass!)); } @@ -143,16 +145,10 @@ class HuiGenericEntityRow extends LitElement { :host { display: flex; align-items: center; - } - .flex { - flex: 1; - margin-left: 16px; - display: flex; - justify-content: space-between; - align-items: center; - min-width: 0; + flex-direction: row; } .info { + margin-left: 16px; flex: 1 0 60px; } .info, @@ -161,6 +157,11 @@ class HuiGenericEntityRow extends LitElement { overflow: hidden; text-overflow: ellipsis; } + :host([no-secondary]) .text-content, + :host([no-secondary]) ::slotted(.text-content) { + position: relative; + top: 2px; + } .flex ::slotted(*) { margin-left: 8px; min-width: 0; @@ -192,12 +193,6 @@ class HuiGenericEntityRow extends LitElement { .pointer { cursor: pointer; } - .padName { - padding: 12px 0px; - } - .padSecondary { - padding: 4px 0px; - } `; } } diff --git a/src/panels/lovelace/components/hui-image.ts b/src/panels/lovelace/components/hui-image.ts index a4457a8533..ff48cc9910 100644 --- a/src/panels/lovelace/components/hui-image.ts +++ b/src/panels/lovelace/components/hui-image.ts @@ -133,7 +133,7 @@ export class HuiImage extends LitElement { ${this.cameraImage && this.cameraView === "live" ? html` ` diff --git a/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts b/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts index 66e3ed2429..08f60fd5d8 100755 --- a/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts +++ b/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts @@ -99,7 +99,7 @@ export class HuiDialogEditCard extends LitElement { ${this._cardConfig === undefined ? html` ` @@ -107,14 +107,14 @@ export class HuiDialogEditCard extends LitElement {
diff --git a/src/panels/lovelace/editor/card-editor/hui-dialog-suggest-card.ts b/src/panels/lovelace/editor/card-editor/hui-dialog-suggest-card.ts index b76bf47ed9..b478663aab 100755 --- a/src/panels/lovelace/editor/card-editor/hui-dialog-suggest-card.ts +++ b/src/panels/lovelace/editor/card-editor/hui-dialog-suggest-card.ts @@ -78,7 +78,7 @@ export class HuiDialogSuggestCard extends LitElement { ${this._cardConfig.map( (cardConfig) => html` ` diff --git a/src/panels/lovelace/editor/config-elements/hui-alarm-panel-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-alarm-panel-card-editor.ts index 014ba22b90..e6bbf53ab6 100644 --- a/src/panels/lovelace/editor/config-elements/hui-alarm-panel-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-alarm-panel-card-editor.ts @@ -75,7 +75,7 @@ export class HuiAlarmPanelCardEditor extends LitElement )} (${this.hass.localize( "ui.panel.lovelace.editor.card.config.required" )})" - .hass="${this.hass}" + .hass=${this.hass} .value="${this._entity}" .configValue=${"entity"} include-domains='["alarm_control_panel"]' @@ -120,7 +120,7 @@ export class HuiAlarmPanelCardEditor extends LitElement
px
diff --git a/src/panels/lovelace/editor/config-elements/hui-gauge-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-gauge-card-editor.ts index e28d6c52cb..7924783cdc 100644 --- a/src/panels/lovelace/editor/config-elements/hui-gauge-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-gauge-card-editor.ts @@ -86,7 +86,7 @@ export class HuiGaugeCardEditor extends LitElement )} (${this.hass.localize( "ui.panel.lovelace.editor.card.config.required" )})" - .hass="${this.hass}" + .hass=${this.hass} .value="${this._entity}" .configValue=${"entity"} include-domains='["sensor"]' @@ -114,7 +114,7 @@ export class HuiGaugeCardEditor extends LitElement @value-changed="${this._valueChanged}" >
diff --git a/src/panels/lovelace/editor/config-elements/hui-history-graph-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-history-graph-card-editor.ts index ffa079ca3d..d8e1dfd134 100644 --- a/src/panels/lovelace/editor/config-elements/hui-history-graph-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-history-graph-card-editor.ts @@ -109,7 +109,7 @@ export class HuiHistoryGraphCardEditor extends LitElement >
diff --git a/src/panels/lovelace/editor/config-elements/hui-light-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-light-card-editor.ts index fccd34317b..2e8bf72542 100644 --- a/src/panels/lovelace/editor/config-elements/hui-light-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-light-card-editor.ts @@ -70,7 +70,7 @@ export class HuiLightCardEditor extends LitElement )} (${this.hass.localize( "ui.panel.lovelace.editor.card.config.required" )})" - .hass="${this.hass}" + .hass=${this.hass} .value="${this._entity}" .configValue=${"entity"} include-domains='["light"]' @@ -103,7 +103,7 @@ export class HuiLightCardEditor extends LitElement
@@ -135,7 +135,7 @@ export class HuiMapCardEditor extends LitElement implements LovelaceCardEditor { inputLabel=${this.hass.localize( "ui.panel.lovelace.editor.card.map.source" )} - .hass="${this.hass}" + .hass=${this.hass} .value="${this._geo_location_sources}" .configValue="${"geo_location_sources"}" @value-changed="${this._valueChanged}" diff --git a/src/panels/lovelace/editor/config-elements/hui-markdown-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-markdown-card-editor.ts index 7830aa3c4b..6bfd0c2f0a 100644 --- a/src/panels/lovelace/editor/config-elements/hui-markdown-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-markdown-card-editor.ts @@ -81,7 +81,7 @@ export class HuiMarkdownCardEditor extends LitElement spellcheck="false" >
` diff --git a/src/panels/lovelace/editor/config-elements/hui-thermostat-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-thermostat-card-editor.ts index 78b91ff9b4..575d8d6b2e 100644 --- a/src/panels/lovelace/editor/config-elements/hui-thermostat-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-thermostat-card-editor.ts @@ -63,7 +63,7 @@ export class HuiThermostatCardEditor extends LitElement )} (${this.hass.localize( "ui.panel.lovelace.editor.card.config.required" )})" - .hass="${this.hass}" + .hass=${this.hass} .value="${this._entity}" .configValue=${"entity"} include-domains='["climate"]' @@ -81,7 +81,7 @@ export class HuiThermostatCardEditor extends LitElement @value-changed="${this._valueChanged}" > diff --git a/src/panels/lovelace/editor/view-editor/hui-edit-view.ts b/src/panels/lovelace/editor/view-editor/hui-edit-view.ts index 1c44cc168a..ad7db50707 100644 --- a/src/panels/lovelace/editor/view-editor/hui-edit-view.ts +++ b/src/panels/lovelace/editor/view-editor/hui-edit-view.ts @@ -110,7 +110,7 @@ export class HuiEditView extends LitElement { content = html` @@ -119,7 +119,7 @@ export class HuiEditView extends LitElement { case "tab-badges": content = html` diff --git a/src/panels/lovelace/elements/hui-image-element.ts b/src/panels/lovelace/elements/hui-image-element.ts index b86c6f3ad2..07279d200c 100644 --- a/src/panels/lovelace/elements/hui-image-element.ts +++ b/src/panels/lovelace/elements/hui-image-element.ts @@ -43,7 +43,7 @@ export class HuiImageElement extends LitElement implements LovelaceElement { return html` + `; diff --git a/src/panels/lovelace/entity-rows/hui-cover-entity-row.ts b/src/panels/lovelace/entity-rows/hui-cover-entity-row.ts index 3b675768df..dbd67cb5b2 100644 --- a/src/panels/lovelace/entity-rows/hui-cover-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-cover-entity-row.ts @@ -56,18 +56,18 @@ class HuiCoverEntityRow extends LitElement implements LovelaceRow { } return html` - + ${isTiltOnly(stateObj) ? html` ` : html` `} diff --git a/src/panels/lovelace/entity-rows/hui-group-entity-row.ts b/src/panels/lovelace/entity-rows/hui-group-entity-row.ts index 530608ff70..f60e6a966d 100644 --- a/src/panels/lovelace/entity-rows/hui-group-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-group-entity-row.ts @@ -54,16 +54,16 @@ class HuiGroupEntityRow extends LitElement implements LovelaceRow { } return html` - + ${this._computeCanToggle(stateObj.attributes.entity_id) ? html` ` : html` -
+
${computeStateDisplay( this.hass!.localize, stateObj, diff --git a/src/panels/lovelace/entity-rows/hui-input-datetime-entity-row.ts b/src/panels/lovelace/entity-rows/hui-input-datetime-entity-row.ts index f236d09b3e..7afbc34dd6 100644 --- a/src/panels/lovelace/entity-rows/hui-input-datetime-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-input-datetime-entity-row.ts @@ -56,7 +56,7 @@ class HuiInputDatetimeEntityRow extends LitElement implements LovelaceRow { } return html` - + ${stateObj.attributes.has_date ? html` -
- ${stateObj.attributes.mode === "slider" - ? html` -
- - - ${Number(stateObj.state)} - ${stateObj.attributes.unit_of_measurement} - -
- ` - : html` - + ${stateObj.attributes.mode === "slider" + ? html` +
+ - `} -
+ > + + ${Number(stateObj.state)} + ${stateObj.attributes.unit_of_measurement} + +
+ ` + : html` + + `}
`; } diff --git a/src/panels/lovelace/entity-rows/hui-input-text-entity-row.ts b/src/panels/lovelace/entity-rows/hui-input-text-entity-row.ts index 7396249f28..e8fa7eb863 100644 --- a/src/panels/lovelace/entity-rows/hui-input-text-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-input-text-entity-row.ts @@ -53,7 +53,7 @@ class HuiInputTextEntityRow extends LitElement implements LovelaceRow { } return html` - + - + + ${stateObj.state === "locked" ? this.hass!.localize("ui.card.lock.unlock") : this.hass!.localize("ui.card.lock.lock")} diff --git a/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts b/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts index 55a3f0b66a..67c112e085 100644 --- a/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts @@ -64,13 +64,13 @@ class HuiMediaPlayerEntityRow extends LitElement implements LovelaceRow { return html` ${OFF_STATES.includes(stateObj.state) ? html` -
+
${this.hass!.localize(`state.media_player.${stateObj.state}`) || this.hass!.localize(`state.default.${stateObj.state}`) || stateObj.state} @@ -96,7 +96,6 @@ class HuiMediaPlayerEntityRow extends LitElement implements LovelaceRow { ` : ""}
-
${this._computeMediaTitle(stateObj)}
`} `; diff --git a/src/panels/lovelace/entity-rows/hui-scene-entity-row.ts b/src/panels/lovelace/entity-rows/hui-scene-entity-row.ts index 0cdbacfc44..7e096fbc88 100644 --- a/src/panels/lovelace/entity-rows/hui-scene-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-scene-entity-row.ts @@ -55,20 +55,11 @@ class HuiSceneEntityRow extends LitElement implements LovelaceRow { } return html` - - ${stateObj.attributes.can_cancel - ? html` - - ` - : html` - - ${this._config.action_name || - this.hass!.localize("ui.card.scene.activate")} - - `} + + + ${this._config.action_name || + this.hass!.localize("ui.card.scene.activate")} + `; } diff --git a/src/panels/lovelace/entity-rows/hui-script-entity-row.ts b/src/panels/lovelace/entity-rows/hui-script-entity-row.ts index 3300b0fc6e..bc0dd5b468 100644 --- a/src/panels/lovelace/entity-rows/hui-script-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-script-entity-row.ts @@ -54,16 +54,16 @@ class HuiScriptEntityRow extends LitElement implements LovelaceRow { } return html` - + ${stateObj.attributes.can_cancel ? html` ` : html` - + ${this._config.action_name || this.hass!.localize("ui.card.script.execute")} diff --git a/src/panels/lovelace/entity-rows/hui-sensor-entity-row.ts b/src/panels/lovelace/entity-rows/hui-sensor-entity-row.ts index 5907011139..f3f4e6da7e 100644 --- a/src/panels/lovelace/entity-rows/hui-sensor-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-sensor-entity-row.ts @@ -17,6 +17,7 @@ import { HomeAssistant } from "../../../types"; import { LovelaceRow, EntityConfig } from "./types"; import { hasConfigOrEntityChanged } from "../common/has-changed"; import { computeStateDisplay } from "../../../common/entity/compute_state_display"; +import { SENSOR_DEVICE_CLASS_TIMESTAMP } from "../../../data/sensor"; interface SensorEntityConfig extends EntityConfig { format?: "relative" | "date" | "time" | "datetime"; @@ -59,16 +60,17 @@ class HuiSensorEntityRow extends LitElement implements LovelaceRow { } return html` - -
- ${stateObj.attributes.device_class === "timestamp" && + +
+ ${stateObj.attributes.device_class === + SENSOR_DEVICE_CLASS_TIMESTAMP && stateObj.state !== "unavailable" && stateObj.state !== "unknown" ? html` ` : computeStateDisplay( diff --git a/src/panels/lovelace/entity-rows/hui-text-entity-row.ts b/src/panels/lovelace/entity-rows/hui-text-entity-row.ts index 9dcc0e6a28..45ccce5afb 100644 --- a/src/panels/lovelace/entity-rows/hui-text-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-text-entity-row.ts @@ -54,8 +54,8 @@ class HuiTextEntityRow extends LitElement implements LovelaceRow { } return html` - -
+ +
${computeStateDisplay( this.hass!.localize, stateObj, diff --git a/src/panels/lovelace/entity-rows/hui-timer-entity-row.ts b/src/panels/lovelace/entity-rows/hui-timer-entity-row.ts index 9ba7896235..4e5bcb71bb 100644 --- a/src/panels/lovelace/entity-rows/hui-timer-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-timer-entity-row.ts @@ -70,8 +70,8 @@ class HuiTimerEntityRow extends LitElement { } return html` - -
${this._computeDisplay(stateObj)}
+ +
${this._computeDisplay(stateObj)}
`; } diff --git a/src/panels/lovelace/entity-rows/hui-toggle-entity-row.ts b/src/panels/lovelace/entity-rows/hui-toggle-entity-row.ts index 00568506b2..b166ba9d2b 100644 --- a/src/panels/lovelace/entity-rows/hui-toggle-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-toggle-entity-row.ts @@ -53,16 +53,16 @@ class HuiToggleEntityRow extends LitElement implements LovelaceRow { } return html` - + ${stateObj.state === "on" || stateObj.state === "off" ? html` ` : html` -
+
${computeStateDisplay( this.hass!.localize, stateObj, diff --git a/src/panels/lovelace/ha-panel-lovelace.ts b/src/panels/lovelace/ha-panel-lovelace.ts index 9cf9f46cd7..1b30c6938d 100644 --- a/src/panels/lovelace/ha-panel-lovelace.ts +++ b/src/panels/lovelace/ha-panel-lovelace.ts @@ -125,7 +125,7 @@ class LovelacePanel extends LitElement { if (state === "yaml-editor") { return html` diff --git a/src/panels/lovelace/hui-editor.ts b/src/panels/lovelace/hui-editor.ts index 502aae0af3..a66dd52e7f 100644 --- a/src/panels/lovelace/hui-editor.ts +++ b/src/panels/lovelace/hui-editor.ts @@ -92,7 +92,7 @@ class LovelaceFullConfigEditor extends LitElement { mode="yaml" autofocus .rtl=${computeRTL(this.hass)} - .hass="${this.hass}" + .hass=${this.hass} @value-changed="${this._yamlChanged}" @editor-save="${this._handleSave}" >