from datetime import datetime


def find_wait_time(t=None):
    """
    Use the current time (minutes) passed the hour to determine the wait time until
    the next expected period. This function should only be needed once as each interval
    will be 30 minutes after the last lookup.

    :param t: Time in minutes currently past the hour, When `None` use datatime
    """
    
    if t is None:
        _t = int(datetime.now().minute)
    else:
        _t = t
    
    m = abs(int(_t) - 65) % 30
    if m == 0:
        return 30
    return m