#NEWLINE# def address_( ) : #NEWLINE# #INDENT# "\n    Get the many addresses of the Bluetooth adapter\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' bluetooth.address\n    " #NEWLINE# ret = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# cmd = 'hciconfig' #NEWLINE# out = __salt__ [ 'cmd.run' ] ( cmd ) . splitlines ( ) #NEWLINE# dev = '' #NEWLINE# for line in out : #NEWLINE# #INDENT# if line . startswith ( 'hci' ) : #NEWLINE# #INDENT# comps = line . split ( ':' ) #NEWLINE# dev = comps [ 0 ] #NEWLINE# ret [ dev ] = { #NEWLINE# #INDENT# 'device' : dev , #NEWLINE# 'path' : '/sys/class/bluetooth/{0}' . format ( dev ) , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# if ( 'BD Address' in line ) : #NEWLINE# #INDENT# comps = line . split ( ) #NEWLINE# ret [ dev ] [ 'address' ] = comps [ 2 ] #NEWLINE# #UNINDENT# if ( 'DOWN' in line ) : #NEWLINE# #INDENT# ret [ dev ] [ 'power' ] = 'off' #NEWLINE# #UNINDENT# if ( 'UP RUNNING' in cmd ) : #NEWLINE# #INDENT# ret [ dev ] [ 'power' ] = 'on' #NEWLINE# #UNINDENT# #UNINDENT# return ret