ESPHome
2026.6.0-dev
Loading...
Searching...
No Matches
esphome
components
opentherm
output
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
4
namespace
esphome::opentherm
{
5
6
static
const
char
*
const
TAG =
"opentherm.output"
;
7
8
void
opentherm::OpenthermOutput::write_state
(
float
state
) {
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
esphome::opentherm::OpenthermOutput::write_state
void write_state(float state) override
Definition
opentherm_output.cpp:8
state
bool state
Definition
fan.h:2
helpers.h
esphome::opentherm
Definition
automation.h:7
opentherm_output.h
Generated by
1.12.0