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
|
@ -1040,6 +1040,7 @@ async def test_extraction_functions(hass):
|
|||
async def test_logbook_humanify_automation_triggered_event(hass):
|
||||
"""Test humanifying Automation Trigger event."""
|
||||
await async_setup_component(hass, automation.DOMAIN, {})
|
||||
entity_attr_cache = logbook.EntityAttributeCache(hass)
|
||||
|
||||
event1, event2 = list(
|
||||
logbook.humanify(
|
||||
|
@ -1054,6 +1055,7 @@ async def test_logbook_humanify_automation_triggered_event(hass):
|
|||
{ATTR_ENTITY_ID: "automation.bye", ATTR_NAME: "Bye Automation"},
|
||||
),
|
||||
],
|
||||
entity_attr_cache,
|
||||
)
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue