Class PowerSensorRPCClient


public class PowerSensorRPCClient extends PowerSensor
  • Constructor Details

    • PowerSensorRPCClient

      public PowerSensorRPCClient(String name, Channel chan)
  • Method Details

    • doCommand

      public com.google.protobuf.Struct doCommand(Map<String,com.google.protobuf.Value> command)
      Description copied from class: Resource
      Send/Receive arbitrary commands to the Resource
      Overrides:
      doCommand in class Resource
      Parameters:
      command - the command to execute
      Returns:
      result of the executed command
    • getVoltage

      public Map.Entry<Double,Boolean> getVoltage(Optional<com.google.protobuf.Struct> extra)
      Description copied from class: PowerSensor
      Return the voltage reading of a specified device and whether it is AC or DC.
      Specified by:
      getVoltage in class PowerSensor
      Returns:
      the pair where the first double representing the voltage reading in V, the second bool indicating whether the voltage is AC (`true`) or DC (`false`).
    • getCurrent

      public Map.Entry<Double,Boolean> getCurrent(Optional<com.google.protobuf.Struct> extra)
      Description copied from class: PowerSensor
      Return the current of a specified device and whether it is AC or DC.
      Specified by:
      getCurrent in class PowerSensor
      Returns:
      the pair where the first double representing the current reading in V, the second bool indicating whether the current is AC (`true`) or DC * (`false`).
    • getPower

      public double getPower(Optional<com.google.protobuf.Struct> extra)
      Description copied from class: PowerSensor
      Return the power reading in watts.
      Specified by:
      getPower in class PowerSensor
      Returns:
      the power reading in watts
    • getReadings

      public Map<String,Object> getReadings(Optional<com.google.protobuf.Struct> extra)
      Description copied from class: PowerSensor
      Get the measurements or readings that this power sensor provides. If a sensor is not configured correctly or fails to read a piece of data, it will not appear in the readings dictionary.
      Specified by:
      getReadings in class PowerSensor
      Returns:
      The readings for the PowerSensor. Object should be of type Vector3, GeoPoint, Orientation, or any Value type. Includes voltage in volts (float), current in amperes (float), is_ac (bool), and power in watts (float).