mirror of
https://github.com/esphome/esphome.git
synced 2026-02-25 04:45:29 -07:00
[text] Use C++17 nested namespace syntax (#14242)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user