def entry_in_entries(entry, entries, mac, serial):
    """Check if a device entry is in a list of device entries."""
    if mac is None and serial is None:
        return entry in entries
    for item in entries:
        if item.description is not None:
            e_device = item.description.get('device', {})
            e_mac = e_device.get('macAddress')
            e_serial = e_device.get('serialNumber')
        else:
            e_mac = None
            e_serial = None
        if e_mac == mac and e_serial == serial and item.st == entry.st:
            return True
    return False
