diff --git a/esphome/components/madoka/madoka.cpp b/esphome/components/madoka/madoka.cpp index 77079cee9..3c1dbfd40 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 33fee5d91..b89263b0e 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;