Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Unit

Unit class can convert a temperature form fahrenheit, kelvin or degrees to fahrenheit, kelvin or degrees

import Unit from './Unit.ts'

const myUnit = new Unit()
myUnit.convert(temperature, unit)

Hierarchy

  • Unit

Index

Constructors

constructor

Properties

convertTemperature

convertTemperature: number

degrees

degrees: string

fahrenheit

fahrenheit: string

kelvin

kelvin: string

Methods

convert

  • convert(temperature: number, unit: string): void
  • convert temperature value

    Parameters

    • temperature: number

      is the current temperature value that is given by the sensor

    • unit: string

      is the unit fahrenheit, kelvin or degrees from the temperature

    Returns void

getConvertSettings

  • getConvertSettings(settings: any): object
  • convert temperature value

    Parameters

    • settings: any

      is the values of the settings for the thermostat

    Returns object

    converted settings

getConvertUpdate

  • getConvertUpdate(update: any): object
  • convert temperature value

    Parameters

    • update: any

    Returns object

    converted Update

Generated using TypeDoc