[code-quality] fix clang-tidy mqtt (#7253)

This commit is contained in:
tomaszduda23 2024-08-13 21:56:09 +02:00 committed by GitHub
parent 4bd7ba0d30
commit f81ce2c707
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 16 additions and 5 deletions

View File

@ -1,5 +1,6 @@
#pragma once #pragma once
#include "esphome/core/defines.h"
#ifdef USE_MQTT
#include <string> #include <string>
#include <map> #include <map>
#include "esphome/components/network/ip_address.h" #include "esphome/components/network/ip_address.h"
@ -67,3 +68,4 @@ class MQTTBackend {
} // namespace mqtt } // namespace mqtt
} // namespace esphome } // namespace esphome
#endif

View File

@ -1,7 +1,9 @@
#include "mqtt_backend_esp32.h"
#ifdef USE_MQTT
#ifdef USE_ESP32 #ifdef USE_ESP32
#include <string> #include <string>
#include "mqtt_backend_esp32.h"
#include "esphome/core/log.h" #include "esphome/core/log.h"
#include "esphome/core/helpers.h" #include "esphome/core/helpers.h"
@ -189,3 +191,4 @@ void MQTTBackendESP32::mqtt_event_handler(void *handler_args, esp_event_base_t b
} // namespace mqtt } // namespace mqtt
} // namespace esphome } // namespace esphome
#endif // USE_ESP32 #endif // USE_ESP32
#endif

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
#include "mqtt_backend.h"
#ifdef USE_MQTT
#ifdef USE_ESP32 #ifdef USE_ESP32
#include <string> #include <string>
@ -7,7 +9,6 @@
#include <mqtt_client.h> #include <mqtt_client.h>
#include "esphome/components/network/ip_address.h" #include "esphome/components/network/ip_address.h"
#include "esphome/core/helpers.h" #include "esphome/core/helpers.h"
#include "mqtt_backend.h"
namespace esphome { namespace esphome {
namespace mqtt { namespace mqtt {
@ -174,3 +175,4 @@ class MQTTBackendESP32 final : public MQTTBackend {
} // namespace esphome } // namespace esphome
#endif #endif
#endif

View File

@ -1,8 +1,9 @@
#pragma once #pragma once
#include "mqtt_backend.h"
#ifdef USE_MQTT
#ifdef USE_ESP8266 #ifdef USE_ESP8266
#include "mqtt_backend.h"
#include <AsyncMqttClient.h> #include <AsyncMqttClient.h>
namespace esphome { namespace esphome {
@ -70,3 +71,4 @@ class MQTTBackendESP8266 final : public MQTTBackend {
} // namespace esphome } // namespace esphome
#endif // defined(USE_ESP8266) #endif // defined(USE_ESP8266)
#endif

View File

@ -1,8 +1,9 @@
#pragma once #pragma once
#include "mqtt_backend.h"
#ifdef USE_MQTT
#ifdef USE_LIBRETINY #ifdef USE_LIBRETINY
#include "mqtt_backend.h"
#include <AsyncMqttClient.h> #include <AsyncMqttClient.h>
namespace esphome { namespace esphome {
@ -70,3 +71,4 @@ class MQTTBackendLibreTiny final : public MQTTBackend {
} // namespace esphome } // namespace esphome
#endif // defined(USE_LIBRETINY) #endif // defined(USE_LIBRETINY)
#endif