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_
13 :
clamp(
lerp(
state, min_value_, max_value_), min_value_, max_value_);
14 this->has_state_ =
true;
15 ESP_LOGD(TAG,
"Output %s set to %.2f", this->id_, this->state);
float lerp(float completion, float start, float end)
Linearly interpolate between start and end by completion (between 0 and 1).