mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-30 01:38:27 +02:00
Introduce clamp as a template function (#1953)
This commit is contained in:
@@ -54,7 +54,7 @@ void FanStateCall::perform() const {
|
||||
}
|
||||
if (this->speed_.has_value()) {
|
||||
const int speed_count = this->state_->get_traits().supported_speed_count();
|
||||
this->state_->speed = static_cast<int>(clamp(*this->speed_, 1, speed_count));
|
||||
this->state_->speed = clamp(*this->speed_, 1, speed_count);
|
||||
}
|
||||
|
||||
FanStateRTCState saved{};
|
||||
|
||||
Reference in New Issue
Block a user