def down_by_arrival(*filters, local_dir=".", remote_dir=DEFAULT_REMOTE_DIR):
    """Monitors a remote FlashAir directory and generates sets of
    new files to be downloaded from FlashAir.
    Sets to download are generated in a tuple like (Direction.down, {...}).
    The generator yields AFTER each download actually takes place."""
    remote_monitor = watch_remote_files(*filters, remote_dir=remote_dir)
    _, file_set = next(remote_monitor)
    _notify_sync_ready(len(file_set), remote_dir, local_dir)
    for new_arrivals, file_set in remote_monitor:
        if new_arrivals:
            _notify_sync(Direction.down, new_arrivals)
            down_by_files(new_arrivals, local_dir)
            _notify_sync_ready(len(file_set), remote_dir, local_dir)
        yield Direction.down, new_arrivals
Monitors a remote FlashAir directory and generates sets of
    new files to be downloaded from FlashAir.
    Sets to download are generated in a tuple like (Direction.down, {...}).
    The generator yields AFTER each download actually takes place.