voltage abstract method
Get the voltage in volts, and whether the power is AC (true) or DC (false).
var voltageObject = await myPowerSensor.voltage();
double voltageInVolts = voltageObject.volts;
bool isItAC = voltageObject.isAc;
For more information, see Power Sensor component.
Implementation
Future<Voltage> voltage({Map<String, dynamic>? extra});