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. |
Methods
getId() → {number}
Returns the sensor id.
getStationId() → {number}
Returns the sensor station id.
Example
const sensor = new Station(sensorObject);
const sensorStationID = sensor.getStationId();
// => 6085
getName() → {string}
Returns the sensor name.
Example
const sensor = new Station(sensorObject);
const sensorName = sensor.getName();
// => "pył zawieszony PM10"
getCode() → {string}
Returns the sensor code.
(async) fetchData()
Fetch sensor data.
getRaw() → {Sensor~Object}
Returns the sensor raw object.
Type Definitions
Object :object
Sensor object
Properties:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id |
number |
Sensor id. |
|||||||||||||||
stationId |
number |
Station id. |
|||||||||||||||
param |
object |
Sensor params. Properties
|
Data :object
Sensor data
Properties:
Name | Type | Description |
---|---|---|
data |
string |
Date and time of measurement. |
value |
number |
The value of the measurement. |