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