mirror of
https://github.com/elisspace/core.git
synced 2026-10-05 16:56:19 +00:00
Restore use of local timezone for MariaDB/MySQL in SQL integration (#91313)
* 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
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
"""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]
|
||||
Reference in New Issue
Block a user