Class ButtonClient

A gRPC-web client for the Button component.

Implements

Constructors

Properties

Methods

Constructors

Properties

callOptions: CallOptions = ...
name: string

The name of the resource.

Methods

  • Send/Receive arbitrary commands to the resource.

    Parameters

    • command: Struct

      The command to execute.

    • callOptions: CallOptions = ...

    Returns Promise<JsonValue>

    import { Struct } from '@viamrobotics/sdk';

    const result = await resource.doCommand(
    Struct.fromJson({
    myCommand: { key: 'value' },
    })
    );
  • Push the button.

    Parameters

    • extra: {} = {}
    • callOptions: CallOptions = ...

    Returns Promise<void>

    const button = new VIAM.ButtonClient(machine, 'my_button');

    // Push the button
    await button.push();

    For more information, see Button API.