text: var key = config.MY_API_KEY;
  
  document.addEventListener("DOMContentLoaded", () => {
    const updateTemp = () => {
      document.querySelector("#temp").innerText = thermostat.temp;
      document.querySelector("#temp").className = thermostat.energyUsage();
    };
    const thermostat = new Thermostat();
    updateTemp();
    document.querySelector("#temp-up").addEventListener("click", () => {
      thermostat.up();
      updateTemp();
    });
    document.querySelector("#temp-down").addEventListener("click", () => {
      thermostat.down();
      updateTemp();
    });
    document.querySelector("#temp-reset").addEventListener("click", () => {
      thermostat.resetTemp();
      updateTemp();
    });
    document.querySelector("#powersaving-on").addEventListener("click", () => {
      thermostat.PowerSaveModeOn();
      document.querySelector("#powersaving-status").innerText = "On";
      updateTemp();
    });
    document.querySelector("#powersaving-off").addEventListener("click", () => {
      thermostat.PowerSaveModeOff();
      document.querySelector("#powersaving-status").innerText = "Off";
      updateTemp();
    });
    document.querySelector("#select-city").addEventListener("submit", (event) => {
      event.preventDefault();
      const city = document.querySelector("#current-city").value;
    });
  
    const displayWeather = (city) => {
      const url =
        `http://api.openweathermap.org/data/2.5/weather?q=${city}&appid=` +
        key +
        `&units=metric`;
  
      fetch(url)
        .then((response) => {
          return response.json();
        })
        .then((data) => {
          document.querySelector("#current-temperature").innerText =
            data.main.temp;
        });
    };
  
    displayWeather("London");
    document.querySelector("#select-city").addEventListener("submit", (event) => {
      event.preventDefault();
      const city = document.querySelector("#current-city").value;
  
      displayWeather(city);
    });
  });
  