Prefilter more logbook events in sql (#36958)
* Prefilter more logbook events in sql Prefilter sensor events in _keep_event before humanify Cache static attribute lookup Reduces logbook execution time by ~35% * fix mocking in benchmark * Update tests for logbook users
This commit is contained in:
parent
29f128eaad
commit
59e43ab6e4
7 changed files with 275 additions and 108 deletions
|
@ -17,6 +17,7 @@ async def test_humanify_homekit_changed_event(hass, hk_driver):
|
|||
"""Test humanifying HomeKit changed event."""
|
||||
with patch("homeassistant.components.homekit.HomeKit"):
|
||||
assert await async_setup_component(hass, "homekit", {"homekit": {}})
|
||||
entity_attr_cache = logbook.EntityAttributeCache(hass)
|
||||
|
||||
event1, event2 = list(
|
||||
logbook.humanify(
|
||||
|
@ -40,6 +41,7 @@ async def test_humanify_homekit_changed_event(hass, hk_driver):
|
|||
},
|
||||
),
|
||||
],
|
||||
entity_attr_cache,
|
||||
)
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue