use common restart button

This commit is contained in:
Nicu Hodos 2025-03-27 12:31:02 +01:00
parent 67313b22c8
commit 4e12ca89eb

View File

@ -114,13 +114,8 @@ struct EasyHomeSwitch : Switch {
}; };
Command* commands[] = { Command* commands[] = {
Builder<Button>::instance(new Button{"Restart", "restart", HaESP::restartButton()
[](const char* msg) {
if (strcmp("PRESS", msg) == 0) ESP.restart();
}
})
.asDevice(gatewayDevice) .asDevice(gatewayDevice)
.withIcon("mdi:restart")
.addPreconfigured(HaESP::heapStats) .addPreconfigured(HaESP::heapStats)
.addPreconfigured(HaESP::restartInfo) .addPreconfigured(HaESP::restartInfo)
.build(), .build(),