def METHOD_NAME(config):
    interval_sec = config[CONF_UPDATE_INTERVAL].total_milliseconds / 1000
    interval_hz = 1.0 / interval_sec
    for datarate in sorted(QMC5883LDatarates.keys()):
        if float(datarate) >= interval_hz:
            return QMC5883LDatarates[datarate]
    return QMC5883LDatarates[200]