lib/thermostat.rb
# Checks if climate control needs to bee enabled.
# control_climate(temperature, ideal_temperature, range)
# example:  control_climate(20, 18, 1)
Checks if climate control needs to bee enabled.
Checks if climate control needs to bee enabled .
def control_climate (temperature, ideal_temperature, range)
        if temperature <= (ideal_temperature - range)
            @heating = true
            @cooling = false
        elsif temperature >= (ideal_temperature + range)
            @heating = false
            @cooling = true
        else
            @heating = false
            @cooling = false
        end
    end
def control_climate ( temperature , ideal_temperature , range ) if temperature <= ( ideal_temperature - range ) @heating = true @cooling = false elsif temperature >= ( ideal_temperature + range ) @heating = false @cooling = true else @heating = false @cooling = false end end
Checks if climate control needs to bee enabled.
Checks if climate control needs to bee enabled .
temperature
<not_specific>
ideal_temperature
<not_specific>
range
<not_specific>