From 1f450214c5d3b314f7b61848eda1153ed938fb58 Mon Sep 17 00:00:00 2001 From: Petapton Date: Thu, 4 Jan 2024 14:41:53 +0000 Subject: [PATCH] Apply clang-tidy style (for ESP32 Arduino 2/4) to Madoka component --- esphome/components/madoka/madoka.cpp | 5 ++--- esphome/components/madoka/madoka.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/esphome/components/madoka/madoka.cpp b/esphome/components/madoka/madoka.cpp index 77079cee97..3c1dbfd403 100644 --- a/esphome/components/madoka/madoka.cpp +++ b/esphome/components/madoka/madoka.cpp @@ -364,9 +364,8 @@ void Madoka::parse_cb_(message msg) { uint8_t argument_id = msg[i++]; uint8_t len = msg[i++]; if (this->cur_status_.mode == 1) { - } else if (argument_id == 0x21 && len == 1 && this->cur_status_.mode == 4) { - fan_mode = msg[i]; - } else if (argument_id == 0x20 && len == 1) { + } else if ((argument_id == 0x21 && len == 1 && this->cur_status_.mode == 4) || + (argument_id == 0x20 && len == 1 && this->cur_status_.mode != 4)) { fan_mode = msg[i]; } i += len; diff --git a/esphome/components/madoka/madoka.h b/esphome/components/madoka/madoka.h index 33fee5d91f..b89263b0e0 100644 --- a/esphome/components/madoka/madoka.h +++ b/esphome/components/madoka/madoka.h @@ -22,7 +22,7 @@ static const uint8_t BLE_SEND_MAX_RETRIES = 5; namespace esphome { namespace madoka { -static const char *TAG = "madoka"; +static const char *const TAG = "madoka"; using chunk = std::vector; using message = std::vector;