mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Allow entity-filter-card to filter on other entity (#24396)
This commit is contained in:
parent
a048c36861
commit
3b272ae411
@ -191,6 +191,9 @@ export function extractConditionEntityIds(
|
||||
const entityIds = new Set<string>();
|
||||
for (const condition of conditions) {
|
||||
if (condition.condition === "numeric_state") {
|
||||
if (condition.entity) {
|
||||
entityIds.add(condition.entity);
|
||||
}
|
||||
if (
|
||||
typeof condition.above === "string" &&
|
||||
isValidEntityId(condition.above)
|
||||
@ -204,6 +207,9 @@ export function extractConditionEntityIds(
|
||||
entityIds.add(condition.below);
|
||||
}
|
||||
} else if (condition.condition === "state") {
|
||||
if (condition.entity) {
|
||||
entityIds.add(condition.entity);
|
||||
}
|
||||
[
|
||||
...(ensureArray(condition.state) ?? []),
|
||||
...(ensureArray(condition.state_not) ?? []),
|
||||
@ -304,8 +310,8 @@ export function addEntityToCondition(
|
||||
condition.condition === "numeric_state"
|
||||
) {
|
||||
return {
|
||||
...condition,
|
||||
entity: entityId,
|
||||
...condition,
|
||||
};
|
||||
}
|
||||
return condition;
|
||||
|
Loading…
x
Reference in New Issue
Block a user