mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-30 12:46:35 +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,11 +138,21 @@ class HuiAlarmPanelCard extends hassLocalizeLitMixin(LitElement)
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
${
|
||||||
|
!stateObj.attributes.code_format
|
||||||
|
? html``
|
||||||
|
: html`
|
||||||
<paper-input
|
<paper-input
|
||||||
label="Alarm Code"
|
label="Alarm Code"
|
||||||
type="password"
|
type="password"
|
||||||
.value="${this._code}"
|
.value="${this._code}"
|
||||||
></paper-input>
|
></paper-input>
|
||||||
|
`
|
||||||
|
}
|
||||||
|
${
|
||||||
|
stateObj.attributes.code_format !== "Number"
|
||||||
|
? html``
|
||||||
|
: html`
|
||||||
<div id="keypad">
|
<div id="keypad">
|
||||||
${
|
${
|
||||||
BUTTONS.map((value) => {
|
BUTTONS.map((value) => {
|
||||||
@ -157,13 +167,17 @@ class HuiAlarmPanelCard extends hassLocalizeLitMixin(LitElement)
|
|||||||
.value="${value}"
|
.value="${value}"
|
||||||
@click="${this._handlePadClick}"
|
@click="${this._handlePadClick}"
|
||||||
>${
|
>${
|
||||||
value === "clear" ? this._label("clear_code") : value
|
value === "clear"
|
||||||
|
? this._label("clear_code")
|
||||||
|
: value
|
||||||
}</paper-button
|
}</paper-button
|
||||||
>
|
>
|
||||||
`;
|
`;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
`
|
||||||
|
}
|
||||||
</ha-card>
|
</ha-card>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user