UNPKG

node-flipr

Version:

Unofficial module for Flipr devices

85 lines (84 loc) 3.44 kB
/** * Measure specific module. * @module Flipr * @author Nicolas Nunge <me@nikkow.eu> * @version 1.0.0 */ import { TemperatureUnit } from '../enums/temperature-unit.enum'; import { DisinfectantType } from '../enums/disinfectanttype.enum'; import { Deviation } from '../enums/deviation.enum'; /** FliprMeasure is used to handle metrics returned by Flipr */ export declare class FliprMeasure { private measureDate; private batteryLevel; private uvIndex; private cloudCoverage; private temperature; private disinfectantType; private disinfectantDeviation; private disinfectantDeviationSector; private phValue; private phDeviation; private phDeviationSector; /** * Creates a new instance of FliprMeasure */ constructor(rawMeasureObject: any); /** * Returns the date when these metrics were captured by Flipr. * @return {Date|null} a native Date object of the metric capture date. */ getDate(): Date | null; /** * Returns the UV index at the moment the metrics were captured. * @return {number|null} */ getUVIndex(): number | null; /** * Returns the cloud coverage at the moment the metrics were captured. * @param {boolean} expectRawValue * @return {number|null} When the "expectRawValue" parameter is set to true, the method will return the cloud coverage as returned by Flipr: a float 0 <= x <= 1. Otherwhise, the result will be returned as a percentage 0 <= x <= 100. */ getCloudCoverage(expectRawValue: boolean): number | null; /** * Returns the device's battery level at the moment the metrics were captured. * @param {boolean} expectRawValue * @return {number|null} When the "expectRawValue" parameter is set to true, the method will return the battery level as returned by Flipr: a float 0 <= x <= 1. Otherwise, the result will be returned as a percentage 0 <= x <= 100. */ getBatteryLevel(expectRawValue: boolean): number | null; /** * Returns the water's temperature in various units. * @param {TemperatureUnit} unit Specifies the unit the result should be returned. See TemperatureUnit enum for possible values. * @return {number|null} */ getTemperature(unit?: TemperatureUnit): number | null; /** * Returns the type of disinfectant currently in use. * @return {DisinfectantType|null} */ getDisinfectantType(): DisinfectantType | null; /** * Returns the current disinfectant deviation/variation. * @param {boolean} expectRawValue When true, the result will be the raw deviation (as a number, -1 <= x <= 1). Otherwise, the deviation sector (see Deviation enum) * @return {number|null} */ getDisinfectantDeviation(expectRawValue: boolean): Deviation | number | null; /** * Returns the raw PH value. * @return {number|null} */ getPHValue(): number | null; /** * Returns the current PH deviation/variation. * @param {boolean} expectRawValue When true, the result will be the raw deviation (as a number, -1 <= x <= 1). Otherwise, the deviation sector (see Deviation enum) * @return {number|null} */ getPHDeviation(expectRawValue: boolean): Deviation | number | null; /** * Converts API values to Deviation * @private * @param {string} input * @return {Deviation} */ private stringToDeviation; }