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

    Class HomeDevice<TData>

    Mutable wrapper around a HomeDeviceData, preserving object identity across syncs. TData narrows the wrapped payload to a specific connection-type variant (e.g. HomeAtaDeviceData) when callers have already discriminated on HomeDevice.type; defaults to the full union for the registry.

    Type Parameters

    Index
    • get building(): HomeBuildingRef

      Identity of the /context building this device was sourced from on the latest sync — the account-level grouping key. Restated on every sync, so a device moved between buildings follows its new home.

      Returns HomeBuildingRef

      The building id and display name.

    • get disconnectedSince(): Temporal.PlainDateTime | null

      First instant (UTC) since which every sync has reported the unit disconnected, or null while it reads connected. In-memory only: a fresh wrapper (new registry after a re-login, host restart) restarts the clock — deliberately conservative for the availability hysteresis.

      Returns Temporal.PlainDateTime | null

      The start of the current disconnection streak, if any.

    • get id(): string

      Unique device identifier as assigned by MELCloud Home.

      Returns string

      The GUID string assigned by MELCloud Home.

    • get isOwner(): boolean

      Whether the current account owns this device (sourced from context.buildings) rather than being a guest of it (sourced from context.guestBuildings). Reports the structural origin only: false does not by itself prove a guest is barred from control.

      Returns boolean

      true when owned, false when shared with this account.

    • get name(): string

      User-facing display name set in the MELCloud Home app.

      Returns string

      The device's display name.

    • Replaces the internal data snapshot with a fresh payload while preserving the wrapper's object identity. Every sync restates the ownership origin, so a share/unshare between syncs is reflected rather than kept from a stale tag.

      Registry-internal by contract (the Home mirror of Classic's non-exported syncDevice): consumers read, the registry writes.

      Parameters

      • device: TData

        Fresh wire-format device payload.

      • isOwner: boolean

        Ownership origin from the current sync.

      • building: HomeBuildingRef

        Building identity from the current sync.

      Returns void