mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Allow empty string as a valid conditional statement (#14918)
* Fix days missing from ha-base-time-input _valueChanged * style change * Allow empty string as a valid conditional check
This commit is contained in:
parent
9dcdf46316
commit
095ebbc903
@ -16,12 +16,14 @@ export function checkConditionsMet(
|
||||
? hass!.states[c.entity].state
|
||||
: UNAVAILABLE;
|
||||
|
||||
return c.state ? state === c.state : state !== c.state_not;
|
||||
return c.state != null ? state === c.state : state !== c.state_not;
|
||||
});
|
||||
}
|
||||
|
||||
export function validateConditionalConfig(conditions: Condition[]): boolean {
|
||||
return conditions.every(
|
||||
(c) => (c.entity && (c.state || c.state_not)) as unknown as boolean
|
||||
(c) =>
|
||||
(c.entity &&
|
||||
(c.state != null || c.state_not != null)) as unknown as boolean
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user