mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-28 08:48:27 +02:00
Introduce clamp as a template function (#1953)
This commit is contained in:
@@ -110,7 +110,7 @@ void FujitsuGeneralClimate::transmit_state() {
|
||||
|
||||
// Set temperature
|
||||
uint8_t temperature_clamped =
|
||||
(uint8_t) roundf(clamp(this->target_temperature, FUJITSU_GENERAL_TEMP_MIN, FUJITSU_GENERAL_TEMP_MAX));
|
||||
(uint8_t) roundf(clamp<float>(this->target_temperature, FUJITSU_GENERAL_TEMP_MIN, FUJITSU_GENERAL_TEMP_MAX));
|
||||
uint8_t temperature_offset = temperature_clamped - FUJITSU_GENERAL_TEMP_MIN;
|
||||
SET_NIBBLE(remote_state, FUJITSU_GENERAL_TEMPERATURE_NIBBLE, temperature_offset);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user