fix: normalize setting changes and reject non-finite control values

Round settings to their stored precision before detecting changes and
applying relevant range checks. Accept the minimum sensor factor of 0.09.

Handle matching NaNs and infinities consistently in float comparisons.
Reject non-finite OpenTherm setpoints and PID results before they affect
heating control.
This commit is contained in:
Yurii committed 2026-11-29 05:43:52 +03:00
1 parent 09b5f6c9e0
commit a629589122
4 files changed
+76 -30

No files matched your search

+1 -1
View File
@@ -75,7 +75,7 @@ static Task pidTask("PID", Task::Type::FOREVER, [](void*) {
}
float result = pidRegulator.getResult();
if (isFloatDifferent(pidResult, result, 0.09f)) {
if (std::isfinite(result) && isFloatDifferent(pidResult, result, 0.09f)) {
pidResult = result;
ESP_LOGI(L_REGULATOR_PID, "New result: %.2f", result);
ESP_LOGD(L_REGULATOR_PID, "Integral: %.2f", pidRegulator.integral);