ESPHome 2026.6.3
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 =
16 state < 0.003 && zero_means_zero ? 0.0 : clamp(std::lerp(min_value_, max_value_, state), min_value_, max_value_);
17 this->has_state_ = true;
18 ESP_LOGD(TAG, "Output %s set to %.2f", this->id_, this->state);
19}
20} // namespace esphome::opentherm
void write_state(float state) override
bool state
Definition fan.h:2