mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Fix logic of entity id extraction (#49164)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
@@ -362,8 +362,16 @@ async def async_extract_referenced_entity_ids(
|
||||
return selected
|
||||
|
||||
for ent_entry in ent_reg.entities.values():
|
||||
if ent_entry.area_id in selector.area_ids or (
|
||||
not ent_entry.area_id and ent_entry.device_id in selected.referenced_devices
|
||||
if (
|
||||
# when area matches the target area
|
||||
ent_entry.area_id in selector.area_ids
|
||||
# when device matches a referenced devices with no explicitly set area
|
||||
or (
|
||||
not ent_entry.area_id
|
||||
and ent_entry.device_id in selected.referenced_devices
|
||||
)
|
||||
# when device matches target device
|
||||
or ent_entry.device_id in selector.device_ids
|
||||
):
|
||||
selected.indirectly_referenced.add(ent_entry.entity_id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user