Class SensorClient

A gRPC-web client for the Sensor 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>

    const result = await resource.doCommand({
    name: 'myCommand',
    args: { key: 'value' },
    });
  • Return the readings of a sensor.

    Parameters

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

    Returns Promise<Record<string, JsonValue>>

    const sensor = new VIAM.SensorClient(machine, 'my_sensor');

    // Get the readings of a sensor.
    const readings = await sensor.getReadings();
MMNEPVFCICPMFPCPTTAAATR