Add co2_concentration to the JSON payload
This commit is contained in:
@@ -38,8 +38,9 @@ void disconnect_mqtt(PubSubClient &client, const char *topic) {
|
|||||||
|
|
||||||
size_t construct_json(float *data, char *buffer, int buffer_size) {
|
size_t construct_json(float *data, char *buffer, int buffer_size) {
|
||||||
JsonDocument json;
|
JsonDocument json;
|
||||||
json["temperature"] = data[0];
|
json["co2_concentration"] = data[0];
|
||||||
json["humidity"] = data[1];
|
json["temperature"] = data[1];
|
||||||
|
json["humidity"] = data[2];
|
||||||
size_t payload_size = serializeJson(json, buffer, buffer_size);
|
size_t payload_size = serializeJson(json, buffer, buffer_size);
|
||||||
return payload_size;
|
return payload_size;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user