add restart button for ESP devices

This commit is contained in:
Nicu Hodos 2025-03-27 12:28:00 +01:00
parent 5d9b0862bf
commit f33ed5cd75

View File

@ -60,6 +60,15 @@ namespace HaESP {
return builder;
}
Builder<Button>& restartButton() {
return Builder<Button>::instance(new Button{"Restart", "restart",
[](const char* msg) {
if (strcmp("PRESS", msg) == 0) ESP.restart();
}
})
.withIcon("mdi:restart");
}
void enableSensors() {
if (activeSensors.heapStats) tHeap.enable();
if (activeSensors.restartInfo) tRestartInfo.enable();