cap:pm2.5
- read PM2.5 density (air quality)¶
This capability is used to mark sensors that monitor fine particulate matter (PM) of up to 2.5 micrometers (μm).
if(thing.matches('cap:pm2.5')) {
console.log('PM2.5:', await thing.pm2_5());
}
API¶
Events¶
Protected methods¶
Implementing capability¶
Implementors of this capability should call updatePM2_5
whenever the
detected PM2.5 changes.
const { Sensor, PM2_5 } = require('abstract-things/sensors');
class Example extends Sensor.with(PM2_5) {
constructor() {
super();
this.updatePM2_5(10);
}
}