|
|
|
@ -193,13 +193,21 @@ void readSensor() {
|
|
|
|
|
|
|
|
|
|
avgTemperature = avgTemperature / savedTemperatures;
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < ds18Count; i++) {
|
|
|
|
|
metrics = getMetricsVar(temperature, tempC);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String getMetricsVar(float temperature[], float tempC[]) {
|
|
|
|
|
metrics = "temp{device=\"";
|
|
|
|
|
for (int i = 0; i < sizeof(temperature) - 1 ; i++) {
|
|
|
|
|
if (i != 0) {
|
|
|
|
|
metrics += "\ntemp{device=\"";
|
|
|
|
|
}
|
|
|
|
|
metrics += i;
|
|
|
|
|
metrics += "\"} ";
|
|
|
|
|
metrics += temperature[i];
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < ds18Count; i++) {
|
|
|
|
|
for (int i = 0; i < sizeof(tempC) - 1; i++) {
|
|
|
|
|
metrics += "\nraw_temp{device=\"";
|
|
|
|
|
metrics += i;
|
|
|
|
|
metrics += "\"} ";
|
|
|
|
@ -214,6 +222,7 @@ void readSensor() {
|
|
|
|
|
metrics += offset;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return metrics;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void startConversion() {
|
|
|
|
|