Whether the upstream rate-limit gate is currently holding a pause
window after a recent 429 Retry-After response.
true while the SDK is intentionally failing fast.
BCP-47 locale supplied via ClassicAPIConfig.locale, or
undefined when unset. Surfaced through ClassicAPIAdapter
so facades thread it into getChartLineOptions and report labels
stay consistent with the configured locale without a mutable global.
The configured BCP-47 locale tag, or undefined.
IANA timezone supplied via ClassicAPIConfig.timezone,
or undefined when unset. Surfaced through ClassicAPIAdapter
so facades can anchor their "now" defaults to the Classic timezone
rather than the host runtime timezone.
The configured IANA timezone identifier, or undefined.
Releases the auto-sync timer and any retry-guard timers; the instance must not be reused after disposal.
Sign in with explicit credentials. The server refuses them in
protocol-specific ways (Classic ClientLogin3 returning
LoginData: null, Home BFF returning 401, etc.). Successful
return guarantees the registry reflects server state — the
post-auth sync is enforced here so subclasses cannot forget it.
Use resumeSession for a best-effort restore from persisted credentials that logs + swallows errors.
Credentials are persisted only once the server accepts them: a rejected attempt leaves the stored pair and any live session untouched (the backoff still arms and the error still surfaces).
Explicit username/password.
AuthenticationError when the server refuses the credentials.
Cancels any pending auto-sync timer; subsequent setSyncInterval or fetch calls re-arm it.
Sync check first; when it reads false, a NON-DESTRUCTIVE probe —
one registry sync, which exercises the persisted session without
touching it — and only if that still leaves us unauthenticated, the
best-effort resumeSession fallback. The order matters:
resumeSession runs a full sign-in, which spends a real login
attempt (server-side throttle counters, the local backoff on a
rejection) and replaces a session that may have been merely
unexercised (a boot-time context fetch that lost the network reads
unauthenticated while a perfectly valid refresh token sits in
storage).
true when a session is usable afterwards.
Fetch all buildings, sync the model registry, and schedule the next auto-sync.
The list of fetched buildings.
Fetch energy consumption report. Supported by ATA and ATW devices.
Fetch raw error log entries from the Classic API.
Retrieve a parsed, paginated error log for the specified devices. Filters out entries with invalid dates or empty messages.
The error log query parameters (date range, pagination).
ClassicDevice IDs to fetch errors for; defaults to all devices.
Parsed error log with pagination metadata, or a typed failure.
Get frost protection settings for a building, floor, area, or device.
Fetch ATA device group state. ATA only.
Get holiday mode settings for a building, floor, area, or device.
Fetch hourly temperature report. ATW only.
Fetch internal temperature report. ATW only.
Fetch operation mode log data for charting.
Fetch WiFi signal strength report.
Fetch temperature log data.
Fetch tile data for device overview.
Read the live device data for a single device.
Destructured options.
buildingId + id of the target device.
The device-type-discriminated data payload.
Post-construction lifecycle hook. Every subclass create()
factory must delegate to this method — it is the sole path that
guarantees the #1281-class invariant at instance-creation time:
a successful return leaves the registry populated whenever
credentials or a persisted session are available.
Two-branch template:
tryReuseSession — if the subclass can reuse a
persisted session (and populate the registry in the process),
we are done.Callers should check isAuthenticated after create()
returns if they need to distinguish "empty state" from "ready".
Whether a Classic session context key has been issued.
true once authenticated.
Log out: the inverse of authenticate. Clears the persisted
session (tokens/context/expiry), the stored username/password and
the automatic-login backoff, stops the auto-sync timer, and empties
the registry — so isAuthenticated reads false and no
stale devices linger, identically on Classic and Home.
User-initiated, so unlike a rejected sign-in it neither arms the
backoff nor emits onAuthenticationLost. A subsequent
authenticate is the only way back in.
Notify any registered events.onSyncComplete observer that a
sync just landed. Routed through the lifecycle emitter so a
misbehaving callback cannot break the caller. Invoked by the
@syncDevices decorator after each decorated mutation.
SyncCallback-shaped payload (type, ids).
Best-effort session restore from persisted credentials.
Reads username/password from the SettingManager and signs
in. Unlike authenticate, failures are logged and
swallowed — the method never throws. Use this from lifecycle
hooks (init, 401 retry, ensureSession) where a stale or
missing persisted credential must not crash the caller.
On success, the registry is populated (delegates to authenticate).
true when a sign-in round-trip succeeded and the
instance is now authenticated; false for "no persisted
credentials" or "sign-in failed" (both indistinguishable by
the return value alone — check the logger / isAuthenticated
if the distinction matters).
Reschedules the auto-sync timer.
The timer is unref'd, so it never keeps the Node event loop alive
on its own — auto-sync still fires on cadence whenever the host
application has another reason to stay running (HTTP server, other
timers, open streams). Apps that must run indefinitely should
provide their own keep-alive (e.g. setInterval(() => {}, 1 << 30)
or a long-lived server) rather than relying on this timer.
Cadence in minutes; pass false to disable.
Run the initial session restore, honoring the configured mode.
initialize() never rejects by design (probe and resume failures
are swallowed and surfaced through the lifecycle events), so the
background variant only needs the fire-and-forget form.
When true, the restore runs off
the caller's critical path and create() resolves immediately.
Update frost protection settings for a zone.
The response is discriminated: on success returns
ClassicSuccessData (Success: true); on partial/total failure
returns ClassicFailureData with AttributeErrors describing the
rejected fields. Callers should branch on Success before reading
the remaining fields.
Destructured options.
Zone identifier + new temperature bounds.
The success or failure payload.
Apply an ATA group state update across every device in a building zone. Same success/failure shape as updateFrostProtection.
Destructured options.
Group target + state fields to apply.
The success or failure payload.
Update holiday-mode settings for a zone. Same shape discrimination as updateFrostProtection.
Destructured options.
Zone identifier + holiday-mode fields.
The success or failure payload.
Update the user's language on the server if it differs from the current locale.
The language code to set.
Toggle power on one or more devices via /Device/Power.
Destructured options.
DeviceIds array + target Power state.
The server-echoed power state.
Send a set-device payload to /Device/SetAta, /Device/SetAtw
or /Device/SetErv depending on the DeviceType on the body.
Destructured options.
Discriminated set-device payload.
Device type selecting the target endpoint.
The server response, narrowed by DeviceType.
StaticcreateCreate and initialize a MELCloud Classic API instance.
Delegates post-construction setup to BaseAPI.initialize so the #1281-class invariant is enforced uniformly: on return, either the registry is populated or the instance is in a documented empty state (no credentials, no persisted session).
Optionalconfig: ClassicAPIConfig
Optional configuration for the Classic API client.
The initialized ClassicAPI instance.
Main MELCloud Classic API client. Handles authentication, device syncing, and all ClassicAPI endpoint calls. Uses a private constructor — create instances via ClassicAPI.create.