idasen_controller/main.py
async def scan(mac_address = None):
    """Scan for a bluetooth device with the configured address and return it or return all devices if no address specified"""
    print('Scanning\r', end ="")
    scanner = BleakScanner()
    devices = await scanner.discover(device=config['adapter_name'], timeout=config['scan_timeout'])
    if not mac_address:
        print('Found {} devices using {}'.format(len(devices), config['adapter_name']))
        for device in devices:
            print(device)
        return devices
    for device in devices:
        if (device.address == mac_address):
            print('Scanning - Desk Found')
            return device
    print('Scanning - Desk {} Not Found'.format(mac_address))
    return None
Scan for a bluetooth device with the configured address and return it or return all devices if no address specified
Scan for a bluetooth device with the configured address and return it or return all devices if no address specified
Scan for a bluetooth device with the configured address and return it or return all devices if no address specified
async def scan(mac_address = None):
    print('Scanning\r', end ="")
    scanner = BleakScanner()
    devices = await scanner.discover(device=config['adapter_name'], timeout=config['scan_timeout'])
    if not mac_address:
        print('Found {} devices using {}'.format(len(devices), config['adapter_name']))
        for device in devices:
            print(device)
        return devices
    for device in devices:
        if (device.address == mac_address):
            print('Scanning - Desk Found')
            return device
    print('Scanning - Desk {} Not Found'.format(mac_address))
    return None
async def scan ( mac_address = None ) : print ( 'Scanning\r' , end = "" ) scanner = BleakScanner ( ) devices = await scanner . discover ( device = config [ 'adapter_name' ] , timeout = config [ 'scan_timeout' ] ) if not mac_address : print ( 'Found {} devices using {}' . format ( len ( devices ) , config [ 'adapter_name' ] ) ) for device in devices : print ( device ) return devices for device in devices : if ( device . address == mac_address ) : print ( 'Scanning - Desk Found' ) return device print ( 'Scanning - Desk {} Not Found' . format ( mac_address ) ) return None
Scan for a bluetooth device with the configured address and return it or return all devices if no address specified
Scan for a bluetooth device with the configured address and return it or return all devices if no address specified
"""Scan for a bluetooth device with the configured address and return it or return all devices if no address specified"""
mac_address