* Use local timezone for recorder connection The fix in #90335 had an unexpected side effect of using UTC for the timezone since all recorder operations use UTC. Since only sqlite much use the database executor we can use a seperate connection pool which uses local time This also ensures that the engines are disposed of when Home Assistant is shutdown as previously we did not cleanly disconnect * coverage * fix unclean shutdown in config flow * tweaks
16 lines
371 B
Python
16 lines
371 B
Python
"""The sql integration models."""
|
|
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
|
|
from sqlalchemy.orm import scoped_session
|
|
|
|
from homeassistant.core import CALLBACK_TYPE
|
|
|
|
|
|
@dataclass(slots=True)
|
|
class SQLData:
|
|
"""Data for the sql integration."""
|
|
|
|
shutdown_event_cancel: CALLBACK_TYPE
|
|
session_makers_by_db_url: dict[str, scoped_session]
|