Options
All
  • Public
  • Public/Protected
  • All
Menu

Thermostat Class

This class contains all methods to create a basic Thermostat.

Hierarchy

Index

Constructors

constructor

  • new Thermostat(_wantedTemperature: number, _range: number): Thermostat
  • Create an instance of a Thermostat it needs a temperature argument and a range argument initialize the thermostat

    Parameters

    • _wantedTemperature: number
    • _range: number

    Returns Thermostat

Properties

Private _range

_range: number

Private _wantedTemperature

_wantedTemperature: number

Private currentTemperature

currentTemperature: number

Accessors

Private halfOfRange

  • get halfOfRange(): number
  • Returning half of range set by the constructor

    Returns number

    this message returns half of the range

isCooling

  • get isCooling(): boolean
  • Returning if the thermostat is cooling

    Returns boolean

    this message returns state of the thermostat as a boolean

isHeating

  • get isHeating(): boolean
  • Returning if the thermostat is heating

    Returns boolean

    this message returns state of the thermostat as a boolean

Private range

  • get range(): number
  • Getting temperature range

    This is inserted to meet Single Responsibility and managing dependencies

    Returns number

    this method returns the temperature range as a number

Private wantedTemperature

  • get wantedTemperature(): number
  • Getting wanted Temperature

    This is inserted to meet Single Responsibility and managing dependencies

    Returns number

    this method returns the temperature range as a number

Methods

getTemperatureRange

  • getTemperatureRange(): number
  • Getting temperature range

    Returns number

    this method returns the range number

getWantedTemperature

  • getWantedTemperature(): number
  • Getting wanted temperature

    Returns number

    this method returns the wanted number

setCurrentTemperature

  • setCurrentTemperature(currentTemperature: number): void
  • Setting the current temperature

    Parameters

    • currentTemperature: number

    Returns void

    this method returns current temperature number

update

  • updating the current temperature, it returns an Thermostat result object

    Parameters

    • currentTemperature: number

    Returns ThermostatResult

    this method returns an instance of the interface thermostatResult

Generated using TypeDoc