Sensor

Sensor

Class to parse sensor object.

Constructor

new Sensor(sensor, data)

Create a sensor.

Parameters:
Name Type Description
sensor Sensor~Object

The sensor object.

data Array.<Sensor~Data>

The sensor data.

Properties:
Name Type Description
sensor Sensor~Object

The station object.

Source:

Methods

getId() → {number}

Returns the sensor id.

Source:
Example
const sensor = new Station(sensorObject);
const sensorID = sensor.getId();
// => 6085

getStationId() → {number}

Returns the sensor station id.

Source:
Example
const sensor = new Station(sensorObject);
const sensorStationID = sensor.getStationId();
// => 6085

getName() → {string}

Returns the sensor name.

Source:
Example
const sensor = new Station(sensorObject);
const sensorName = sensor.getName();
// => "pył zawieszony PM10"

getCode() → {string}

Returns the sensor code.

Source:
Example
const sensor = new Station(sensorObject);
const sensorCode = sensor.getCode();
// => "PM10"

(async) fetchData()

Fetch sensor data.

Source:
Example
const sensor = new Station(sensorObject);
const sensorCode = sensor.fetchData();

getRaw() → {Sensor~Object}

Returns the sensor raw object.

Source:
Example
const sensor = new Station(sensorObject);
const sensorCode = sensor.getRaw();

Type Definitions

Object :object

Sensor object

Properties:
Name Type Description
id number

Sensor id.

stationId number

Station id.

param object

Sensor params.

Properties
Name Type Description
paramName string

Sensor param name.

paramFormula string

Sensor param formula.

paramCode string

Sensor param code.

idParam string

Sensor param id.

Source:

Data :object

Sensor data

Properties:
Name Type Description
data string

Date and time of measurement.

value number

The value of the measurement.

Source: