code: def settings(ctx, slot, new_access_code, delete_access_code, enter, pacing,
               force):
      
      controller = ctx.obj['controller']
  
      if (new_access_code is not None) and delete_access_code:
          ctx.fail('--new-access-code conflicts with --delete-access-code.')
  
      if not controller.slot_status[slot - 1]:
          ctx.fail('Not possible to update settings on an empty slot.')
  
      if new_access_code is not None:
          if new_access_code == '':
              new_access_code = click.prompt(
                  'Enter new access code', show_default=False, err=True)
  
          try:
              new_access_code = parse_access_code_hex(new_access_code)
          except Exception as e:
              ctx.fail('Failed to parse access code: ' + str(e))
  
      force or click.confirm(
          'Update the settings for slot {}? '
          'All existing settings will be overwritten.'.format(slot), abort=True,
          err=True)
      click.echo('Updating settings for slot {}...'.format(slot))
  
      if pacing is not None:
          pacing = int(pacing)
  
      try:
          controller.update_settings(slot, enter=enter, pacing=pacing)
      except YkpersError as e:
          _failed_to_write_msg(ctx, e)
  
      if new_access_code:
          try:
              controller.set_access_code(slot, new_access_code)
          except Exception as e:
              logger.error('Failed to set access code', exc_info=e)
              ctx.fail('Failed to set access code: ' + str(e))
  
      if delete_access_code:
          try:
              controller.delete_access_code(slot)
          except Exception as e:
              logger.error('Failed to delete access code', exc_info=e)
              ctx.fail('Failed to delete access code: ' + str(e))
docs: Update the settings for a slot.
  
      Change the settings for a slot without changing the stored secret.
      All settings not specified will be written with default values.