From 06d477bea73cd415cf7e118cce07285e1b5a6057 Mon Sep 17 00:00:00 2001 From: mfishma Date: Mon, 31 Aug 2026 10:47:55 -0700 Subject: [PATCH] [whynter] Fix truncating Fahrenheit temps that should be rounded (#18813) Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- esphome/components/whynter/whynter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/whynter/whynter.cpp b/esphome/components/whynter/whynter.cpp index b8a8db4d7c..f5f304aa17 100644 --- a/esphome/components/whynter/whynter.cpp +++ b/esphome/components/whynter/whynter.cpp @@ -84,8 +84,8 @@ void Whynter::transmit_state() { if (fahrenheit_) { remote_state |= UNIT_MASK; - uint8_t temp = - (uint8_t) clamp(esphome::celsius_to_fahrenheit(this->target_temperature), TEMP_MIN_F, TEMP_MAX_F); + uint8_t temp = (uint8_t) roundf( + clamp(esphome::celsius_to_fahrenheit(this->target_temperature), TEMP_MIN_F, TEMP_MAX_F)); temp = esphome::reverse_bits(temp); remote_state |= temp; } else {