Skip to content

Commit 0b41f71

Browse files
committed
[Bugfix] Metrix: Export 0 for empty values, fix for ESP8266
1 parent 7926811 commit 0b41f71

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/src/WebServer/Metrics.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,12 @@ void handle_metrics_devices() {
138138
addHtml(Cache.getTaskDeviceValueName(x, varNr));
139139
addHtml(F("\"} "));
140140
const String value(formatUserVarNoCheck(&TempEvent, varNr));
141-
addHtml(value.isEmpty() ? F("0") : value); // Return 0 for not-set values
141+
142+
if (value.isEmpty()) {
143+
addHtml('0'); // Return 0 for not-set values
144+
} else {
145+
addHtml(value);
146+
}
142147
addHtml('\n');
143148
}
144149
}

0 commit comments

Comments
 (0)