diff --git a/src/emsdevicevalue.cpp b/src/emsdevicevalue.cpp index 7454a0c8b..3c8fea3c9 100644 --- a/src/emsdevicevalue.cpp +++ b/src/emsdevicevalue.cpp @@ -331,7 +331,7 @@ bool DeviceValue::get_custom_min(int16_t & val) { if (fahrenheit) { v = (v - (32 * (fahrenheit - 1))) / 1.8; // reset to °C } - if (max > 0 && v > max) { + if (max > 0 && v > (int16_t)max) { return false; } val = v;