mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 16:57:10 +00:00
Improve performance of filtering HomeKit entities (#111201)
Get the underlying filter with get_filter to avoid the wrapper
This commit is contained in:
parent
3877a56d23
commit
b3a8a75e75
@ -798,10 +798,11 @@ class HomeKit:
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
entity_states = []
|
entity_states: list[State] = []
|
||||||
|
entity_filter = self._filter.get_filter()
|
||||||
for state in self.hass.states.async_all():
|
for state in self.hass.states.async_all():
|
||||||
entity_id = state.entity_id
|
entity_id = state.entity_id
|
||||||
if not self._filter(entity_id):
|
if not entity_filter(entity_id):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if ent_reg_ent := ent_reg.async_get(entity_id):
|
if ent_reg_ent := ent_reg.async_get(entity_id):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user