mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
added comments
This commit is contained in:
@@ -941,14 +941,15 @@ void EMSdevice::generate_values_web(JsonObject & output) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// handle INTs
|
// handle INTs
|
||||||
// add min and max values and steps, as integer values
|
|
||||||
else {
|
else {
|
||||||
|
// add step if it's not 1
|
||||||
if (dv.numeric_operator > 0) {
|
if (dv.numeric_operator > 0) {
|
||||||
obj["s"] = (float)1 / dv.numeric_operator;
|
obj["s"] = (float)1 / dv.numeric_operator;
|
||||||
} else if (dv.numeric_operator < 0) {
|
} else if (dv.numeric_operator < 0) {
|
||||||
obj["s"] = (float)(-1) * dv.numeric_operator;
|
obj["s"] = (float)(-1) * dv.numeric_operator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add min and max values, if available
|
||||||
int16_t dv_set_min;
|
int16_t dv_set_min;
|
||||||
uint32_t dv_set_max;
|
uint32_t dv_set_max;
|
||||||
if (dv.get_min_max(dv_set_min, dv_set_max)) {
|
if (dv.get_min_max(dv_set_min, dv_set_max)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user