Clean up generic row (#5022)

This commit is contained in:
Paulus Schoutsen 2020-02-28 13:35:42 -08:00 committed by GitHub
parent c5fe5565bb
commit d7aaed05b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
60 changed files with 213 additions and 227 deletions

View File

@ -1 +1,2 @@
export const SENSOR_DEVICE_CLASS_BATTERY = "battery"; export const SENSOR_DEVICE_CLASS_BATTERY = "battery";
export const SENSOR_DEVICE_CLASS_TIMESTAMP = "timestamp";

View File

@ -45,7 +45,7 @@ class MoreInfoCamera extends LitElement {
return html` return html`
<ha-camera-stream <ha-camera-stream
.hass="${this.hass}" .hass=${this.hass}
.stateObj="${this.stateObj}" .stateObj="${this.stateObj}"
showcontrols showcontrols
></ha-camera-stream> ></ha-camera-stream>

View File

@ -36,13 +36,13 @@ export class HuiNotificationItem extends LitElement {
return "entity_id" in this.notification return "entity_id" in this.notification
? html` ? html`
<configurator-notification-item <configurator-notification-item
.hass="${this.hass}" .hass=${this.hass}
.notification="${this.notification}" .notification="${this.notification}"
></configurator-notification-item> ></configurator-notification-item>
` `
: html` : html`
<persistent-notification-item <persistent-notification-item
.hass="${this.hass}" .hass=${this.hass}
.notification="${this.notification}" .notification="${this.notification}"
></persistent-notification-item> ></persistent-notification-item>
`; `;

View File

@ -39,7 +39,7 @@ export class HuiPersistentNotificationItem extends LitElement {
<div class="time"> <div class="time">
<span> <span>
<ha-relative-time <ha-relative-time
.hass="${this.hass}" .hass=${this.hass}
.datetime="${this.notification.created_at}" .datetime="${this.notification.created_at}"
></ha-relative-time> ></ha-relative-time>
<paper-tooltip <paper-tooltip

View File

@ -26,7 +26,7 @@ export default class HaNumericStateCondition extends LitElement {
<ha-entity-picker <ha-entity-picker
.value="${entity_id}" .value="${entity_id}"
@value-changed="${this._entityPicked}" @value-changed="${this._entityPicked}"
.hass="${this.hass}" .hass=${this.hass}
allow-custom-entity allow-custom-entity
></ha-entity-picker> ></ha-entity-picker>
<paper-input <paper-input

View File

@ -42,7 +42,7 @@ export default class HaNumericStateTrigger extends LitElement {
<ha-entity-picker <ha-entity-picker
.value="${entity_id}" .value="${entity_id}"
@value-changed="${this._entityPicked}" @value-changed="${this._entityPicked}"
.hass="${this.hass}" .hass=${this.hass}
allow-custom-entity allow-custom-entity
></ha-entity-picker> ></ha-entity-picker>
<paper-input <paper-input

View File

@ -118,7 +118,7 @@ export class CloudGooglePref extends LitElement {
</div> </div>
<div class="card-actions"> <div class="card-actions">
<ha-call-api-button <ha-call-api-button
.hass="${this.hass}" .hass=${this.hass}
.disabled="${!google_enabled}" .disabled="${!google_enabled}"
@hass-api-called=${this._syncEntitiesCalled} @hass-api-called=${this._syncEntitiesCalled}
path="cloud/google_actions/sync" path="cloud/google_actions/sync"

View File

@ -84,7 +84,7 @@ class ZHAAddDevicesPage extends LitElement {
${this._showHelp ${this._showHelp
? html` ? html`
<ha-service-description <ha-service-description
.hass="${this.hass}" .hass=${this.hass}
domain="zha" domain="zha"
service="permit" service="permit"
class="help-text" class="help-text"

View File

@ -165,7 +165,7 @@ export class ZHAClusterAttributes extends LitElement {
` `
: ""} : ""}
<ha-call-service-button <ha-call-service-button
.hass="${this.hass}" .hass=${this.hass}
domain="zha" domain="zha"
service="set_zigbee_cluster_attribute" service="set_zigbee_cluster_attribute"
.serviceData="${this._setAttributeServiceData}" .serviceData="${this._setAttributeServiceData}"
@ -177,7 +177,7 @@ export class ZHAClusterAttributes extends LitElement {
${this.showHelp ${this.showHelp
? html` ? html`
<ha-service-description <ha-service-description
.hass="${this.hass}" .hass=${this.hass}
domain="zha" domain="zha"
service="set_zigbee_cluster_attribute" service="set_zigbee_cluster_attribute"
class="help-text2" class="help-text2"

View File

@ -127,7 +127,7 @@ export class ZHAClusterCommands extends LitElement {
</div> </div>
<div class="card-actions"> <div class="card-actions">
<ha-call-service-button <ha-call-service-button
.hass="${this.hass}" .hass=${this.hass}
domain="zha" domain="zha"
service="issue_zigbee_cluster_command" service="issue_zigbee_cluster_command"
.serviceData="${this._issueClusterCommandServiceData}" .serviceData="${this._issueClusterCommandServiceData}"
@ -139,7 +139,7 @@ export class ZHAClusterCommands extends LitElement {
${this._showHelp ${this._showHelp
? html` ? html`
<ha-service-description <ha-service-description
.hass="${this.hass}" .hass=${this.hass}
domain="zha" domain="zha"
service="issue_zigbee_cluster_command" service="issue_zigbee_cluster_command"
class="help-text2" class="help-text2"

View File

@ -299,7 +299,7 @@ class ZHADeviceCard extends LitElement {
: ""} : ""}
<ha-call-service-button <ha-call-service-button
.hass="${this.hass}" .hass=${this.hass}
domain="zha" domain="zha"
service="remove" service="remove"
.confirmation=${this.hass!.localize( .confirmation=${this.hass!.localize(
@ -331,7 +331,7 @@ class ZHADeviceCard extends LitElement {
${this.showHelp ${this.showHelp
? html` ? html`
<ha-service-description <ha-service-description
.hass="${this.hass}" .hass=${this.hass}
domain="zha" domain="zha"
service="permit" service="permit"
class="help-text2" class="help-text2"

View File

@ -59,14 +59,14 @@ export class ZHADevicePage extends LitElement {
> >
<zha-node <zha-node
.isWide="${this.isWide}" .isWide="${this.isWide}"
.hass="${this.hass}" .hass=${this.hass}
.device=${this.device} .device=${this.device}
></zha-node> ></zha-node>
${this.device && this.device.device_type !== "Coordinator" ${this.device && this.device.device_type !== "Coordinator"
? html` ? html`
<zha-clusters <zha-clusters
.hass="${this.hass}" .hass=${this.hass}
.isWide="${this.isWide}" .isWide="${this.isWide}"
.selectedDevice="${this.device}" .selectedDevice="${this.device}"
@zha-cluster-selected="${this._onClusterSelected}" @zha-cluster-selected="${this._onClusterSelected}"
@ -75,14 +75,14 @@ export class ZHADevicePage extends LitElement {
? html` ? html`
<zha-cluster-attributes <zha-cluster-attributes
.isWide="${this.isWide}" .isWide="${this.isWide}"
.hass="${this.hass}" .hass=${this.hass}
.selectedNode="${this.device}" .selectedNode="${this.device}"
.selectedCluster="${this._selectedCluster}" .selectedCluster="${this._selectedCluster}"
></zha-cluster-attributes> ></zha-cluster-attributes>
<zha-cluster-commands <zha-cluster-commands
.isWide="${this.isWide}" .isWide="${this.isWide}"
.hass="${this.hass}" .hass=${this.hass}
.selectedNode="${this.device}" .selectedNode="${this.device}"
.selectedCluster="${this._selectedCluster}" .selectedCluster="${this._selectedCluster}"
></zha-cluster-commands> ></zha-cluster-commands>
@ -92,7 +92,7 @@ export class ZHADevicePage extends LitElement {
? html` ? html`
<zha-device-binding-control <zha-device-binding-control
.isWide="${this.isWide}" .isWide="${this.isWide}"
.hass="${this.hass}" .hass=${this.hass}
.selectedDevice="${this.device}" .selectedDevice="${this.device}"
.bindableDevices="${this._bindableDevices}" .bindableDevices="${this._bindableDevices}"
></zha-device-binding-control> ></zha-device-binding-control>
@ -103,7 +103,7 @@ export class ZHADevicePage extends LitElement {
<zha-group-binding-control <zha-group-binding-control
.isWide="${this.isWide}" .isWide="${this.isWide}"
.narrow="${this.narrow}" .narrow="${this.narrow}"
.hass="${this.hass}" .hass=${this.hass}
.selectedDevice="${this.device}" .selectedDevice="${this.device}"
.groups="${this._groups}" .groups="${this._groups}"
></zha-group-binding-control> ></zha-group-binding-control>

View File

@ -106,7 +106,7 @@ export class HuiActionEditor extends LitElement {
${this.config && this.config.action === "call-service" ${this.config && this.config.action === "call-service"
? html` ? html`
<ha-service-picker <ha-service-picker
.hass="${this.hass}" .hass=${this.hass}
.value="${this._service}" .value="${this._service}"
.configValue="${"service"}" .configValue="${"service"}"
@value-changed="${this._valueChanged}" @value-changed="${this._valueChanged}"

View File

@ -46,7 +46,7 @@ export class HuiEntityEditor extends LitElement {
return html` return html`
<div class="entity"> <div class="entity">
<ha-entity-picker <ha-entity-picker
.hass="${this.hass}" .hass=${this.hass}
.value="${entityConf.entity}" .value="${entityConf.entity}"
.index="${index}" .index="${index}"
@change="${this._valueChanged}" @change="${this._valueChanged}"
@ -70,7 +70,7 @@ export class HuiEntityEditor extends LitElement {
`; `;
})} })}
<ha-entity-picker <ha-entity-picker
.hass="${this.hass}" .hass=${this.hass}
@change="${this._addEntity}" @change="${this._addEntity}"
></ha-entity-picker> ></ha-entity-picker>
</div> </div>

View File

@ -32,7 +32,7 @@ class HuiGenericEntityRow extends LitElement {
@property() public config?: EntitiesCardEntityConfig; @property() public config?: EntitiesCardEntityConfig;
@property() public showSecondary: boolean = true; @property() public secondaryText?: string;
protected render(): TemplateResult { protected render(): TemplateResult {
if (!this.hass || !this.config) { if (!this.hass || !this.config) {
@ -59,6 +59,8 @@ class HuiGenericEntityRow extends LitElement {
(this.config.entity && (this.config.entity &&
!DOMAINS_HIDE_MORE_INFO.includes(computeDomain(this.config.entity))); !DOMAINS_HIDE_MORE_INFO.includes(computeDomain(this.config.entity)));
const hasSecondary = this.secondaryText || this.config.secondary_info;
return html` return html`
<state-badge <state-badge
class=${classMap({ class=${classMap({
@ -76,16 +78,11 @@ class HuiGenericEntityRow extends LitElement {
})} })}
tabindex=${ifDefined(pointer ? "0" : undefined)} tabindex=${ifDefined(pointer ? "0" : undefined)}
></state-badge> ></state-badge>
<div class="flex">
<div <div
class=${classMap({ class="info ${classMap({
info: true,
pointer, pointer,
padName: this.showSecondary && !this.config.secondary_info, "text-content": !hasSecondary,
padSecondary: Boolean( })}"
!this.showSecondary || this.config.secondary_info
),
})}
@action=${this._handleAction} @action=${this._handleAction}
.actionHandler=${actionHandler({ .actionHandler=${actionHandler({
hasHold: hasAction(this.config!.hold_action), hasHold: hasAction(this.config!.hold_action),
@ -93,12 +90,11 @@ class HuiGenericEntityRow extends LitElement {
})} })}
> >
${this.config.name || computeStateName(stateObj)} ${this.config.name || computeStateName(stateObj)}
<div class="secondary"> ${hasSecondary
${!this.showSecondary
? html` ? html`
<slot name="secondary"></slot> <div class="secondary">
` ${this.secondaryText ||
: this.config.secondary_info === "entity-id" this.config.secondary_info === "entity-id"
? stateObj.entity_id ? stateObj.entity_id
: this.config.secondary_info === "last-changed" : this.config.secondary_info === "last-changed"
? html` ? html`
@ -119,16 +115,22 @@ class HuiGenericEntityRow extends LitElement {
"ui.panel.lovelace.cards.entities.never_triggered" "ui.panel.lovelace.cards.entities.never_triggered"
) )
: ""} : ""}
}
</div> </div>
`
: ""}
</div> </div>
<slot></slot> <slot></slot>
</div>
`; `;
} }
protected updated(changedProps: PropertyValues): void { protected updated(changedProps: PropertyValues): void {
super.updated(changedProps); super.updated(changedProps);
toggleAttribute(
this,
"no-secondary",
!this.secondaryText && !this.config?.secondary_info
);
if (changedProps.has("hass")) { if (changedProps.has("hass")) {
toggleAttribute(this, "rtl", computeRTL(this.hass!)); toggleAttribute(this, "rtl", computeRTL(this.hass!));
} }
@ -143,16 +145,10 @@ class HuiGenericEntityRow extends LitElement {
:host { :host {
display: flex; display: flex;
align-items: center; align-items: center;
} flex-direction: row;
.flex {
flex: 1;
margin-left: 16px;
display: flex;
justify-content: space-between;
align-items: center;
min-width: 0;
} }
.info { .info {
margin-left: 16px;
flex: 1 0 60px; flex: 1 0 60px;
} }
.info, .info,
@ -161,6 +157,11 @@ class HuiGenericEntityRow extends LitElement {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
:host([no-secondary]) .text-content,
:host([no-secondary]) ::slotted(.text-content) {
position: relative;
top: 2px;
}
.flex ::slotted(*) { .flex ::slotted(*) {
margin-left: 8px; margin-left: 8px;
min-width: 0; min-width: 0;
@ -192,12 +193,6 @@ class HuiGenericEntityRow extends LitElement {
.pointer { .pointer {
cursor: pointer; cursor: pointer;
} }
.padName {
padding: 12px 0px;
}
.padSecondary {
padding: 4px 0px;
}
`; `;
} }
} }

View File

@ -133,7 +133,7 @@ export class HuiImage extends LitElement {
${this.cameraImage && this.cameraView === "live" ${this.cameraImage && this.cameraView === "live"
? html` ? html`
<ha-camera-stream <ha-camera-stream
.hass="${this.hass}" .hass=${this.hass}
.stateObj="${cameraObj}" .stateObj="${cameraObj}"
></ha-camera-stream> ></ha-camera-stream>
` `

View File

@ -99,7 +99,7 @@ export class HuiDialogEditCard extends LitElement {
${this._cardConfig === undefined ${this._cardConfig === undefined
? html` ? html`
<hui-card-picker <hui-card-picker
.hass="${this.hass}" .hass=${this.hass}
@config-changed="${this._handleCardPicked}" @config-changed="${this._handleCardPicked}"
></hui-card-picker> ></hui-card-picker>
` `
@ -107,14 +107,14 @@ export class HuiDialogEditCard extends LitElement {
<div class="content"> <div class="content">
<div class="element-editor"> <div class="element-editor">
<hui-card-editor <hui-card-editor
.hass="${this.hass}" .hass=${this.hass}
.value="${this._cardConfig}" .value="${this._cardConfig}"
@config-changed="${this._handleConfigChanged}" @config-changed="${this._handleConfigChanged}"
></hui-card-editor> ></hui-card-editor>
</div> </div>
<div class="element-preview"> <div class="element-preview">
<hui-card-preview <hui-card-preview
.hass="${this.hass}" .hass=${this.hass}
.config="${this._cardConfig}" .config="${this._cardConfig}"
class=${this._error ? "blur" : ""} class=${this._error ? "blur" : ""}
></hui-card-preview> ></hui-card-preview>

View File

@ -78,7 +78,7 @@ export class HuiDialogSuggestCard extends LitElement {
${this._cardConfig.map( ${this._cardConfig.map(
(cardConfig) => html` (cardConfig) => html`
<hui-card-preview <hui-card-preview
.hass="${this.hass}" .hass=${this.hass}
.config="${cardConfig}" .config="${cardConfig}"
></hui-card-preview> ></hui-card-preview>
` `

View File

@ -75,7 +75,7 @@ export class HuiAlarmPanelCardEditor extends LitElement
)} (${this.hass.localize( )} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.required" "ui.panel.lovelace.editor.card.config.required"
)})" )})"
.hass="${this.hass}" .hass=${this.hass}
.value="${this._entity}" .value="${this._entity}"
.configValue=${"entity"} .configValue=${"entity"}
include-domains='["alarm_control_panel"]' include-domains='["alarm_control_panel"]'
@ -120,7 +120,7 @@ export class HuiAlarmPanelCardEditor extends LitElement
</paper-listbox> </paper-listbox>
</paper-dropdown-menu> </paper-dropdown-menu>
<hui-theme-select-editor <hui-theme-select-editor
.hass="${this.hass}" .hass=${this.hass}
.value="${this._theme}" .value="${this._theme}"
.configValue="${"theme"}" .configValue="${"theme"}"
@theme-changed="${this._valueChanged}" @theme-changed="${this._valueChanged}"

View File

@ -110,7 +110,7 @@ export class HuiButtonCardEditor extends LitElement
)} (${this.hass.localize( )} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.optional" "ui.panel.lovelace.editor.card.config.optional"
)})" )})"
.hass="${this.hass}" .hass=${this.hass}
.value="${this._entity}" .value="${this._entity}"
.configValue=${"entity"} .configValue=${"entity"}
@change="${this._valueChanged}" @change="${this._valueChanged}"
@ -170,7 +170,7 @@ export class HuiButtonCardEditor extends LitElement
><div class="suffix" slot="suffix">px</div> ><div class="suffix" slot="suffix">px</div>
</paper-input> </paper-input>
<hui-theme-select-editor <hui-theme-select-editor
.hass="${this.hass}" .hass=${this.hass}
.value="${this._theme}" .value="${this._theme}"
.configValue="${"theme"}" .configValue="${"theme"}"
@theme-changed="${this._valueChanged}" @theme-changed="${this._valueChanged}"
@ -185,7 +185,7 @@ export class HuiButtonCardEditor extends LitElement
)} (${this.hass.localize( )} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.optional" "ui.panel.lovelace.editor.card.config.optional"
)})" )})"
.hass="${this.hass}" .hass=${this.hass}
.config="${this._tap_action}" .config="${this._tap_action}"
.actions="${actions}" .actions="${actions}"
.configValue="${"tap_action"}" .configValue="${"tap_action"}"
@ -197,7 +197,7 @@ export class HuiButtonCardEditor extends LitElement
)} (${this.hass.localize( )} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.optional" "ui.panel.lovelace.editor.card.config.optional"
)})" )})"
.hass="${this.hass}" .hass=${this.hass}
.config="${this._hold_action}" .config="${this._hold_action}"
.actions="${actions}" .actions="${actions}"
.configValue="${"hold_action"}" .configValue="${"hold_action"}"

View File

@ -85,7 +85,7 @@ export class HuiEntitiesCardEditor extends LitElement
@value-changed="${this._valueChanged}" @value-changed="${this._valueChanged}"
></paper-input> ></paper-input>
<hui-theme-select-editor <hui-theme-select-editor
.hass="${this.hass}" .hass=${this.hass}
.value="${this._theme}" .value="${this._theme}"
.configValue="${"theme"}" .configValue="${"theme"}"
@theme-changed="${this._valueChanged}" @theme-changed="${this._valueChanged}"
@ -100,7 +100,7 @@ export class HuiEntitiesCardEditor extends LitElement
> >
</div> </div>
<hui-entity-editor <hui-entity-editor
.hass="${this.hass}" .hass=${this.hass}
.entities="${this._configEntities}" .entities="${this._configEntities}"
@entities-changed="${this._valueChanged}" @entities-changed="${this._valueChanged}"
></hui-entity-editor> ></hui-entity-editor>

View File

@ -86,7 +86,7 @@ export class HuiGaugeCardEditor extends LitElement
)} (${this.hass.localize( )} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.required" "ui.panel.lovelace.editor.card.config.required"
)})" )})"
.hass="${this.hass}" .hass=${this.hass}
.value="${this._entity}" .value="${this._entity}"
.configValue=${"entity"} .configValue=${"entity"}
include-domains='["sensor"]' include-domains='["sensor"]'
@ -114,7 +114,7 @@ export class HuiGaugeCardEditor extends LitElement
@value-changed="${this._valueChanged}" @value-changed="${this._valueChanged}"
></paper-input> ></paper-input>
<hui-theme-select-editor <hui-theme-select-editor
.hass="${this.hass}" .hass=${this.hass}
.value="${this._theme}" .value="${this._theme}"
.configValue="${"theme"}" .configValue="${"theme"}"
@theme-changed="${this._valueChanged}" @theme-changed="${this._valueChanged}"

View File

@ -99,7 +99,7 @@ export class HuiGlanceCardEditor extends LitElement
></paper-input> ></paper-input>
<div class="side-by-side"> <div class="side-by-side">
<hui-theme-select-editor <hui-theme-select-editor
.hass="${this.hass}" .hass=${this.hass}
.value="${this._theme}" .value="${this._theme}"
.configValue="${"theme"}" .configValue="${"theme"}"
@theme-changed="${this._valueChanged}" @theme-changed="${this._valueChanged}"
@ -144,7 +144,7 @@ export class HuiGlanceCardEditor extends LitElement
</div> </div>
</div> </div>
<hui-entity-editor <hui-entity-editor
.hass="${this.hass}" .hass=${this.hass}
.entities="${this._configEntities}" .entities="${this._configEntities}"
@entities-changed="${this._valueChanged}" @entities-changed="${this._valueChanged}"
></hui-entity-editor> ></hui-entity-editor>

View File

@ -109,7 +109,7 @@ export class HuiHistoryGraphCardEditor extends LitElement
></paper-input> ></paper-input>
</div> </div>
<hui-entity-editor <hui-entity-editor
.hass="${this.hass}" .hass=${this.hass}
.entities="${this._configEntities}" .entities="${this._configEntities}"
@entities-changed="${this._valueChanged}" @entities-changed="${this._valueChanged}"
></hui-entity-editor> ></hui-entity-editor>

View File

@ -70,7 +70,7 @@ export class HuiLightCardEditor extends LitElement
)} (${this.hass.localize( )} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.required" "ui.panel.lovelace.editor.card.config.required"
)})" )})"
.hass="${this.hass}" .hass=${this.hass}
.value="${this._entity}" .value="${this._entity}"
.configValue=${"entity"} .configValue=${"entity"}
include-domains='["light"]' include-domains='["light"]'
@ -103,7 +103,7 @@ export class HuiLightCardEditor extends LitElement
</div> </div>
<hui-theme-select-editor <hui-theme-select-editor
.hass="${this.hass}" .hass=${this.hass}
.value="${this._theme}" .value="${this._theme}"
.configValue="${"theme"}" .configValue="${"theme"}"
@theme-changed="${this._valueChanged}" @theme-changed="${this._valueChanged}"

View File

@ -121,7 +121,7 @@ export class HuiMapCardEditor extends LitElement implements LovelaceCardEditor {
)}</ha-switch )}</ha-switch
> >
<hui-entity-editor <hui-entity-editor
.hass="${this.hass}" .hass=${this.hass}
.entities="${this._configEntities}" .entities="${this._configEntities}"
@entities-changed="${this._entitiesValueChanged}" @entities-changed="${this._entitiesValueChanged}"
></hui-entity-editor> ></hui-entity-editor>
@ -135,7 +135,7 @@ export class HuiMapCardEditor extends LitElement implements LovelaceCardEditor {
inputLabel=${this.hass.localize( inputLabel=${this.hass.localize(
"ui.panel.lovelace.editor.card.map.source" "ui.panel.lovelace.editor.card.map.source"
)} )}
.hass="${this.hass}" .hass=${this.hass}
.value="${this._geo_location_sources}" .value="${this._geo_location_sources}"
.configValue="${"geo_location_sources"}" .configValue="${"geo_location_sources"}"
@value-changed="${this._valueChanged}" @value-changed="${this._valueChanged}"

View File

@ -81,7 +81,7 @@ export class HuiMarkdownCardEditor extends LitElement
spellcheck="false" spellcheck="false"
></paper-textarea> ></paper-textarea>
<hui-theme-select-editor <hui-theme-select-editor
.hass="${this.hass}" .hass=${this.hass}
.value="${this._theme}" .value="${this._theme}"
.configValue="${"theme"}" .configValue="${"theme"}"
@theme-changed="${this._valueChanged}" @theme-changed="${this._valueChanged}"

View File

@ -49,7 +49,7 @@ export class HuiMediaControlCardEditor extends LitElement
)} (${this.hass.localize( )} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.required" "ui.panel.lovelace.editor.card.config.required"
)})" )})"
.hass="${this.hass}" .hass=${this.hass}
.value="${this._entity}" .value="${this._entity}"
.configValue=${"entity"} .configValue=${"entity"}
include-domains='["media_player"]' include-domains='["media_player"]'

View File

@ -86,7 +86,7 @@ export class HuiPictureCardEditor extends LitElement
)} (${this.hass.localize( )} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.optional" "ui.panel.lovelace.editor.card.config.optional"
)})" )})"
.hass="${this.hass}" .hass=${this.hass}
.config="${this._tap_action}" .config="${this._tap_action}"
.actions="${actions}" .actions="${actions}"
.configValue="${"tap_action"}" .configValue="${"tap_action"}"
@ -98,14 +98,14 @@ export class HuiPictureCardEditor extends LitElement
)} (${this.hass.localize( )} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.optional" "ui.panel.lovelace.editor.card.config.optional"
)})" )})"
.hass="${this.hass}" .hass=${this.hass}
.config="${this._hold_action}" .config="${this._hold_action}"
.actions="${actions}" .actions="${actions}"
.configValue="${"hold_action"}" .configValue="${"hold_action"}"
@action-changed="${this._valueChanged}" @action-changed="${this._valueChanged}"
></hui-action-editor> ></hui-action-editor>
<hui-theme-select-editor <hui-theme-select-editor
.hass="${this.hass}" .hass=${this.hass}
.value="${this._theme}" .value="${this._theme}"
.configValue="${"theme"}" .configValue="${"theme"}"
@theme-changed="${this._valueChanged}" @theme-changed="${this._valueChanged}"

View File

@ -116,7 +116,7 @@ export class HuiPictureEntityCardEditor extends LitElement
)} (${this.hass.localize( )} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.required" "ui.panel.lovelace.editor.card.config.required"
)})" )})"
.hass="${this.hass}" .hass=${this.hass}
.value="${this._entity}" .value="${this._entity}"
.configValue=${"entity"} .configValue=${"entity"}
@change="${this._valueChanged}" @change="${this._valueChanged}"
@ -148,7 +148,7 @@ export class HuiPictureEntityCardEditor extends LitElement
)} (${this.hass.localize( )} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.optional" "ui.panel.lovelace.editor.card.config.optional"
)})" )})"
.hass="${this.hass}" .hass=${this.hass}
.value="${this._camera_image}" .value="${this._camera_image}"
.configValue=${"camera_image"} .configValue=${"camera_image"}
@change="${this._valueChanged}" @change="${this._valueChanged}"
@ -213,7 +213,7 @@ export class HuiPictureEntityCardEditor extends LitElement
)} (${this.hass.localize( )} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.optional" "ui.panel.lovelace.editor.card.config.optional"
)})" )})"
.hass="${this.hass}" .hass=${this.hass}
.config="${this._tap_action}" .config="${this._tap_action}"
.actions="${actions}" .actions="${actions}"
.configValue="${"tap_action"}" .configValue="${"tap_action"}"
@ -225,14 +225,14 @@ export class HuiPictureEntityCardEditor extends LitElement
)} (${this.hass.localize( )} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.optional" "ui.panel.lovelace.editor.card.config.optional"
)})" )})"
.hass="${this.hass}" .hass=${this.hass}
.config="${this._hold_action}" .config="${this._hold_action}"
.actions="${actions}" .actions="${actions}"
.configValue="${"hold_action"}" .configValue="${"hold_action"}"
@action-changed="${this._valueChanged}" @action-changed="${this._valueChanged}"
></hui-action-editor> ></hui-action-editor>
<hui-theme-select-editor <hui-theme-select-editor
.hass="${this.hass}" .hass=${this.hass}
.value="${this._theme}" .value="${this._theme}"
.configValue="${"theme"}" .configValue="${"theme"}"
@theme-changed="${this._valueChanged}" @theme-changed="${this._valueChanged}"

View File

@ -147,7 +147,7 @@ export class HuiPictureGlanceCardEditor extends LitElement
)} (${this.hass.localize( )} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.optional" "ui.panel.lovelace.editor.card.config.optional"
)})" )})"
.hass="${this.hass}" .hass=${this.hass}
.value="${this._camera_image}" .value="${this._camera_image}"
.configValue=${"camera_image"} .configValue=${"camera_image"}
@change="${this._valueChanged}" @change="${this._valueChanged}"
@ -193,7 +193,7 @@ export class HuiPictureGlanceCardEditor extends LitElement
)} (${this.hass.localize( )} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.optional" "ui.panel.lovelace.editor.card.config.optional"
)})" )})"
.hass="${this.hass}" .hass=${this.hass}
.value="${this._entity}" .value="${this._entity}"
.configValue=${"entity"} .configValue=${"entity"}
@change="${this._valueChanged}" @change="${this._valueChanged}"
@ -206,7 +206,7 @@ export class HuiPictureGlanceCardEditor extends LitElement
)} (${this.hass.localize( )} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.optional" "ui.panel.lovelace.editor.card.config.optional"
)})" )})"
.hass="${this.hass}" .hass=${this.hass}
.config="${this._tap_action}" .config="${this._tap_action}"
.actions="${actions}" .actions="${actions}"
.configValue="${"tap_action"}" .configValue="${"tap_action"}"
@ -218,7 +218,7 @@ export class HuiPictureGlanceCardEditor extends LitElement
)} (${this.hass.localize( )} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.optional" "ui.panel.lovelace.editor.card.config.optional"
)})" )})"
.hass="${this.hass}" .hass=${this.hass}
.config="${this._hold_action}" .config="${this._hold_action}"
.actions="${actions}" .actions="${actions}"
.configValue="${"hold_action"}" .configValue="${"hold_action"}"
@ -226,12 +226,12 @@ export class HuiPictureGlanceCardEditor extends LitElement
></hui-action-editor> ></hui-action-editor>
</div> </div>
<hui-entity-editor <hui-entity-editor
.hass="${this.hass}" .hass=${this.hass}
.entities="${this._configEntities}" .entities="${this._configEntities}"
@entities-changed="${this._valueChanged}" @entities-changed="${this._valueChanged}"
></hui-entity-editor> ></hui-entity-editor>
<hui-theme-select-editor <hui-theme-select-editor
.hass="${this.hass}" .hass=${this.hass}
.value="${this._theme}" .value="${this._theme}"
.configValue="${"theme"}" .configValue="${"theme"}"
@theme-changed="${this._valueChanged}" @theme-changed="${this._valueChanged}"

View File

@ -64,7 +64,7 @@ export class HuiPlantStatusCardEditor extends LitElement
)} (${this.hass.localize( )} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.required" "ui.panel.lovelace.editor.card.config.required"
)})" )})"
.hass="${this.hass}" .hass=${this.hass}
.value="${this._entity}" .value="${this._entity}"
.configValue=${"entity"} .configValue=${"entity"}
include-domains='["plant"]' include-domains='["plant"]'
@ -82,7 +82,7 @@ export class HuiPlantStatusCardEditor extends LitElement
@value-changed="${this._valueChanged}" @value-changed="${this._valueChanged}"
></paper-input> ></paper-input>
<hui-theme-select-editor <hui-theme-select-editor
.hass="${this.hass}" .hass=${this.hass}
.value="${this._theme}" .value="${this._theme}"
.configValue="${"theme"}" .configValue="${"theme"}"
@theme-changed="${this._valueChanged}" @theme-changed="${this._valueChanged}"

View File

@ -93,7 +93,7 @@ export class HuiSensorCardEditor extends LitElement
)} (${this.hass.localize( )} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.required" "ui.panel.lovelace.editor.card.config.required"
)})" )})"
.hass="${this.hass}" .hass=${this.hass}
.value="${this._entity}" .value="${this._entity}"
.configValue=${"entity"} .configValue=${"entity"}
include-domains='["sensor"]' include-domains='["sensor"]'
@ -167,7 +167,7 @@ export class HuiSensorCardEditor extends LitElement
</div> </div>
<div class="side-by-side"> <div class="side-by-side">
<hui-theme-select-editor <hui-theme-select-editor
.hass="${this.hass}" .hass=${this.hass}
.value="${this._theme}" .value="${this._theme}"
.configValue="${"theme"}" .configValue="${"theme"}"
@theme-changed="${this._valueChanged}" @theme-changed="${this._valueChanged}"

View File

@ -72,7 +72,7 @@ export class HuiShoppingListEditor extends LitElement
@value-changed="${this._valueChanged}" @value-changed="${this._valueChanged}"
></paper-input> ></paper-input>
<hui-theme-select-editor <hui-theme-select-editor
.hass="${this.hass}" .hass=${this.hass}
.value="${this._theme}" .value="${this._theme}"
.configValue="${"theme"}" .configValue="${"theme"}"
@theme-changed="${this._valueChanged}" @theme-changed="${this._valueChanged}"

View File

@ -101,7 +101,7 @@ export class HuiStackCardEditor extends LitElement
` `
: html` : html`
<hui-card-picker <hui-card-picker
.hass="${this.hass}" .hass=${this.hass}
@config-changed="${this._handleCardPicked}" @config-changed="${this._handleCardPicked}"
></hui-card-picker> ></hui-card-picker>
` `

View File

@ -63,7 +63,7 @@ export class HuiThermostatCardEditor extends LitElement
)} (${this.hass.localize( )} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.required" "ui.panel.lovelace.editor.card.config.required"
)})" )})"
.hass="${this.hass}" .hass=${this.hass}
.value="${this._entity}" .value="${this._entity}"
.configValue=${"entity"} .configValue=${"entity"}
include-domains='["climate"]' include-domains='["climate"]'
@ -81,7 +81,7 @@ export class HuiThermostatCardEditor extends LitElement
@value-changed="${this._valueChanged}" @value-changed="${this._valueChanged}"
></paper-input> ></paper-input>
<hui-theme-select-editor <hui-theme-select-editor
.hass="${this.hass}" .hass=${this.hass}
.value="${this._theme}" .value="${this._theme}"
.configValue="${"theme"}" .configValue="${"theme"}"
@theme-changed="${this._valueChanged}" @theme-changed="${this._valueChanged}"

View File

@ -62,7 +62,7 @@ export class HuiWeatherForecastCardEditor extends LitElement
)} (${this.hass.localize( )} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.required" "ui.panel.lovelace.editor.card.config.required"
)})" )})"
.hass="${this.hass}" .hass=${this.hass}
.value="${this._entity}" .value="${this._entity}"
.configValue=${"entity"} .configValue=${"entity"}
include-domains='["weather"]' include-domains='["weather"]'
@ -80,7 +80,7 @@ export class HuiWeatherForecastCardEditor extends LitElement
@value-changed="${this._valueChanged}" @value-changed="${this._valueChanged}"
></paper-input> ></paper-input>
<hui-theme-select-editor <hui-theme-select-editor
.hass="${this.hass}" .hass=${this.hass}
.value="${this._theme}" .value="${this._theme}"
.configValue="${"theme"}" .configValue="${"theme"}"
@theme-changed="${this._valueChanged}" @theme-changed="${this._valueChanged}"

View File

@ -65,7 +65,7 @@ export class HuiDialogEditLovelace extends LitElement {
"ui.panel.lovelace.editor.edit_lovelace.explanation" "ui.panel.lovelace.editor.edit_lovelace.explanation"
)} )}
<hui-lovelace-editor <hui-lovelace-editor
.hass="${this.hass}" .hass=${this.hass}
.config="${this._config}" .config="${this._config}"
@lovelace-config-changed="${this._ConfigChanged}" @lovelace-config-changed="${this._ConfigChanged}"
></hui-lovelace-editor ></hui-lovelace-editor

View File

@ -40,7 +40,7 @@ export class HuiDialogEditView extends LitElement {
} }
return html` return html`
<hui-edit-view <hui-edit-view
.hass="${this.hass}" .hass=${this.hass}
.lovelace="${this._params.lovelace}" .lovelace="${this._params.lovelace}"
.viewIndex="${this._params.viewIndex}" .viewIndex="${this._params.viewIndex}"
> >

View File

@ -110,7 +110,7 @@ export class HuiEditView extends LitElement {
content = html` content = html`
<hui-view-editor <hui-view-editor
.isNew=${this.viewIndex === undefined} .isNew=${this.viewIndex === undefined}
.hass="${this.hass}" .hass=${this.hass}
.config="${this._config}" .config="${this._config}"
@view-config-changed="${this._viewConfigChanged}" @view-config-changed="${this._viewConfigChanged}"
></hui-view-editor> ></hui-view-editor>
@ -119,7 +119,7 @@ export class HuiEditView extends LitElement {
case "tab-badges": case "tab-badges":
content = html` content = html`
<hui-entity-editor <hui-entity-editor
.hass="${this.hass}" .hass=${this.hass}
.entities="${this._badges}" .entities="${this._badges}"
@entities-changed="${this._badgesChanged}" @entities-changed="${this._badgesChanged}"
></hui-entity-editor> ></hui-entity-editor>

View File

@ -43,7 +43,7 @@ export class HuiImageElement extends LitElement implements LovelaceElement {
return html` return html`
<hui-image <hui-image
.hass="${this.hass}" .hass=${this.hass}
.entity="${this._config.entity}" .entity="${this._config.entity}"
.image="${this._config.image}" .image="${this._config.image}"
.stateImage="${this._config.state_image}" .stateImage="${this._config.state_image}"

View File

@ -52,7 +52,7 @@ export class HuiServiceButtonElement extends LitElement
return html` return html`
<ha-call-service-button <ha-call-service-button
.hass="${this.hass}" .hass=${this.hass}
.domain="${this._domain}" .domain="${this._domain}"
.service="${this._service}" .service="${this._service}"
.serviceData="${this._config.service_data}" .serviceData="${this._config.service_data}"

View File

@ -59,7 +59,7 @@ export class HuiStateBadgeElement extends LitElement
return html` return html`
<ha-state-label-badge <ha-state-label-badge
.hass="${this.hass}" .hass=${this.hass}
.state="${stateObj}" .state="${stateObj}"
.title="${this._config.title === undefined .title="${this._config.title === undefined
? computeStateName(stateObj) ? computeStateName(stateObj)

View File

@ -60,7 +60,7 @@ export class HuiStateIconElement extends LitElement implements LovelaceElement {
return html` return html`
<state-badge <state-badge
.stateObj="${stateObj}" .stateObj=${stateObj}
.title="${computeTooltip(this.hass, this._config)}" .title="${computeTooltip(this.hass, this._config)}"
@action=${this._handleAction} @action=${this._handleAction}
.actionHandler=${actionHandler({ .actionHandler=${actionHandler({

View File

@ -55,10 +55,10 @@ class HuiClimateEntityRow extends LitElement implements LovelaceRow {
} }
return html` return html`
<hui-generic-entity-row .hass="${this.hass}" .config="${this._config}"> <hui-generic-entity-row .hass=${this.hass} .config=${this._config}>
<ha-climate-state <ha-climate-state
.hass="${this.hass}" .hass=${this.hass}
.stateObj="${stateObj}" .stateObj=${stateObj}
></ha-climate-state> ></ha-climate-state>
</hui-generic-entity-row> </hui-generic-entity-row>
`; `;

View File

@ -56,18 +56,18 @@ class HuiCoverEntityRow extends LitElement implements LovelaceRow {
} }
return html` return html`
<hui-generic-entity-row .hass="${this.hass}" .config="${this._config}"> <hui-generic-entity-row .hass=${this.hass} .config=${this._config}>
${isTiltOnly(stateObj) ${isTiltOnly(stateObj)
? html` ? html`
<ha-cover-tilt-controls <ha-cover-tilt-controls
.hass="${this.hass}" .hass=${this.hass}
.stateObj="${stateObj}" .stateObj=${stateObj}
></ha-cover-tilt-controls> ></ha-cover-tilt-controls>
` `
: html` : html`
<ha-cover-controls <ha-cover-controls
.hass="${this.hass}" .hass=${this.hass}
.stateObj="${stateObj}" .stateObj=${stateObj}
></ha-cover-controls> ></ha-cover-controls>
`} `}
</hui-generic-entity-row> </hui-generic-entity-row>

View File

@ -54,16 +54,16 @@ class HuiGroupEntityRow extends LitElement implements LovelaceRow {
} }
return html` return html`
<hui-generic-entity-row .hass="${this.hass}" .config="${this._config}"> <hui-generic-entity-row .hass=${this.hass} .config=${this._config}>
${this._computeCanToggle(stateObj.attributes.entity_id) ${this._computeCanToggle(stateObj.attributes.entity_id)
? html` ? html`
<ha-entity-toggle <ha-entity-toggle
.hass="${this.hass}" .hass=${this.hass}
.stateObj="${stateObj}" .stateObj=${stateObj}
></ha-entity-toggle> ></ha-entity-toggle>
` `
: html` : html`
<div> <div class="text-content">
${computeStateDisplay( ${computeStateDisplay(
this.hass!.localize, this.hass!.localize,
stateObj, stateObj,

View File

@ -56,7 +56,7 @@ class HuiInputDatetimeEntityRow extends LitElement implements LovelaceRow {
} }
return html` return html`
<hui-generic-entity-row .hass="${this.hass}" .config="${this._config}"> <hui-generic-entity-row .hass=${this.hass} .config=${this._config}>
${stateObj.attributes.has_date ${stateObj.attributes.has_date
? html` ? html`
<ha-date-input <ha-date-input

View File

@ -74,8 +74,7 @@ class HuiInputNumberEntityRow extends LitElement implements LovelaceRow {
} }
return html` return html`
<hui-generic-entity-row .hass="${this.hass}" .config="${this._config}"> <hui-generic-entity-row .hass=${this.hass} .config=${this._config}>
<div>
${stateObj.attributes.mode === "slider" ${stateObj.attributes.mode === "slider"
? html` ? html`
<div class="flex"> <div class="flex">
@ -110,7 +109,6 @@ class HuiInputNumberEntityRow extends LitElement implements LovelaceRow {
id="input" id="input"
></paper-input> ></paper-input>
`} `}
</div>
</hui-generic-entity-row> </hui-generic-entity-row>
`; `;
} }

View File

@ -53,7 +53,7 @@ class HuiInputTextEntityRow extends LitElement implements LovelaceRow {
} }
return html` return html`
<hui-generic-entity-row .hass="${this.hass}" .config="${this._config}"> <hui-generic-entity-row .hass=${this.hass} .config=${this._config}>
<paper-input <paper-input
no-label-float no-label-float
.value="${stateObj.state}" .value="${stateObj.state}"

View File

@ -53,8 +53,8 @@ class HuiLockEntityRow extends LitElement implements LovelaceRow {
} }
return html` return html`
<hui-generic-entity-row .hass="${this.hass}" .config="${this._config}"> <hui-generic-entity-row .hass=${this.hass} .config=${this._config}>
<mwc-button @click="${this._callService}"> <mwc-button @click="${this._callService}" class="text-content">
${stateObj.state === "locked" ${stateObj.state === "locked"
? this.hass!.localize("ui.card.lock.unlock") ? this.hass!.localize("ui.card.lock.unlock")
: this.hass!.localize("ui.card.lock.lock")} : this.hass!.localize("ui.card.lock.lock")}

View File

@ -64,13 +64,13 @@ class HuiMediaPlayerEntityRow extends LitElement implements LovelaceRow {
return html` return html`
<hui-generic-entity-row <hui-generic-entity-row
.hass="${this.hass}" .hass=${this.hass}
.config="${this._config}" .config=${this._config}
.showSecondary=${false} .secondaryText=${this._computeMediaTitle(stateObj)}
> >
${OFF_STATES.includes(stateObj.state) ${OFF_STATES.includes(stateObj.state)
? html` ? html`
<div> <div class="text-content">
${this.hass!.localize(`state.media_player.${stateObj.state}`) || ${this.hass!.localize(`state.media_player.${stateObj.state}`) ||
this.hass!.localize(`state.default.${stateObj.state}`) || this.hass!.localize(`state.default.${stateObj.state}`) ||
stateObj.state} stateObj.state}
@ -96,7 +96,6 @@ class HuiMediaPlayerEntityRow extends LitElement implements LovelaceRow {
` `
: ""} : ""}
</div> </div>
<div slot="secondary">${this._computeMediaTitle(stateObj)}</div>
`} `}
</hui-generic-entity-row> </hui-generic-entity-row>
`; `;

View File

@ -55,20 +55,11 @@ class HuiSceneEntityRow extends LitElement implements LovelaceRow {
} }
return html` return html`
<hui-generic-entity-row .hass="${this.hass}" .config="${this._config}"> <hui-generic-entity-row .hass=${this.hass} .config=${this._config}>
${stateObj.attributes.can_cancel <mwc-button @click="${this._callService}" class="text-content">
? html`
<ha-entity-toggle
.hass="${this.hass}"
.stateObj="${stateObj}"
></ha-entity-toggle>
`
: html`
<mwc-button @click="${this._callService}">
${this._config.action_name || ${this._config.action_name ||
this.hass!.localize("ui.card.scene.activate")} this.hass!.localize("ui.card.scene.activate")}
</mwc-button> </mwc-button>
`}
</hui-generic-entity-row> </hui-generic-entity-row>
`; `;
} }

View File

@ -54,16 +54,16 @@ class HuiScriptEntityRow extends LitElement implements LovelaceRow {
} }
return html` return html`
<hui-generic-entity-row .hass="${this.hass}" .config="${this._config}"> <hui-generic-entity-row .hass=${this.hass} .config=${this._config}>
${stateObj.attributes.can_cancel ${stateObj.attributes.can_cancel
? html` ? html`
<ha-entity-toggle <ha-entity-toggle
.hass="${this.hass}" .hass=${this.hass}
.stateObj="${stateObj}" .stateObj=${stateObj}
></ha-entity-toggle> ></ha-entity-toggle>
` `
: html` : html`
<mwc-button @click="${this._callService}"> <mwc-button @click=${this._callService} class="text-content">
${this._config.action_name || ${this._config.action_name ||
this.hass!.localize("ui.card.script.execute")} this.hass!.localize("ui.card.script.execute")}
</mwc-button> </mwc-button>

View File

@ -17,6 +17,7 @@ import { HomeAssistant } from "../../../types";
import { LovelaceRow, EntityConfig } from "./types"; import { LovelaceRow, EntityConfig } from "./types";
import { hasConfigOrEntityChanged } from "../common/has-changed"; import { hasConfigOrEntityChanged } from "../common/has-changed";
import { computeStateDisplay } from "../../../common/entity/compute_state_display"; import { computeStateDisplay } from "../../../common/entity/compute_state_display";
import { SENSOR_DEVICE_CLASS_TIMESTAMP } from "../../../data/sensor";
interface SensorEntityConfig extends EntityConfig { interface SensorEntityConfig extends EntityConfig {
format?: "relative" | "date" | "time" | "datetime"; format?: "relative" | "date" | "time" | "datetime";
@ -59,16 +60,17 @@ class HuiSensorEntityRow extends LitElement implements LovelaceRow {
} }
return html` return html`
<hui-generic-entity-row .hass="${this.hass}" .config="${this._config}"> <hui-generic-entity-row .hass=${this.hass} .config=${this._config}>
<div> <div class="text-content">
${stateObj.attributes.device_class === "timestamp" && ${stateObj.attributes.device_class ===
SENSOR_DEVICE_CLASS_TIMESTAMP &&
stateObj.state !== "unavailable" && stateObj.state !== "unavailable" &&
stateObj.state !== "unknown" stateObj.state !== "unknown"
? html` ? html`
<hui-timestamp-display <hui-timestamp-display
.hass="${this.hass}" .hass=${this.hass}
.ts="${new Date(stateObj.state)}" .ts=${new Date(stateObj.state)}
.format="${this._config.format}" .format=${this._config.format}
></hui-timestamp-display> ></hui-timestamp-display>
` `
: computeStateDisplay( : computeStateDisplay(

View File

@ -54,8 +54,8 @@ class HuiTextEntityRow extends LitElement implements LovelaceRow {
} }
return html` return html`
<hui-generic-entity-row .hass="${this.hass}" .config="${this._config}"> <hui-generic-entity-row .hass=${this.hass} .config=${this._config}>
<div> <div class="text-content">
${computeStateDisplay( ${computeStateDisplay(
this.hass!.localize, this.hass!.localize,
stateObj, stateObj,

View File

@ -70,8 +70,8 @@ class HuiTimerEntityRow extends LitElement {
} }
return html` return html`
<hui-generic-entity-row .hass="${this.hass}" .config="${this._config}"> <hui-generic-entity-row .hass=${this.hass} .config=${this._config}>
<div>${this._computeDisplay(stateObj)}</div> <div class="text-content">${this._computeDisplay(stateObj)}</div>
</hui-generic-entity-row> </hui-generic-entity-row>
`; `;
} }

View File

@ -53,16 +53,16 @@ class HuiToggleEntityRow extends LitElement implements LovelaceRow {
} }
return html` return html`
<hui-generic-entity-row .hass="${this.hass}" .config="${this._config}"> <hui-generic-entity-row .hass=${this.hass} .config=${this._config}>
${stateObj.state === "on" || stateObj.state === "off" ${stateObj.state === "on" || stateObj.state === "off"
? html` ? html`
<ha-entity-toggle <ha-entity-toggle
.hass="${this.hass}" .hass=${this.hass}
.stateObj="${stateObj}" .stateObj=${stateObj}
></ha-entity-toggle> ></ha-entity-toggle>
` `
: html` : html`
<div> <div class="text-content">
${computeStateDisplay( ${computeStateDisplay(
this.hass!.localize, this.hass!.localize,
stateObj, stateObj,

View File

@ -125,7 +125,7 @@ class LovelacePanel extends LitElement {
if (state === "yaml-editor") { if (state === "yaml-editor") {
return html` return html`
<hui-editor <hui-editor
.hass="${this.hass}" .hass=${this.hass}
.lovelace="${this.lovelace}" .lovelace="${this.lovelace}"
.closeEditor="${this._closeEditor}" .closeEditor="${this._closeEditor}"
></hui-editor> ></hui-editor>

View File

@ -92,7 +92,7 @@ class LovelaceFullConfigEditor extends LitElement {
mode="yaml" mode="yaml"
autofocus autofocus
.rtl=${computeRTL(this.hass)} .rtl=${computeRTL(this.hass)}
.hass="${this.hass}" .hass=${this.hass}
@value-changed="${this._yamlChanged}" @value-changed="${this._yamlChanged}"
@editor-save="${this._handleSave}" @editor-save="${this._handleSave}"
> >