From 8b50ed48c1df9aa309b05b2e841a7e760b96c70c Mon Sep 17 00:00:00 2001 From: Yurii Date: Wed, 21 May 2025 01:17:43 +0300 Subject: [PATCH] fix: revert default value of slave max modulation; always set max modulation level Baxi Ampera resets the maximum modulation level to 0 when the heating is turned off --- src/OpenThermTask.h | 22 ++++++++++------------ src/Settings.h | 2 +- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/OpenThermTask.h b/src/OpenThermTask.h index 1fb30ff..f37bc80 100644 --- a/src/OpenThermTask.h +++ b/src/OpenThermTask.h @@ -687,19 +687,17 @@ protected: targetMaxModulation = settings.dhw.maxModulation; } - if (vars.slave.modulation.max != targetMaxModulation) { - if (this->setMaxModulationLevel(targetMaxModulation)) { - Log.snoticeln( - FPSTR(L_OT), F("Set max modulation: %hhu%% (response: %hhu%%)"), - targetMaxModulation, vars.slave.modulation.max - ); + if (this->setMaxModulationLevel(targetMaxModulation)) { + Log.snoticeln( + FPSTR(L_OT), F("Set max modulation: %hhu%% (response: %hhu%%)"), + targetMaxModulation, vars.slave.modulation.max + ); - } else { - Log.swarningln( - FPSTR(L_OT), F("Failed set max modulation: %hhu%% (response: %hhu%%)"), - targetMaxModulation, vars.slave.modulation.max - ); - } + } else { + Log.swarningln( + FPSTR(L_OT), F("Failed set max modulation: %hhu%% (response: %hhu%%)"), + targetMaxModulation, vars.slave.modulation.max + ); } // Update modulation level diff --git a/src/Settings.h b/src/Settings.h index d870af5..f939fbf 100644 --- a/src/Settings.h +++ b/src/Settings.h @@ -328,7 +328,7 @@ struct Variables { struct { uint8_t current = 0; uint8_t min = 0; - uint8_t max = 0; + uint8_t max = 100; } modulation; struct {