def cmd_list_devices(self, *args):
    scan_time = 300
    try:
        self.last_scan = ScanDelegate()
        scanner = Scanner().withDelegate(self.last_scan)
        print('Listing Bluetooth LE devices in range for {} seconds. Press CTRL+C to abort searching.'.format(scan_time))
        print('{: <5} {: <30} {: <12}'.format('ID', 'Name', 'Mac address'))
        print('{: <5} {: <30} {: <12}'.format('--', '----', '-----------'))
        scanner.scan(scan_time)
    except KeyboardInterrupt:
        print('\n')
    except RuntimeError as e:
        logger.error('Problem with the Bluetooth adapter : {}'.format(e))
        return False
def cmd_list_devices(self, *args):
    scan_time = 300
    try:
        self.last_scan = ScanDelegate()
        scanner = Scanner().withDelegate(self.last_scan)
        print('Listing Bluetooth LE devices in range for {} seconds. Press CTRL+C to abort searching.'.format(scan_time))
        print('{: <5} {: <30} {: <12}'.format('ID', 'Name', 'Mac address'))
        print('{: <5} {: <30} {: <12}'.format('--', '----', '-----------'))
        scanner.scan(scan_time)
    except KeyboardInterrupt:
        print('\n')
    except RuntimeError as e:
        logger.error('Problem with the Bluetooth adapter : {}'.format(e))
        return False