Reduce some linear searches to cleanup the device registry (#112277)
Some of the data we had to search for was already available in a dict or underlying data structure. Make it available instead of having to build it every time. There are more places these can be used, but I only did the device registry cleanup for now
This commit is contained in:
parent
e357c4d5e5
commit
2c179dc5fb
5 changed files with 56 additions and 14 deletions
|
@ -1462,6 +1462,11 @@ class ConfigEntries:
|
|||
"""Return entry with matching entry_id."""
|
||||
return self._entries.data.get(entry_id)
|
||||
|
||||
@callback
|
||||
def async_entry_ids(self) -> list[str]:
|
||||
"""Return entry ids."""
|
||||
return list(self._entries.data)
|
||||
|
||||
@callback
|
||||
def async_entries(
|
||||
self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue