current method

  1. @override
Future<Current> current({
  1. Map<String, dynamic>? extra,
})
override

Get the current in amperes, and whether the current is AC (true) or DC (false).

var currentObject = await myPowerSensor.current();
double amps = currentObject.amperes;
bool isItAC = currentObject.isAc;

For more information, see Power Sensor component.

Implementation

@override
Future<Current> current({Map<String, dynamic>? extra}) async {
  final request = GetCurrentRequest()
    ..name = name
    ..extra = extra?.toStruct() ?? Struct();
  return await client.getCurrent(request);
}