def pair(address, key):
 if (not salt.utils.validate.net.mac(address)):
  raise CommandExecutionError('Invalid BD address passed to bluetooth.pair')
 try:
  int(key)
 except Exception:
  raise CommandExecutionError('bluetooth.pair requires a numerical key to be used')
 addy = address_()
 cmd = 'echo {0} | bluez-simple-agent {1} {2}'.format(_cmd_quote(addy['device']), _cmd_quote(address), _cmd_quote(key))
 out = __salt__['cmd.run'](cmd, python_shell=True).splitlines()
 return out

def pair ( address , key ) : if ( not salt . utils . validate . net . mac ( address ) ) : raise CommandExecutionError ( 'Invalid BD address passed to bluetooth.pair' ) try : int ( key ) except Exception : raise CommandExecutionError ( 'bluetooth.pair requires a numerical key to be used' ) addy = address_ ( ) cmd = 'echo {0} | bluez-simple-agent {1} {2}' . format ( _cmd_quote ( addy [ 'device' ] ) , _cmd_quote ( address ) , _cmd_quote ( key ) ) out = __salt__ [ 'cmd.run' ] ( cmd , python_shell = True ) . splitlines ( ) return out
pair the bluetooth adapter with a device cli example: .