SensorsList

SensorsList

Class to parse sensors list.

Constructor

new SensorsList(sensors)

Create a sensor.

Parameters:
Name Type Description
sensors Array.<Sensor~Object>

The array of sensor objects.

Properties:
Name Type Description
sensors Object.<string, Sensor>

The sensors list.

Source:

Methods

getList() → {Object.<string, Sensor>}

Returns the sensors list.

Source:
Example
const sensorsList = new SensorsList(sensorObjects);
const sensors = sensorsList.getList();

getSensor(code) → {Sensor}

Returns the sensor by code.

Parameters:
Name Type Description
code string

The sensor code.

Source:
Example
const sensorsList = new SensorsList(sensorObjects);
const sensor = sensorsList.getSensor("PM10");

getCodes() → {Array.<string>}

Returns the codes array.

Source:
Example
const sensorsList = new SensorsList(sensorObjects);
const codes = sensorsList.getCodes();

(async) prefetchData()

Prefetch data for all sensors.

Source:
Example
const sensorsList = new SensorsList(sensorObjects);
const codes = sensorsList.prefetchData();