mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-29 20:26:39 +00:00
Lovelace alarm panel respects the code_format attribute on the alarm entity (#2379)
This commit is contained in:
parent
38a2627227
commit
adf0c6d891
@ -138,32 +138,46 @@ class HuiAlarmPanelCard extends hassLocalizeLitMixin(LitElement)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
<paper-input
|
||||
label="Alarm Code"
|
||||
type="password"
|
||||
.value="${this._code}"
|
||||
></paper-input>
|
||||
<div id="keypad">
|
||||
${
|
||||
BUTTONS.map((value) => {
|
||||
return value === ""
|
||||
? html`
|
||||
<paper-button disabled></paper-button>
|
||||
`
|
||||
: html`
|
||||
<paper-button
|
||||
noink
|
||||
raised
|
||||
.value="${value}"
|
||||
@click="${this._handlePadClick}"
|
||||
>${
|
||||
value === "clear" ? this._label("clear_code") : value
|
||||
}</paper-button
|
||||
>
|
||||
`;
|
||||
})
|
||||
}
|
||||
</div>
|
||||
${
|
||||
!stateObj.attributes.code_format
|
||||
? html``
|
||||
: html`
|
||||
<paper-input
|
||||
label="Alarm Code"
|
||||
type="password"
|
||||
.value="${this._code}"
|
||||
></paper-input>
|
||||
`
|
||||
}
|
||||
${
|
||||
stateObj.attributes.code_format !== "Number"
|
||||
? html``
|
||||
: html`
|
||||
<div id="keypad">
|
||||
${
|
||||
BUTTONS.map((value) => {
|
||||
return value === ""
|
||||
? html`
|
||||
<paper-button disabled></paper-button>
|
||||
`
|
||||
: html`
|
||||
<paper-button
|
||||
noink
|
||||
raised
|
||||
.value="${value}"
|
||||
@click="${this._handlePadClick}"
|
||||
>${
|
||||
value === "clear"
|
||||
? this._label("clear_code")
|
||||
: value
|
||||
}</paper-button
|
||||
>
|
||||
`;
|
||||
})
|
||||
}
|
||||
</div>
|
||||
`
|
||||
}
|
||||
</ha-card>
|
||||
`;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user