Fix lock more info with attributes (#15622)

* Fix lock more info with attributes

* Update src/dialogs/more-info/controls/more-info-lock.ts

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

---------

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
Paul Bottein 2023-02-28 11:34:35 +01:00 committed by GitHub
parent 4b428a60cd
commit ea95fb98aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,7 @@ class MoreInfoLock extends LitElement {
}
return html`
${this.stateObj.attributes.code_format
? html`
? html`<div class="code">
<ha-textfield
.label=${this.hass.localize("ui.card.lock.code")}
.pattern=${this.stateObj.attributes.code_format}
@ -36,7 +36,7 @@ class MoreInfoLock extends LitElement {
: html`<mwc-button @click=${this._callService} data-service="lock"
>${this.hass.localize("ui.card.lock.lock")}</mwc-button
>`}
`
</div>`
: ""}
<ha-attributes
.hass=${this.hass}
@ -59,6 +59,18 @@ class MoreInfoLock extends LitElement {
:host {
display: flex;
align-items: center;
flex-direction: column;
}
.code {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
margin-bottom: 8px;
width: 100%;
}
ha-attributes {
width: 100%;
}
`;
}