def call_cool(tstat):
    """
    Adjusts the temperature setpoints in order to call for cooling. Returns
    a handler to call when you want to reset the thermostat
    """
    current_hsp, current_csp = tstat.heating_setpoint, tstat.cooling_setpoint
    current_temp = tstat.temperature
    tstat.write({
        'heating_setpoint': current_temp-20,
        'cooling_setpoint': current_temp-10,
        'mode': COOL,
    })

    def restore():
        tstat.write({
            'heating_setpoint': current_hsp,
            'cooling_setpoint': current_csp,
            'mode': AUTO,
        })
    return restore
Adjusts the temperature setpoints in order to call for cooling. Returns
    a handler to call when you want to reset the thermostat