add pre-configured button for updating the heap statistics
This commit is contained in:
parent
a23bf27c50
commit
98fbf2a55e
19
src/esp.h
19
src/esp.h
@ -47,19 +47,24 @@ namespace HaESP {
|
||||
.withPrecision(0)
|
||||
.withValueTemplate("{{ value_json.fragmentation }}")
|
||||
.withJsonAttributes("{{ value_json.heap | tojson }}")
|
||||
.build());
|
||||
builder.addDiagnostic(Builder<Sensor>(new Sensor{ "Heap free", "heap_free" })
|
||||
.build())
|
||||
.addDiagnostic(Builder<Sensor>(new Sensor{ "Heap free", "heap_free" })
|
||||
.withDeviceClass("data_size")
|
||||
.withUnitMeasure("B")
|
||||
.withPrecision(0)
|
||||
.build()
|
||||
);
|
||||
builder.addDiagnostic(Builder<Sensor>(new Sensor{ "Heap max free block", "heap_max_free_block" })
|
||||
.build())
|
||||
.addDiagnostic(Builder<Sensor>(new Sensor{ "Heap max free block", "heap_max_free_block" })
|
||||
.withDeviceClass("data_size")
|
||||
.withUnitMeasure("B")
|
||||
.withPrecision(0)
|
||||
.build()
|
||||
);
|
||||
.build())
|
||||
.addSecondary(new Button{"Update heap stats", "update_heap_stats",
|
||||
[](const char* msg) {
|
||||
if ((strcmp("PRESS", msg) == 0) && tHeap.isEnabled()) {
|
||||
tHeap.cancel();
|
||||
tHeap.restart();
|
||||
}}});
|
||||
|
||||
activeSensors.heapStats = true;
|
||||
return builder;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user