mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
burner settings use min/max from telegram 4, fix max for values < 0
This commit is contained in:
@@ -327,7 +327,7 @@ bool DeviceValue::get_custom_min(int16_t & val) {
|
||||
bool has_min = (min_pos != std::string::npos);
|
||||
uint8_t fahrenheit = !EMSESP::system_.fahrenheit() ? 0 : (uom == DeviceValueUOM::DEGREES) ? 2 : (uom == DeviceValueUOM::DEGREES_R) ? 1 : 0;
|
||||
if (has_min) {
|
||||
uint32_t v = Helpers::atoint(custom_fullname.substr(min_pos + 1).c_str());
|
||||
int16_t v = Helpers::atoint(custom_fullname.substr(min_pos + 1).c_str());
|
||||
if (fahrenheit) {
|
||||
v = (v - (32 * (fahrenheit - 1))) / 1.8; // reset to °C
|
||||
}
|
||||
@@ -345,7 +345,7 @@ bool DeviceValue::get_custom_max(uint32_t & val) {
|
||||
bool has_max = (max_pos != std::string::npos);
|
||||
uint8_t fahrenheit = !EMSESP::system_.fahrenheit() ? 0 : (uom == DeviceValueUOM::DEGREES) ? 2 : (uom == DeviceValueUOM::DEGREES_R) ? 1 : 0;
|
||||
if (has_max) {
|
||||
int v = Helpers::atoint(custom_fullname.substr(max_pos + 1).c_str());
|
||||
int32_t v = Helpers::atoint(custom_fullname.substr(max_pos + 1).c_str());
|
||||
if (fahrenheit) {
|
||||
v = (v - (32 * (fahrenheit - 1))) / 1.8; // reset to °C
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user