toJSON method
Returns a SCD30result as a JSON string. fractionDigits controls the number fraction digits.
Implementation
String toJSON([int fractionDigits = 2]) {
return '{"CO2":"${co2.toStringAsFixed(fractionDigits)}","temperature":"${temperature.toStringAsFixed(fractionDigits)}","humidity":"${humidity.toStringAsFixed(fractionDigits)}"}';
}