from . import Recorder as Recorder
from .const import DOMAIN as DOMAIN
from .models import Statistics as Statistics, StatisticsMeta as StatisticsMeta, process_timestamp_to_utc_isoformat as process_timestamp_to_utc_isoformat
from .util import execute as execute, retryable_database_job as retryable_database_job, session_scope as session_scope
from datetime import datetime as datetime
from homeassistant.const import PRESSURE_PA as PRESSURE_PA, TEMP_CELSIUS as TEMP_CELSIUS
from typing import Any

QUERY_STATISTICS: Any
QUERY_STATISTIC_META: Any
STATISTICS_BAKERY: str
STATISTICS_META_BAKERY: str
UNIT_CONVERSIONS: Any
_LOGGER: Any

def async_setup(hass) -> None: ...
def get_start_time() -> datetime.datetime: ...
def _get_metadata_ids(hass, session, statistic_ids): ...
def _get_or_add_metadata_id(hass, session, statistic_id, metadata): ...
def compile_statistics(instance: Recorder, start: datetime.datetime) -> bool: ...
def _get_metadata(hass, session, statistic_ids, statistic_type): ...
def _configured_unit(unit: str, units) -> str: ...
def list_statistic_ids(hass, statistic_type: Any | None = ...): ...
def statistics_during_period(hass, start_time, end_time: Any | None = ..., statistic_ids: Any | None = ...): ...
def get_last_statistics(hass, number_of_stats, statistic_id): ...
def _sorted_statistics_to_dict(hass, stats, statistic_ids, metadata): ...
