ESPHome 2026.8.0-dev
Loading...
Searching...
No Matches
opentherm_output.cpp
Go to the documentation of this file.
1#include "esphome/core/helpers.h" // for clamp() and lerp()
2#include "opentherm_output.h"
3
4namespace esphome::opentherm {
5
6static const char *const TAG = "opentherm.output";
7
9 ESP_LOGD(TAG, "Received state: %.2f. Min value: %.2f, max value: %.2f", state, min_value_, max_value_);
10#ifdef USE_OUTPUT_FLOAT_POWER_SCALING
11 bool zero_means_zero = this->zero_means_zero_;
12#else
13 bool zero_means_zero = false;
14#endif
15 this->state = state < 0.003f && zero_means_zero
16 ? 0.0f
17 : clamp(std::lerp(min_value_, max_value_, state), min_value_, max_value_);
18 this->has_state_ = true;
19 ESP_LOGD(TAG, "Output %s set to %.2f", this->id_, this->state);
20}
21} // namespace esphome::opentherm
void write_state(float state) override
bool state
Definition fan.h:2