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
6 changed files with 38 additions and 10 deletions

View File

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