Makers Academy - Week 5 Pair programming challenge

Thermostat 🌡️

Technologies: Javascript, Jasmine, Rspec, Sinatra, HTML, CSS,

Task | Installation Instructions | Functional Description | Further improvements |

thermostat

Build the logic needed to model a simple thermostat.

This challenge is the fifth afternoon pair programming challenge at Makers Academy.

  1. Fork this repository, clone to your local machine then change into the directory:
$ git clone git@github.com:davmcgregor/thermostat-js.git
$ cd thermostat-js
  1. Load dependencies with bundle:
$ gem install bundle
$ bundle
  1. Run jasmine for tests and coverage
$ open SpecRunner.html
  1. Run the app on a local server and use on the broswer: http://localhost:9292
$ rackup
  • Thermostat starts at 20 degrees
  • You can increase the temperature with an up function
  • You can decrease the temperature with a down function
  • The minimum temperature is 10 degrees
  • If power saving mode is on, the maximum temperature is 25 degrees
  • If power saving mode is off, the maximum temperature is 32 degrees
  • Power saving mode is on by default
  • You can reset the temperature to 20 with a reset function
  • You can ask about the thermostat's current energy usage: < 18 is low-usage, < 25 is medium-usage, anything else is high-usage.
  • Use a jQuery AJAX call to get the weather information for London from a weather API. Display the weather information to the user.
  • Add further functionality so that the user can select their current city and the weather provided is for the selected city.