Draw a <hr> above the attributes in more-info (#9090)

This commit is contained in:
Philip Allgaier 2021-05-04 22:04:27 +02:00 committed by GitHub
parent 344b11a204
commit 2c08cba8cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 38 additions and 10 deletions

View File

@ -27,13 +27,19 @@ class HaAttributes extends LitElement {
return html``; return html``;
} }
const attributes = this.computeDisplayAttributes(
Object.keys(hassAttributeUtil.LOGIC_STATE_ATTRIBUTES).concat(
this.extraFilters ? this.extraFilters.split(",") : []
)
);
if (attributes.length === 0) {
return html``;
}
return html` return html`
<hr />
<div> <div>
${this.computeDisplayAttributes( ${attributes.map(
Object.keys(hassAttributeUtil.LOGIC_STATE_ATTRIBUTES).concat(
this.extraFilters ? this.extraFilters.split(",") : []
)
).map(
(attribute) => html` (attribute) => html`
<div class="data-entry"> <div class="data-entry">
<div class="key">${formatAttributeName(attribute)}</div> <div class="key">${formatAttributeName(attribute)}</div>
@ -80,6 +86,11 @@ class HaAttributes extends LitElement {
overflow-wrap: break-word; overflow-wrap: break-word;
white-space: pre-line; white-space: pre-line;
} }
hr {
border-color: var(--divider-color);
border-bottom: none;
margin: 16px 0;
}
`, `,
]; ];
} }

View File

@ -26,6 +26,7 @@ class MoreInfoAutomation extends LitElement {
} }
return html` return html`
<hr />
<div class="flex"> <div class="flex">
<div>${this.hass.localize("ui.card.automation.last_triggered")}:</div> <div>${this.hass.localize("ui.card.automation.last_triggered")}:</div>
<ha-relative-time <ha-relative-time
@ -61,6 +62,11 @@ class MoreInfoAutomation extends LitElement {
flex-wrap: wrap; flex-wrap: wrap;
justify-content: center; justify-content: center;
} }
hr {
border-color: var(--divider-color);
border-bottom: none;
margin: 16px 0;
}
`; `;
} }
} }

View File

@ -102,7 +102,7 @@ class MoreInfoLight extends LitElement {
: ""} : ""}
${this.stateObj.state === "on" ${this.stateObj.state === "on"
? html` ? html`
${supportsTemp || supportsColor ? html`<hr></hr>` : ""} ${supportsTemp || supportsColor ? html`<hr />` : ""}
${supportsTemp && supportsColor ${supportsTemp && supportsColor
? html`<ha-button-toggle-group ? html`<ha-button-toggle-group
fullWidth fullWidth
@ -205,7 +205,7 @@ class MoreInfoLight extends LitElement {
${supportsFeature(this.stateObj, SUPPORT_EFFECT) && ${supportsFeature(this.stateObj, SUPPORT_EFFECT) &&
this.stateObj!.attributes.effect_list?.length this.stateObj!.attributes.effect_list?.length
? html` ? html`
<hr></hr> <hr />
<ha-paper-dropdown-menu <ha-paper-dropdown-menu
.label=${this.hass.localize("ui.card.light.effect")} .label=${this.hass.localize("ui.card.light.effect")}
> >
@ -560,7 +560,7 @@ class MoreInfoLight extends LitElement {
} }
ha-button-toggle-group { ha-button-toggle-group {
margin: 8px 0px; margin-bottom: 8px;
} }
ha-color-picker { ha-color-picker {
@ -585,7 +585,7 @@ class MoreInfoLight extends LitElement {
hr { hr {
border-color: var(--divider-color); border-color: var(--divider-color);
border-bottom: none; border-bottom: none;
margin: 8px 0; margin: 16px 0;
} }
`; `;
} }

View File

@ -23,6 +23,7 @@ class MoreInfoScript extends LitElement {
} }
return html` return html`
<hr />
<div class="flex"> <div class="flex">
<div> <div>
${this.hass.localize( ${this.hass.localize(
@ -47,6 +48,11 @@ class MoreInfoScript extends LitElement {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
hr {
border-color: var(--divider-color);
border-bottom: none;
margin: 16px 0;
}
`; `;
} }
} }

View File

@ -29,6 +29,7 @@ class MoreInfoSun extends LitElement {
const order = risingDate > settingDate ? ["set", "ris"] : ["ris", "set"]; const order = risingDate > settingDate ? ["set", "ris"] : ["ris", "set"];
return html` return html`
<hr />
${order.map( ${order.map(
(item) => html` (item) => html`
<div class="row"> <div class="row">
@ -82,6 +83,11 @@ class MoreInfoSun extends LitElement {
ha-relative-time::first-letter { ha-relative-time::first-letter {
text-transform: lowercase; text-transform: lowercase;
} }
hr {
border-color: var(--divider-color);
border-bottom: none;
margin: 16px 0;
}
`; `;
} }
} }

View File

@ -50,7 +50,6 @@ class MoreInfoWaterHeater extends LocalizeMixin(EventsMixin(PolymerElement)) {
.single-row { .single-row {
padding: 8px 0; padding: 8px 0;
} }
}
</style> </style>
<div class$="[[computeClassNames(stateObj)]]"> <div class$="[[computeClassNames(stateObj)]]">