mirror of
https://github.com/esphome/esphome.git
synced 2026-09-03 03:26:02 +00:00
[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>
This commit is contained in:
co-authored by
pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
parent
bbe806f1e6
commit
06d477bea7
@@ -84,8 +84,8 @@ void Whynter::transmit_state() {
|
||||
|
||||
if (fahrenheit_) {
|
||||
remote_state |= UNIT_MASK;
|
||||
uint8_t temp =
|
||||
(uint8_t) clamp<float>(esphome::celsius_to_fahrenheit(this->target_temperature), TEMP_MIN_F, TEMP_MAX_F);
|
||||
uint8_t temp = (uint8_t) roundf(
|
||||
clamp<float>(esphome::celsius_to_fahrenheit(this->target_temperature), TEMP_MIN_F, TEMP_MAX_F));
|
||||
temp = esphome::reverse_bits(temp);
|
||||
remote_state |= temp;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user