From 1fa581be3dd9a65f4e0b2fe5fecdced64d7771e2 Mon Sep 17 00:00:00 2001 From: KazWolfe Date: Sat, 7 Oct 2023 18:37:34 -0700 Subject: [PATCH] fix: Better handle fractional setpoints --- components/aux_ac/aux_ac.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/aux_ac/aux_ac.h b/components/aux_ac/aux_ac.h index 0df9b8a..01ef829 100644 --- a/components/aux_ac/aux_ac.h +++ b/components/aux_ac/aux_ac.h @@ -1712,7 +1712,7 @@ class AirCon : public esphome::Component, public esphome::climate::Climate { pack->body[2] = (pack->body[2] & ~AC_TEMP_TARGET_INT_PART_MASK) | (((uint8_t)(cmd->temp_target) - 8) << 3); // дробная часть температуры - if (cmd->temp_target - (uint8_t)(cmd->temp_target) > 0) { + if (cmd->temp_target - (uint8_t)(cmd->temp_target) >= 0.5) { pack->body[4] = (pack->body[4] | AC_TEMP_TARGET_FRAC_PART_MASK); } else { pack->body[4] = (pack->body[4] & ~AC_TEMP_TARGET_FRAC_PART_MASK); @@ -3388,4 +3388,4 @@ class AirCon : public esphome::Component, public esphome::climate::Climate { }; } // namespace aux_ac -} // namespace esphome \ No newline at end of file +} // namespace esphome