Options
All
  • Public
  • Public/Protected
  • All
Menu

HTTPTHermostat Class

This class contains all methods to create a httpThermostat.

An instance of this can request data from a url ( temperature ), can handle this by using a promise, and return the data, or if the thermostat is heating or cooling.

Hierarchy

Index

Constructors

constructor

  • new HttpThermostat(temperature: number, range: number, url: string): HttpThermostat
  • Create an instance of a HttpThermostat In contrast to the normal thermostat class, this class constructor needs an argument more. The added argument is the url string. This url must contain a url to an existing getter API (REST)

    Parameters

    • temperature: number
    • range: number
    • url: string

    Returns HttpThermostat

Properties

Private httpSensor

httpSensor: any

Accessors

httpIsCooling

  • get httpIsCooling(): Promise<boolean>
  • Getting state of cooling

    Returns Promise<boolean>

    this method returns a promise with a boolean value

httpIsHeating

  • get httpIsHeating(): Promise<boolean>
  • Getting state of heating

    Returns Promise<boolean>

    this method returns a promise with a boolean value

isCooling

  • get isCooling(): boolean

isHeating

  • get isHeating(): boolean

isResult

  • get isResult(): Promise<number>
  • Getting result ( temperature )

    Returns Promise<number>

    this method returns a promise with a number value

Methods

getTemperatureRange

  • getTemperatureRange(): number

getWantedTemperature

  • getWantedTemperature(): number

setCurrentTemperature

  • setCurrentTemperature(currentTemperature: number): void

Private storeResult

  • storeResult(): Promise<unknown>
  • This method stores the result in the inherited thermostat class

    Returns Promise<unknown>

    this method returns a promise with an unknown value

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