Class PowerSensorClient

A gRPC-web client for the PowerSensor component.

Implements

Constructors

Properties

callOptions: CallOptions = ...
client: PromiseClient<{
    methods: {
        doCommand: {
            I: typeof DoCommandRequest;
            O: typeof DoCommandResponse;
            kind: Unary;
            name: "DoCommand";
        };
        getCurrent: {
            I: typeof GetCurrentRequest;
            O: typeof GetCurrentResponse;
            kind: Unary;
            name: "GetCurrent";
        };
        getPower: {
            I: typeof GetPowerRequest;
            O: typeof GetPowerResponse;
            kind: Unary;
            name: "GetPower";
        };
        getReadings: {
            I: typeof commonApi.GetReadingsRequest;
            O: typeof commonApi.GetReadingsResponse;
            kind: Unary;
            name: "GetReadings";
        };
        getVoltage: {
            I: typeof GetVoltageRequest;
            O: typeof GetVoltageResponse;
            kind: Unary;
            name: "GetVoltage";
        };
    };
    typeName: "viam.component.powersensor.v1.PowerSensorService";
}>

Type declaration

  • Readonly methods: {
        doCommand: {
            I: typeof DoCommandRequest;
            O: typeof DoCommandResponse;
            kind: Unary;
            name: "DoCommand";
        };
        getCurrent: {
            I: typeof GetCurrentRequest;
            O: typeof GetCurrentResponse;
            kind: Unary;
            name: "GetCurrent";
        };
        getPower: {
            I: typeof GetPowerRequest;
            O: typeof GetPowerResponse;
            kind: Unary;
            name: "GetPower";
        };
        getReadings: {
            I: typeof commonApi.GetReadingsRequest;
            O: typeof commonApi.GetReadingsResponse;
            kind: Unary;
            name: "GetReadings";
        };
        getVoltage: {
            I: typeof GetVoltageRequest;
            O: typeof GetVoltageResponse;
            kind: Unary;
            name: "GetVoltage";
        };
    }
    • Readonly doCommand: {
          I: typeof DoCommandRequest;
          O: typeof DoCommandResponse;
          kind: Unary;
          name: "DoCommand";
      }

      DoCommand sends/receives arbitrary commands

      Generated

      from rpc viam.component.powersensor.v1.PowerSensorService.DoCommand

    • Readonly getCurrent: {
          I: typeof GetCurrentRequest;
          O: typeof GetCurrentResponse;
          kind: Unary;
          name: "GetCurrent";
      }

      GetCurrent returns the current reading of a power sensor in amperes

      Generated

      from rpc viam.component.powersensor.v1.PowerSensorService.GetCurrent

    • Readonly getPower: {
          I: typeof GetPowerRequest;
          O: typeof GetPowerResponse;
          kind: Unary;
          name: "GetPower";
      }

      GetPower returns the power reading of a power sensor in watts

      Generated

      from rpc viam.component.powersensor.v1.PowerSensorService.GetPower

    • Readonly getReadings: {
          I: typeof commonApi.GetReadingsRequest;
          O: typeof commonApi.GetReadingsResponse;
          kind: Unary;
          name: "GetReadings";
      }

      GetReadings returns the readings of a sensor of the underlying robot.

      Generated

      from rpc viam.component.powersensor.v1.PowerSensorService.GetReadings

    • Readonly getVoltage: {
          I: typeof GetVoltageRequest;
          O: typeof GetVoltageResponse;
          kind: Unary;
          name: "GetVoltage";
      }

      GetVoltage returns the voltage reading of a power sensor in volts

      Generated

      from rpc viam.component.powersensor.v1.PowerSensorService.GetVoltage

  • Readonly typeName: "viam.component.powersensor.v1.PowerSensorService"
name: string
options: Options

Methods

  • Send/Receive arbitrary commands to the resource.

    Parameters

    • command: Struct

      The command to execute.

    • callOptions: CallOptions = ...

    Returns Promise<JsonValue>

  • Get Current in amps and a boolean that returns true if AC

    Parameters

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

      Returns Promise<readonly [number, boolean]>

    • Get Power in watts

      Parameters

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

        Returns Promise<number>

      • Return the readings of a sensor.

        Parameters

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

          Returns Promise<Record<string, JsonValue>>

        • Get Voltage in volts and a boolean that returns true if AC

          Parameters

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

            Returns Promise<readonly [number, boolean]>

          Generated using TypeDoc