"""pyfglair — локальное управление кондиционерами Fujitsu General (FGLair/Ayla). Python-обёртка над C++-ядром fgl-aircon (cffi, ABI-режим). Пакет собирает ядро cmake'ом при упаковке wheel (см. ``python -m pyfglair._corebuild``). Модули, требующие нативной библиотеки (``session``, ``templates``), загружаются лениво: provisioning и перечисления доступны без неё. """ from __future__ import annotations import importlib from typing import Any from .const import Error, Prop, State, Template, ValueKind from .provision import Device, ProvisionError, REGIONS, discover, esphome_secrets __version__ = "1.0.0" _LAZY: dict[str, tuple[str, str]] = { "Config": ("pyfglair.session", "Config"), "PropertyEvent": ("pyfglair.session", "PropertyEvent"), "Session": ("pyfglair.session", "Session"), "Value": ("pyfglair.session", "Value"), "set_log_handler": ("pyfglair.session", "set_log_handler"), "set_log_level": ("pyfglair.session", "set_log_level"), "PropertyInfo": ("pyfglair.templates", "PropertyInfo"), "template_info": ("pyfglair.templates", "template_info"), "prop_info": ("pyfglair.templates", "prop_info"), "detect": ("pyfglair.templates", "detect"), "api_range": ("pyfglair.templates", "api_range"), "convert_to_display": ("pyfglair.templates", "convert_to_display"), "convert_from_input": ("pyfglair.templates", "convert_from_input"), "ensure_core": ("pyfglair._corebuild", "ensure_core"), } __all__ = [ "Config", "Device", "Error", "Prop", "PropertyEvent", "PropertyInfo", "ProvisionError", "REGIONS", "Session", "State", "Template", "Value", "ValueKind", "api_range", "convert_from_input", "convert_to_display", "detect", "discover", "ensure_core", "esphome_secrets", "prop_info", "set_log_handler", "set_log_level", "template_info", ] def __getattr__(name: str) -> Any: entry = _LAZY.get(name) if entry is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") module = importlib.import_module(entry[0]) return getattr(module, entry[1])