def METHOD_NAME(self, temp_name, temp_list):
    temp_hyst_conf = self.get_temp_hyst_conf(temp_name)
    hyst_min = temp_hyst_conf["hyst_min"]
    hyst_max = temp_hyst_conf["hyst_max"]
    temp_min = temp_hyst_conf["temp_min"]
    temp_max = temp_hyst_conf["temp_max"]
    rising = temp_hyst_conf["rising"]
    descending = temp_hyst_conf["descending"]
    last_hyst_value = temp_hyst_conf["last_hyst_value"]
    current_temp = temp_list[1]
    last_temp = temp_list[0]
    hyst_debug("calc_hyst_val, temp_name: %s, current_temp: %s, last_temp: %s, last_hyst_value: %s" %
        (temp_name, current_temp, last_temp, last_hyst_value))
    if current_temp < temp_min:
        hyst_debug("%s current_temp %s less than temp_min %s, set min hyst value: %s" %
            (temp_name, current_temp, temp_min, hyst_min))
        return hyst_min
    if current_temp > temp_max:
        hyst_debug("%s current_temp %s more than temp_max %s, set max hyst value: %s" %
            (temp_name, current_temp, temp_max, hyst_max))
        return hyst_max
    if last_temp is None: # first time
        hyst_value = rising[current_temp]
        hyst_debug("last_temp is None, it's first hysteresis, using rising hyst value: %s" % hyst_value)
        return hyst_value
    if current_temp == last_temp: # temp unchanging
        hyst_debug("current_temp equal last_temp, keep last hyst value: %s" % last_hyst_value)
        return last_hyst_value
    if current_temp > last_temp:
        calc_hyst_value = rising[current_temp]
        if calc_hyst_value < last_hyst_value:
            hyst_value = last_hyst_value
        else:
            hyst_value = calc_hyst_value
        hyst_debug("temp rising, last_hyst_value: %s, calc_hyst_value: %s, set hyst value: %s" %
            (last_hyst_value, calc_hyst_value, hyst_value))
        return hyst_value
    calc_hyst_value = descending[current_temp]
    if calc_hyst_value > last_hyst_value:
        hyst_value = last_hyst_value
    else:
        hyst_value = calc_hyst_value
    hyst_debug("temp descending, last_hyst_value: %s, calc_hyst_value: %s, set hyst value: %s" %
        (last_hyst_value, calc_hyst_value, hyst_value))
    return hyst_value