Extract and return device from scan results.

def determine_device(kal_out):
    """Extract and return device from scan results."""
    device = ""
    while device == "":
        for line in kal_out.splitlines():
            if "Using device " in line:
                device = str(line.split(' ', 2)[-1])
        if device == "":
            device = None
    return device