ESPHome 2025.9.0-dev
Loading...
Searching...
No Matches
output.cpp
Go to the documentation of this file.
1#include "esphome/core/helpers.h" // for clamp() and lerp()
2#include "output.h"
3
4namespace esphome {
5namespace opentherm {
6
7static const char *const TAG = "opentherm.output";
8
10 ESP_LOGD(TAG, "Received state: %.2f. Min value: %.2f, max value: %.2f", state, min_value_, max_value_);
11 this->state = state < 0.003 && this->zero_means_zero_
12 ? 0.0
13 : clamp(std::lerp(min_value_, max_value_, state), min_value_, max_value_);
14 this->has_state_ = true;
15 ESP_LOGD(TAG, "Output %s set to %.2f", this->id_, this->state);
16}
17} // namespace opentherm
18} // namespace esphome
void write_state(float state) override
Definition output.cpp:9
bool state
Definition fan.h:0
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7