def determine_if_alert(water_depth):
    '''Determine if an alert is required.  Only send if last alert has been
    sent more than the amount of time identified in the raspisump.conf file.
    Entry in conf file is alert_interval under the [email] section.'''

    alert_interval = configs['alert_interval']

    alert_log = '/home/pi/raspi-sump/logs/alert_log'

    if not os.path.isfile(alert_log):
        smtp_alerts(water_depth)
        log.log_alerts('Email SMS Alert Sent')

    else:
        with open(alert_log, 'rt') as f:
            last_row = deque(csv.reader(f), 1)[0]
            last_alert_sent = last_row[0]
            current_time = time.strftime('%Y-%m-%d %H:%M:%S')
            last_alert_time = datetime.strptime(
                last_alert_sent, '%Y-%m-%d %H:%M:%S'
            )
            time_now = datetime.strptime(current_time, '%Y-%m-%d %H:%M:%S')
            delta = (last_alert_time - time_now)
            minutes_passed = delta.seconds / 60
            
        if minutes_passed >= alert_interval:
            smtp_alerts(water_depth)
            log.log_alerts('Email SMS Alert Sent')

        else:
            pass
dataset/ETHPy150Open alaudet/raspi-sump/raspisump/alerts.py/determine_if_alert/swapped operands of `-`