[code-quality] fix clang-tidy api

This commit is contained in:
Tomasz Duda 2024-08-14 18:09:33 +02:00
parent 7133e08755
commit b568af1698
12 changed files with 31 additions and 13 deletions

View file

@ -1,4 +1,5 @@
#include "api_connection.h"
#ifdef USE_API
#include <cerrno>
#include <cinttypes>
#include <utility>
@ -1511,3 +1512,4 @@ void APIConnection::on_fatal_error() {
} // namespace api
} // namespace esphome
#endif

View file

@ -1,12 +1,13 @@
#pragma once
#include "esphome/core/defines.h"
#ifdef USE_API
#include "api_frame_helper.h"
#include "api_pb2.h"
#include "api_pb2_service.h"
#include "api_server.h"
#include "esphome/core/application.h"
#include "esphome/core/component.h"
#include "esphome/core/defines.h"
#include <vector>
@ -264,3 +265,4 @@ class APIConnection : public APIServerConnection {
} // namespace api
} // namespace esphome
#endif

View file

@ -1,5 +1,5 @@
#include "api_frame_helper.h"
#ifdef USE_API
#include "esphome/core/log.h"
#include "esphome/core/hal.h"
#include "esphome/core/helpers.h"
@ -1028,3 +1028,4 @@ APIError APIPlaintextFrameHelper::shutdown(int how) {
} // namespace api
} // namespace esphome
#endif

View file

@ -5,7 +5,7 @@
#include <vector>
#include "esphome/core/defines.h"
#ifdef USE_API
#ifdef USE_API_NOISE
#include "noise/protocol.h"
#endif
@ -190,3 +190,4 @@ class APIPlaintextFrameHelper : public APIFrameHelper {
} // namespace api
} // namespace esphome
#endif

View file

@ -1,4 +1,5 @@
#include "api_server.h"
#ifdef USE_API
#include <cerrno>
#include "api_connection.h"
#include "esphome/components/network/util.h"
@ -403,3 +404,4 @@ void APIServer::on_alarm_control_panel_update(alarm_control_panel::AlarmControlP
} // namespace api
} // namespace esphome
#endif

View file

@ -1,5 +1,7 @@
#pragma once
#include "esphome/core/defines.h"
#ifdef USE_API
#include "api_noise_context.h"
#include "api_pb2.h"
#include "api_pb2_service.h"
@ -7,7 +9,6 @@
#include "esphome/core/automation.h"
#include "esphome/core/component.h"
#include "esphome/core/controller.h"
#include "esphome/core/defines.h"
#include "esphome/core/log.h"
#include "list_entities.h"
#include "subscribe_state.h"
@ -153,3 +154,4 @@ template<typename... Ts> class APIConnectedCondition : public Condition<Ts...> {
} // namespace api
} // namespace esphome
#endif

View file

@ -1,9 +1,9 @@
#pragma once
#include <map>
#include "user_services.h"
#include "api_server.h"
#ifdef USE_API
#include "user_services.h"
namespace esphome {
namespace api {
@ -216,3 +216,4 @@ class CustomAPIDevice {
} // namespace api
} // namespace esphome
#endif

View file

@ -1,10 +1,10 @@
#pragma once
#include "api_server.h"
#ifdef USE_API
#include "api_pb2.h"
#include "esphome/core/helpers.h"
#include "esphome/core/automation.h"
#include "api_pb2.h"
#include "api_server.h"
#include <vector>
namespace esphome {
@ -81,3 +81,4 @@ template<typename... Ts> class HomeAssistantServiceCallAction : public Action<Ts
} // namespace api
} // namespace esphome
#endif

View file

@ -1,4 +1,5 @@
#include "list_entities.h"
#ifdef USE_API
#include "api_connection.h"
#include "esphome/core/application.h"
#include "esphome/core/log.h"
@ -104,3 +105,4 @@ bool ListEntitiesIterator::on_update(update::UpdateEntity *update) { return this
} // namespace api
} // namespace esphome
#endif

View file

@ -1,9 +1,9 @@
#pragma once
#include "esphome/core/defines.h"
#ifdef USE_API
#include "esphome/core/component.h"
#include "esphome/core/component_iterator.h"
#include "esphome/core/defines.h"
namespace esphome {
namespace api {
@ -87,3 +87,4 @@ class ListEntitiesIterator : public ComponentIterator {
} // namespace api
} // namespace esphome
#endif

View file

@ -1,4 +1,5 @@
#include "subscribe_state.h"
#ifdef USE_API
#include "api_connection.h"
#include "esphome/core/log.h"
@ -84,3 +85,4 @@ InitialStateIterator::InitialStateIterator(APIConnection *client) : client_(clie
} // namespace api
} // namespace esphome
#endif

View file

@ -1,10 +1,10 @@
#pragma once
#include "esphome/core/defines.h"
#ifdef USE_API
#include "esphome/core/component.h"
#include "esphome/core/component_iterator.h"
#include "esphome/core/controller.h"
#include "esphome/core/defines.h"
namespace esphome {
namespace api {
@ -82,3 +82,4 @@ class InitialStateIterator : public ComponentIterator {
} // namespace api
} // namespace esphome
#endif