Represents a trigger in the ESP Rainmaker Neo SDK. Provides instance methods for trigger operations. Holds a WeakRef to the parent node, matching the pattern used by ESPRMNeoDevice / ESPRMNeoService / ESPRMNeoDeviceParam.

Constructors

Properties

_nodeRef: WeakRef<ESPRMNeoNode>
enabled?: boolean
groupId: string
id: string
nodeId: string
operator: TriggerOperator
path: string
type: string
value: unknown

Methods

  • Enables or disables this trigger.

    Parameters

    • enabled: boolean

      true to enable the trigger, false to disable it.

    Returns Promise<ESPAPIResponse>

    A promise that resolves with the API response when the change succeeds.

    If the node is not found.

    If the update fails or the API request fails.

  • Updates this trigger with partial changes. Sends a full trigger-list PUT under the hood (the RainMaker triggers API is replace-all).

    The instance is mutated only after the API call succeeds. If the PUT fails, this trigger's fields are left unchanged.

    Parameters

    • updates: Partial<TriggerItem>

      Partial trigger fields to update.

    Returns Promise<ESPAPIResponse>

    A promise that resolves with the API response.

    If the node or trigger is not found.

    If the API request fails.