mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-01 13:37:47 +00:00
Allow multiple states in state condition editor
This commit is contained in:
parent
4dcf26236e
commit
c448bbc3b4
@ -30,6 +30,9 @@ export const handleChangeEvent = (
|
||||
ev: CustomEvent
|
||||
) => {
|
||||
ev.stopPropagation();
|
||||
if (ev.detail.isValid === false) {
|
||||
return;
|
||||
}
|
||||
const name = (ev.target as any)?.name;
|
||||
if (!name) {
|
||||
return;
|
||||
|
@ -41,14 +41,27 @@ export class HaStateCondition extends LitElement implements ConditionElement {
|
||||
@value-changed=${this._valueChanged}
|
||||
allow-custom-value
|
||||
></ha-entity-attribute-picker>
|
||||
<paper-input
|
||||
.label=${this.hass.localize(
|
||||
"ui.panel.config.automation.editor.conditions.type.state.state"
|
||||
)}
|
||||
.name=${"state"}
|
||||
.value=${state}
|
||||
@value-changed=${this._valueChanged}
|
||||
></paper-input>
|
||||
${Array.isArray(state)
|
||||
? html`
|
||||
<ha-yaml-editor
|
||||
.label=${this.hass.localize(
|
||||
"ui.panel.config.automation.editor.conditions.type.state.state"
|
||||
) + " (YAML)"}
|
||||
.defaultValue=${state}
|
||||
.name=${"state"}
|
||||
@value-changed=${this._valueChanged}
|
||||
></ha-yaml-editor>
|
||||
`
|
||||
: html`
|
||||
<paper-input
|
||||
.label=${this.hass.localize(
|
||||
"ui.panel.config.automation.editor.conditions.type.state.state"
|
||||
)}
|
||||
.name=${"state"}
|
||||
.value=${state}
|
||||
@value-changed=${this._valueChanged}
|
||||
></paper-input>
|
||||
`}
|
||||
`;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user