cap:carbon-dioxide
- read carbon dioxide level¶
This capability is used to mark sensors that report their carbon dioxide level as PPM (parts per million). The value is reported as a number.
if(thing.matches('cap:carbon-dioxide')) {
console.log('Carbon dioxide:', await thing.carbonDioxide());
}
API¶
Events¶
Protected methods¶
Implementing capability¶
Implementors of this capability should call updateCarbonDioxide
whenever the
PPM of carbon dioxide changes.
const { Sensor, CarbonDioxide } = require('abstract-things/sensors');
class Example extends Sensor.with(CarbonDioxide) {
constructor() {
super();
this.updateCarbonDioxide(390);
}
}