getBatteryVoltage method

Future<bool> getBatteryVoltage()

Requests a read of the battery voltage of the connected device.

The event BatteryRead is fired when the voltage has been read. Returns true if the request was successfully made, false otherwise.

Implementation

Future<bool> getBatteryVoltage() async {
  if (!connected) {
    throw ESenseException('Not connected to any eSense device.');
  }
  return await _eSenseManagerMethodChannel
          .invokeMethod<bool?>('getBatteryVoltage') ??
      false;
}