From 08b8ab837a2b6da234691cbd750625eea9fe38c0 Mon Sep 17 00:00:00 2001 From: Colm Date: Thu, 11 Jul 2024 05:10:58 +0100 Subject: [PATCH] Add braces to if statement to avoid compiler warning. (#7036) --- esphome/components/aht10/aht10.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/esphome/components/aht10/aht10.cpp b/esphome/components/aht10/aht10.cpp index 332218b9e9..441c1ac9df 100644 --- a/esphome/components/aht10/aht10.cpp +++ b/esphome/components/aht10/aht10.cpp @@ -93,8 +93,9 @@ void AHT10Component::restart_read_() { void AHT10Component::read_data_() { uint8_t data[6]; - if (this->read_count_ > 1) + if (this->read_count_ > 1) { ESP_LOGD(TAG, "Read attempt %d at %ums", this->read_count_, (unsigned) (millis() - this->start_time_)); + } if (this->read(data, 6) != i2c::ERROR_OK) { this->status_set_warning("AHT10 read failed, retrying soon"); this->restart_read_(); @@ -119,8 +120,9 @@ void AHT10Component::read_data_() { return; } } - if (this->read_count_ > 1) + if (this->read_count_ > 1) { ESP_LOGD(TAG, "Success at %ums", (unsigned) (millis() - this->start_time_)); + } uint32_t raw_temperature = ((data[3] & 0x0F) << 16) | (data[4] << 8) | data[5]; uint32_t raw_humidity = ((data[1] << 16) | (data[2] << 8) | data[3]) >> 4;