diff --git a/src/ha.h b/src/ha.h index c7e5bfb..ce7af34 100644 --- a/src/ha.h +++ b/src/ha.h @@ -245,6 +245,7 @@ namespace Ha { unsigned int min = 1; unsigned int max = 100; unsigned int step = 1; + const char* unitMeasure = nullptr; Number(const char* name, const char* id, onMessage f) : Component(id, name, "number"), StatefulCommand(this, f) {} @@ -258,6 +259,7 @@ namespace Ha { jsonDoc["min"] = min; jsonDoc["max"] = max; jsonDoc["step"] = step; + if (unitMeasure) jsonDoc["unit_of_measurement"] = unitMeasure; } };