From ff5004d7db6514536dfd0e28ec3d114bb14b120c Mon Sep 17 00:00:00 2001 From: Keith Burzinski Date: Wed, 27 Nov 2024 16:25:15 -0600 Subject: [PATCH] [dht] clang-tidy fixes for #7822 (#7871) --- esphome/components/dht/dht.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esphome/components/dht/dht.cpp b/esphome/components/dht/dht.cpp index db1c851d5f..3f9f9c57f4 100644 --- a/esphome/components/dht/dht.cpp +++ b/esphome/components/dht/dht.cpp @@ -135,7 +135,8 @@ bool HOT IRAM_ATTR DHT::read_sensor_(float *temperature, float *humidity, bool r // Wait for falling edge while (this->pin_->digital_read()) { - if ((end_time = micros()) - start_time > 90) { + end_time = micros(); + if (end_time - start_time > 90) { if (i < 0) { error_code = 3; } else {