This commit is contained in:
Anton Sergunov 2024-11-13 14:10:22 +00:00
parent 204e72da35
commit 7db12c0a63
2 changed files with 3 additions and 3 deletions

View file

@ -89,7 +89,7 @@ void PIDClimate::dump_config() {
this->autotuner_->dump_config(); this->autotuner_->dump_config();
} }
} }
float PIDClimate::value_by_mode_(float value) { float PIDClimate::clamp_value_by_mode_(float value) {
switch (this->mode) { switch (this->mode) {
case climate::CLIMATE_MODE_OFF: case climate::CLIMATE_MODE_OFF:
return 0.0f; return 0.0f;
@ -102,7 +102,7 @@ float PIDClimate::value_by_mode_(float value) {
} }
} }
void PIDClimate::write_output_() { void PIDClimate::write_output_() {
const float value = this->value_by_mode_(this->output_value_); const float value = this->clamp_value_by_mode_(this->output_value_);
// first ensure outputs are off (both outputs not active at the same time) // first ensure outputs are off (both outputs not active at the same time)
if (this->supports_cool_() && value >= 0) if (this->supports_cool_() && value >= 0)

View file

@ -85,7 +85,7 @@ class PIDClimate : public climate::Climate, public Component {
bool supports_heat_() const { return this->heat_output_ != nullptr; } bool supports_heat_() const { return this->heat_output_ != nullptr; }
/// Return cloest possible output value with respect to mode /// Return cloest possible output value with respect to mode
float value_by_mode_(float value) const; float clamp_value_by_mode_(float value) const;
void write_output_(); void write_output_();