gotoHomePosition method Null safety

Future<bool> gotoHomePosition(
  1. String profileToken,
  2. [PtzSpeed? speed]
)

Operation to move the PTZ device to it's "home" position. The operation is supported if the HomeSupported element in the PTZNode is true.

Implementation

Future<bool> gotoHomePosition(String profileToken, [PtzSpeed? speed]) async {
  loggy.debug('gotoHomePosition');

  final envelope = await Soap.retrieveEnvelope(uri,
      onvif.secureRequest(SoapRequest.gotoHomePosition(profileToken, speed)));

  if (envelope.body.gotoHomePositionResponse == null) {
    throw Exception();
  }

  return true;
}