hass-core/homeassistant/components/recorder/models/event.py
J. Nick Koston 2530031454
Use cache to lookup event type ids in logbook (#91576)
noticed we can speed this up while looking at
https://github.com/home-assistant/core/issues/91514

Note: this will not fix that issue as there is more going on there
2023-04-17 23:40:03 -04:00

13 lines
385 B
Python

"""Models events in for Recorder."""
from __future__ import annotations
def extract_event_type_ids(
event_type_to_event_type_id: dict[str, int | None],
) -> list[int]:
"""Extract event_type ids from event_type_to_event_type_id."""
return [
event_type_id
for event_type_id in event_type_to_event_type_id.values()
if event_type_id is not None
]