power method

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

Get the power (watts)

var power = await myPowerSensor.power();

For more information, see Power Sensor component.

Implementation

@override
Future<double> power({Map<String, dynamic>? extra}) async {
  final request = GetPowerRequest()
    ..name = name
    ..extra = extra?.toStruct() ?? Struct();
  final response = await client.getPower(request);
  return response.watts;
}