mirror of
https://github.com/esphome/esphome.git
synced 2025-11-20 00:35:44 +00:00
Introduce clamp as a template function (#1953)
This commit is contained in:
@@ -84,7 +84,7 @@ void CoolixClimate::transmit_state() {
|
||||
}
|
||||
if (this->mode != climate::CLIMATE_MODE_OFF) {
|
||||
if (this->mode != climate::CLIMATE_MODE_FAN_ONLY) {
|
||||
auto temp = (uint8_t) roundf(clamp(this->target_temperature, COOLIX_TEMP_MIN, COOLIX_TEMP_MAX));
|
||||
auto temp = (uint8_t) roundf(clamp<float>(this->target_temperature, COOLIX_TEMP_MIN, COOLIX_TEMP_MAX));
|
||||
remote_state |= COOLIX_TEMP_MAP[temp - COOLIX_TEMP_MIN];
|
||||
} else {
|
||||
remote_state |= COOLIX_FAN_TEMP_CODE;
|
||||
|
||||
Reference in New Issue
Block a user