title: List nearby/discoverable bluetooth devices, including already paired, in Python, on Linux
body: <p>I'm trying to list all nearby/discoverable bluetooth devices, <em>including those already paired</em>, using Python on Linux.</p>
  
  <p>I know how to list services for a device using its address, and can connect successfully:</p>
  
  <pre><code>services = bluetooth.find_service(address='...')
  </code></pre>
  
  <p>Reading the PyBluez docs I would expect any nearby device to show up if I don't specify any criteria:</p>
  
  <blockquote>
    <p>"If no criteria are specified, then returns a list of all nearby services detected." </p>
  </blockquote>
  
  <p>The "only" thing I need right now is to be able to list already paired devices, whether they are on, off, nearby or not. Much like the list I'm getting in All Settings --> Bluetooth in Ubuntu/Unity. </p>
  
  <p>Btw, the following <em>does not</em> list already paired devices on my machine, even if they are on/nearby. Probably because they are not discoverable once paired:</p>
  
  <pre><code>import bluetooth
  for d in bluetooth.discover_devices(flush_cache=True):
      print d
  </code></pre>
  
  <p>Any ideas ...?</p>
  
  <p><strong>Edit:</strong> I found and installed "bluez-tools".</p>
  
  <pre><code>bt-device --list
  </code></pre>
  
  <p>... gives me the information I need, i.e. addresses of added devices.</p>
  
  <p>I've checked the C source, found out that this might not be as easy as I thought it would be. </p>
  
  <p>Still don't know how to do this in Python ... </p>
  
  <p><strong>Edit:</strong> I think DBUS might be what I should be reading up on. Seems complicated enough. If anyone has got some code to share I would be really happy. :)</p>