diff --git a/gateway/include/devices.h b/gateway/include/devices.h index f4977b8..a70c97a 100644 --- a/gateway/include/devices.h +++ b/gateway/include/devices.h @@ -2,6 +2,7 @@ #define MAIN_DEVICE_ID "rc-gateway" +#include "esp.h" #include "ha.h" using namespace Ha; @@ -40,11 +41,11 @@ namespace OilTank { return Builder::instance(new Sensor{ "Depth", id }) .asDevice(device) .withDeviceClass("distance") - .withUnitMseasure("cm") + .withUnitMeasure("cm") .withValueTemplate("{{ value_json.sensor.value }}") .addSecondary( Builder::instance(new Sensor{ "Level", id }) - .withUnitMseasure("%") + .withUnitMeasure("%") .withValueTemplate("{{ 100 - ((value_json.sensor.value-12)|float*100/120)|round(2) }}") .build() ) @@ -116,7 +117,10 @@ Command* commands[] = { [](const char* msg) { if (strcmp("PRESS", msg) == 0) ESP.restart(); } - }).asDevice(gatewayDevice).build(), + }).asDevice(gatewayDevice) + .addPreconfigured(HaESP::heapStats) + .addPreconfigured(HaESP::restartInfo) + .build(), Builder