Lovelace alarm panel respects the code_format attribute on the alarm entity (#2379)

This commit is contained in:
Emil Stjerneman 2019-01-03 23:09:07 +01:00 committed by Paulus Schoutsen
parent 38a2627227
commit adf0c6d891

View File

@ -138,11 +138,21 @@ class HuiAlarmPanelCard extends hassLocalizeLitMixin(LitElement)
})
}
</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) => {
@ -157,13 +167,17 @@ class HuiAlarmPanelCard extends hassLocalizeLitMixin(LitElement)
.value="${value}"
@click="${this._handlePadClick}"
>${
value === "clear" ? this._label("clear_code") : value
value === "clear"
? this._label("clear_code")
: value
}</paper-button
>
`;
})
}
</div>
`
}
</ha-card>
`;
}