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
1 changed files with 3 additions and 2 deletions
|
@ -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():
|
||||
entity_id = state.entity_id
|
||||
if not self._filter(entity_id):
|
||||
if not entity_filter(entity_id):
|
||||
continue
|
||||
|
||||
if ent_reg_ent := ent_reg.async_get(entity_id):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue