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

    Function fetchDevices

    • Method decorator factory that triggers a registry refresh around the decorated method.

      • when: 'before' (default): refresh runs first so the method body reads a fresh registry. Refresh errors propagate to the caller.
      • when: 'after': refresh runs post-method to capture server-side mutations whose response carries no device fields (Classic frost/holiday envelopes, Home setpoint PUTs). Fail-soft — refresh failures are logged and swallowed so a stale-registry error cannot mask the landed mutation.

      Refresh path is resolved structurally via the FetchDevicesHost shape (the host must expose fetch() or registry.syncDevices()).

      Parameters

      • root0: { when?: "after" | "before" } = {}

        Options object.

        • Optionalwhen?: "after" | "before"

          Whether to refresh before or after the call.

      Returns <TArgs extends readonly unknown[], TResult>(
          target: (...args: TArgs) => Promise<TResult>,
          _context: ClassMethodDecoratorContext,
      ) => (...args: TArgs) => Promise<TResult>

      A method decorator.