[text] Use C++17 nested namespace syntax (#14242)

This commit is contained in:
J. Nick Koston
2026-02-23 19:49:25 -06:00
committed by GitHub
parent 843d06df3f
commit 63c1496115
6 changed files with 12 additions and 24 deletions

View File

@@ -4,8 +4,7 @@
#include "esphome/core/component.h"
#include "text.h"
namespace esphome {
namespace text {
namespace esphome::text {
class TextStateTrigger : public Trigger<std::string> {
public:
@@ -29,5 +28,4 @@ template<typename... Ts> class TextSetAction : public Action<Ts...> {
Text *text_;
};
} // namespace text
} // namespace esphome
} // namespace esphome::text

View File

@@ -4,8 +4,7 @@
#include "esphome/core/log.h"
#include <cstring>
namespace esphome {
namespace text {
namespace esphome::text {
static const char *const TAG = "text";
@@ -34,5 +33,4 @@ void Text::add_on_state_callback(std::function<void(const std::string &)> &&call
this->state_callback_.add(std::move(callback));
}
} // namespace text
} // namespace esphome
} // namespace esphome::text

View File

@@ -6,8 +6,7 @@
#include "text_call.h"
#include "text_traits.h"
namespace esphome {
namespace text {
namespace esphome::text {
#define LOG_TEXT(prefix, type, obj) \
if ((obj) != nullptr) { \
@@ -47,5 +46,4 @@ class Text : public EntityBase {
LazyCallbackManager<void(const std::string &)> state_callback_;
};
} // namespace text
} // namespace esphome
} // namespace esphome::text

View File

@@ -2,8 +2,7 @@
#include "esphome/core/log.h"
#include "text.h"
namespace esphome {
namespace text {
namespace esphome::text {
static const char *const TAG = "text";
@@ -52,5 +51,4 @@ void TextCall::perform() {
this->parent_->control(target_value);
}
} // namespace text
} // namespace esphome
} // namespace esphome::text

View File

@@ -3,8 +3,7 @@
#include "esphome/core/helpers.h"
#include "text_traits.h"
namespace esphome {
namespace text {
namespace esphome::text {
class Text;
@@ -21,5 +20,4 @@ class TextCall {
void validate_();
};
} // namespace text
} // namespace esphome
} // namespace esphome::text

View File

@@ -4,8 +4,7 @@
#include "esphome/core/string_ref.h"
namespace esphome {
namespace text {
namespace esphome::text {
enum TextMode : uint8_t {
TEXT_MODE_TEXT = 0,
@@ -37,5 +36,4 @@ class TextTraits {
TextMode mode_{TEXT_MODE_TEXT};
};
} // namespace text
} // namespace esphome
} // namespace esphome::text