takeOnboardScreenshot method

Future<void> takeOnboardScreenshot(
  1. String id,
  2. CameraDetails details
)

Sends a command to the video program to take a screenshot onboard the video program

This will result in a much higher quality image, but will take much longer to capture, and will pause the video feed for several seconds

Implementation

Future<void> takeOnboardScreenshot(String id, CameraDetails details) async {
  final command = VideoCommand(id: id, details: details, takeSnapshot: true);
  if (await models.sockets.video.tryHandshake(
    message: command,
    timeout: const Duration(seconds: 1),
    constructor: VideoCommand.fromBuffer,
  )) {
    models.home.setMessage(
      severity: Severity.info,
      text: "Screenshot request received, video stream may pause",
    );
  } else {
    models.home.setMessage(
      severity: Severity.error,
      text: "Screenshot command not received",
    );
  }
}