2026-04-19 20:19:58 +02:00
|
|
|
from collections.abc import Generator
|
|
|
|
|
|
|
|
|
|
from sqlalchemy.orm import Session
|
|
|
|
|
|
|
|
|
|
from app.config import Settings, get_settings
|
|
|
|
|
from app.db import get_db_session
|
2026-04-20 11:48:48 +02:00
|
|
|
from app.integrations.homeassistant import HomeAssistantClient
|
|
|
|
|
from app.poo_db import get_poo_db_session
|
2026-04-19 20:19:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_app_settings() -> Settings:
|
|
|
|
|
return get_settings()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_db() -> Generator[Session, None, None]:
|
|
|
|
|
yield from get_db_session()
|
|
|
|
|
|
2026-04-20 11:48:48 +02:00
|
|
|
|
|
|
|
|
def get_poo_db() -> Generator[Session, None, None]:
|
|
|
|
|
yield from get_poo_db_session()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_homeassistant_client() -> HomeAssistantClient:
|
|
|
|
|
return HomeAssistantClient(get_settings())
|