MELCloud & MELCloud Home API for Node.js - v48.2.0
    Preparing search index...

    Interface HomeAPIAdapter

    Injectable contract for the MELCloud Home API client.

    Mirrors the public surface of the HomeAPI class with property-with-arrow syntax so facades, mocks, and tests can reference methods safely (expect(api.updateValues), mock<HomeAPIAdapter>({...})) without triggering unbound-method lint — the class has real methods that carry this, whereas this interface declares them as plain functions with no implicit binding.

    Per-unit endpoints share one verb per concept (updateValues, getEnergy, getErrorLog, getTemperatures); the registry model's connection type routes the wire path, so callers never pick an ATA/ATW variant — getAtwInternalTemperatures is the one deliberate exception (no ATA counterpart exists).

    interface HomeAPIAdapter {
        authenticate: (credentials: LoginCredentials) => Promise<void>;
        clearSync: () => void;
        ensureAuthenticated: () => Promise<boolean>;
        fetch: () => Promise<HomeBuilding[]>;
        getAtwInternalTemperatures: (
            id: string,
            params: { from: string; period: string; to: string },
        ) => Promise<Result<HomeReportData[]>>;
        getEnergy: (
            id: string,
            params: {
                from: string;
                interval: string;
                measure?: "consumed" | "produced";
                to: string;
            },
        ) => Promise<Result<HomeEnergyData>>;
        getErrorLog: (id: string) => Promise<Result<HomeErrorLogEntry[]>>;
        getSignal: (
            id: string,
            params: { from: string; to: string },
        ) => Promise<Result<HomeEnergyData>>;
        getTemperatures: (
            id: string,
            params: { from: string; period: string; to: string },
        ) => Promise<Result<HomeReportData[]>>;
        getUser: () => Promise<HomeUser | null>;
        isAuthenticated: () => boolean;
        isRateLimited: boolean;
        locale: string | undefined;
        logOut: () => void;
        registry: HomeRegistry;
        resumeSession: () => Promise<boolean>;
        setSyncInterval: (minutes: number | false) => void;
        timezone: string | undefined;
        updateFrostProtection: (
            postData: HomeFrostProtectionPostData,
        ) => Promise<void>;
        updateHolidayMode: (postData: HomeHolidayModePostData) => Promise<void>;
        updateOverheatProtection: (
            postData: HomeOverheatProtectionPostData,
        ) => Promise<void>;
        updateValues: (
            id: string,
            values: HomeAtaValues | HomeAtwValues,
        ) => Promise<void>;
        user: HomeUser | null;
    }

    Hierarchy (View Summary)

    Implemented by

    Index
    authenticate: (credentials: LoginCredentials) => Promise<void>

    Sign in with explicit credentials; throws on rejection.

    clearSync: () => void

    Cancel any pending automatic sync.

    ensureAuthenticated: () => Promise<boolean>

    Sync check first; when it reads false, one best-effort resumeSession probe, then a re-check — the lazy self-heal consumers otherwise hand-roll (a valid persisted Home token reads unauthenticated until a context fetch has run).

    fetch: () => Promise<HomeBuilding[]>

    Fetch all buildings and sync the device registry — the heartbeat, mirroring Classic fetch().

    getAtwInternalTemperatures: (
        id: string,
        params: { from: string; period: string; to: string },
    ) => Promise<Result<HomeReportData[]>>

    Fetch the internal-temperatures report (flow/return/tank/zone) for an ATW unit.

    getEnergy: (
        id: string,
        params: {
            from: string;
            interval: string;
            measure?: "consumed" | "produced";
            to: string;
        },
    ) => Promise<Result<HomeEnergyData>>

    Fetch energy telemetry for a unit; the registry's connection type selects the measure family.

    getErrorLog: (id: string) => Promise<Result<HomeErrorLogEntry[]>>

    Fetch the error log for a unit; the registry's connection type selects the unit path.

    getSignal: (
        id: string,
        params: { from: string; to: string },
    ) => Promise<Result<HomeEnergyData>>

    Fetch WiFi signal strength (RSSI) telemetry for a device.

    getTemperatures: (
        id: string,
        params: { from: string; period: string; to: string },
    ) => Promise<Result<HomeReportData[]>>

    Fetch the temperature report for a unit; the registry's connection type selects the endpoint.

    getUser: () => Promise<HomeUser | null>

    Fetch the current user's claims from the BFF. Returns null on failure.

    isAuthenticated: () => boolean

    Whether a session is currently usable, from local state alone.

    isRateLimited: boolean

    Whether the client is currently inside a server rate-limit backoff.

    locale: string | undefined

    BCP-47 locale tag the instance was configured with, or undefined.

    logOut: () => void

    Explicit sign-out: clears the persisted session material.

    registry: HomeRegistry

    Home device registry with stable model references across syncs.

    resumeSession: () => Promise<boolean>

    Best-effort session restore from persisted credentials. Never throws — returns false when no credentials are persisted or sign-in fails (logged via the SDK logger).

    setSyncInterval: (minutes: number | false) => void

    Update the automatic sync interval and reschedule. Pass false to disable.

    timezone: string | undefined

    IANA timezone the instance was configured with, or undefined.

    updateFrostProtection: (postData: HomeFrostProtectionPostData) => Promise<void>

    Batch frost-protection write (device ids grouped in units), then refresh.

    updateHolidayMode: (postData: HomeHolidayModePostData) => Promise<void>

    Batch holiday-mode write (device ids grouped in units), then refresh.

    updateOverheatProtection: (
        postData: HomeOverheatProtectionPostData,
    ) => Promise<void>

    Batch overheat-protection write (ATA-only feature), then refresh.

    updateValues: (
        id: string,
        values: HomeAtaValues | HomeAtwValues,
    ) => Promise<void>

    Push a setpoint update (wire path from the registry's connection type), then refresh.

    user: HomeUser | null

    The currently authenticated user, or null.