rotate method

Future<void> rotate(
  1. RotateCommand command
)

Implementation

Future<void> rotate(RotateCommand command) async {
  if (messageAttributes.rotateCmd == null) {
    throw ButtplugClientDeviceException("$name ($displayName) does not support rotate commands");
  }
  var rotateMsg = RotateCmd();
  rotateMsg.deviceIndex = index;
  var subcommandList = <RotateSubcommand>[];
  command.asMap(messageAttributes.rotateCmd!.length).forEach((key, value) {
    subcommandList.add(RotateSubcommand(key, value.speed, value.clockwise));
  });
  rotateMsg.rotations = subcommandList;
  return await _sendMessageExpectOk(rotateMsg);
}