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