mirror of
https://github.com/home-assistant/core.git
synced 2025-11-12 12:30:31 +00:00
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:
@@ -473,6 +473,7 @@ async def test_config(hass):
|
||||
async def test_logbook_humanify_script_started_event(hass):
|
||||
"""Test humanifying script started event."""
|
||||
await async_setup_component(hass, DOMAIN, {})
|
||||
entity_attr_cache = logbook.EntityAttributeCache(hass)
|
||||
|
||||
event1, event2 = list(
|
||||
logbook.humanify(
|
||||
@@ -487,6 +488,7 @@ async def test_logbook_humanify_script_started_event(hass):
|
||||
{ATTR_ENTITY_ID: "script.bye", ATTR_NAME: "Bye Script"},
|
||||
),
|
||||
],
|
||||
entity_attr_cache,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user