Options
All
  • Public
  • Public/Protected
  • All
Menu

Class JSONThermostat

JSONThermostat class that can construct a Thermostat that takes in a JSON object with 3 required paramters:

  • Temperature
  • Range
  • Unit: with the choice of
    • Celsius
    • Fahrenheit
    • Kelvin
 import JSONThermostat from './JSONThermostat'
 const thermo = new JSONThermostat( { temperature: 75,range: 1, unit: "Fahrenheit" } )

These are also the ones you can update through the update() method

thermo.update( { temperature:12 } )
thermo.update( { temperature:20, range: 5 } )
thermo.update( { temperature:15, range:5, unit: "Celsius" } )

Hierarchy

  • JSONThermostat

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

range

range: number = 0

temperature

temperature: number = 0

temperatureConverter

temperatureConverter: Temperature = new Temperature()

unit

unit: string = ""

Methods

update

  • update(string: any): { cooling: boolean; heating: boolean }
  • Parameters

    • string: any

    Returns { cooling: boolean; heating: boolean }

    • cooling: boolean
    • heating: boolean

Generated using TypeDoc