text: $(document).ready(function() {
    var thermostat = new Thermostat();
    updateTemperature();
  
    $('#temperature-up').click(function() {
      thermostat.up();
      updateTemperature();
    });
  
    $('#temperature-down').click(function() {
      thermostat.down();
      updateTemperature();
    });
  
    $('#temperature-reset').click(function() {
      thermostat.resetTemperature();
      updateTemperature();
    });
  
    $('#powersaving-on').click(function() {
      thermostat.switchPowerSavingModeOn();
      $('#power-saving').text('on');
      updateTemperature();
    });
  
    $('#powersaving-off').click(function() {
      thermostat.switchPowerSavingModeOff();
      $('#power-saving').text('off');
      updateTemperature();
    });
  
    function updateTemperature() {
      $('#temperature').text(thermostat.temperature);
      $('#temperature').attr('class', thermostat.energyUsage());
  
    }
  
    $('#select-city').submit(function(event) {
      event.preventDefault();
      var city = $('#current-city').val();
      $.get('http://api.openweathermap.org/data/2.5/weather?q=' + city + '&appid=786c15e5e7e885014e8fea49bbf0acca&units=metric', function(data) {
        $('#current-temperature').text(data.main.temp);
      });
    });
  
  });
  