ESPHome
2025.9.0-dev
Loading...
Searching...
No Matches
esphome
components
opentherm
output
output.cpp
Go to the documentation of this file.
1
#include "
esphome/core/helpers.h
"
// for clamp() and lerp()
2
#include "
output.h
"
3
4
namespace
esphome
{
5
namespace
opentherm {
6
7
static
const
char
*
const
TAG =
"opentherm.output"
;
8
9
void
opentherm::OpenthermOutput::write_state
(
float
state
) {
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
esphome::opentherm::OpenthermOutput::write_state
void write_state(float state) override
Definition
output.cpp:9
state
bool state
Definition
fan.h:0
helpers.h
esphome
Providing packet encoding functions for exchanging data with a remote host.
Definition
a01nyub.cpp:7
output.h
Generated by
1.12.0