def get_device_from_entities(entities):
    """Get first device from entities"""

    for item in entities:
        if item['entity'] == 'device':
            return item['sourceText']

    return None