@michieldecoster/home-automation
v0.8.1
Published
home automation software in typescript
Readme
Home-automation
Description
This is a repository for the use of home-automation.
Its developed in typescript and uses npm package manager to install.
Installation instructions
Uses npm to install
Command:
npm install michieldecoster/home-automationUsage instructions and examples
Creating a Thermostat
Create a JSONThermostat with the 3 required parameters:
- Temperature
- Range
- Unit: with the choice of
- Celsius
- Fahrenheit
- Kelvin
Example 1 :
const thermo = new JSONThermostat( { temperature: 75,range: 1, unit: "Fahrenheit" } )Example 2 :
const thermo = new JSONThermostat( { temperature: 30,range: 5, unit: "Celsius" } )Updating the Thermostat
The termostat can be updated through the use of the update method.
There are 3 values you can update:
- Temperature
- Range
- Unit: with the choice of
- Celsius
- Fahrenheit
- Kelvin
Example 1: Updating the temperature
thermo.update( { temperature:15 } )Example 2: Updating the temperature and range
thermo.update( { temperature:20, range: 5 } )Example 3: Updating the temperature, range and unit
thermo.update( { temperature:15, range:5, unit: "Celsius" } )Running the coded tests
npm run testsLicence
MIT
Github Pages
Author Information
Author: Michiel Decoster
Student at Vives Hogeschool Brugge
