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

    Class HomeRegistry

    Lightweight device registry for the Home API. Maintains stable model references across syncs using upsert + prune.

    Index
    • Groups devices by their source building, name-sorted like the Classic registry's zone tree; devices keep registry order within a building (an upsert keeps a known device's position, new devices append).

      Parameters

      • params: { type?: HomeDeviceType } = {}

        Optional filter.

        • Optionaltype?: HomeDeviceType

          Connection-type discriminator; omitted merges both connection types per building.

      Returns HomeBuildingDevices[]

      One entry per building that holds at least one such device.

    • Flattens the registry into the picker zone list: name-sorted buildings, each followed by its own name-sorted devices — the grouped shape the consumer's Home picker established. Classic's getZones differs by design: it sorts its flat list globally, so children detach from their parents there.

      Parameters

      • params: { type?: HomeDeviceType } = {}

        Optional filter.

        • Optionaltype?: HomeDeviceType

          Connection-type discriminator; omitted covers both connection types.

      Returns HomeFlatZone[]

      The flattened zone nodes.

    • Upserts the device registry from a flat list of typed device payloads; entries absent from devices are pruned.

      Parameters

      • devices: TypedHomeDeviceData[]

        Fresh typed device payloads.

      Returns void