{"size": 914, "ext": "js", "max_stars_repo_path": "src/App.js", "max_stars_repo_name": "gavinwcheng/thermostat_withJoe", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/App.js", "max_issues_repo_name": "gavinwcheng/thermostat_withJoe", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/App.js", "max_forks_repo_name": "gavinwcheng/thermostat_withJoe", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.4666666667, "max_line_length": 77, "alphanum_fraction": 0.7439824945}
thermostat = new Thermostat();

var updateHTML = function() {
  document.getElementById("Temp").innerHTML = thermostat.temperature;
  document.getElementById("Temp").style.color = thermostat.colour();
};

var updateThermostat = function(callMethodOnThermostat) {
  callMethodOnThermostat;
  updateHTML();
};

document.addEventListener('DOMContentLoaded', function() {
  document.getElementById("Up").addEventListener("click", function() {
    updateThermostat(thermostat.increaseTemperature());
  });

  document.getElementById("Down").addEventListener("click", function() {
    updateThermostat(thermostat.decreaseTemperature());
  });

  document.getElementById("Reset").addEventListener("click", function() {
    updateThermostat(thermostat.resetTemperature());
  });

  document.getElementById("PowerSave").addEventListener("click", function() {
    updateThermostat(thermostat.switchPowerSaving());
  });
});
