mirror of
https://github.com/esphome/esphome.git
synced 2026-02-25 12:55:30 -07:00
[text_sensor] Use C++17 nested namespace syntax (#14243)
This commit is contained in:
@@ -6,8 +6,7 @@
|
||||
#include "esphome/core/automation.h"
|
||||
#include "esphome/components/text_sensor/text_sensor.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace text_sensor {
|
||||
namespace esphome::text_sensor {
|
||||
|
||||
class TextSensorStateTrigger : public Trigger<std::string> {
|
||||
public:
|
||||
@@ -46,5 +45,4 @@ template<typename... Ts> class TextSensorPublishAction : public Action<Ts...> {
|
||||
TextSensor *sensor_;
|
||||
};
|
||||
|
||||
} // namespace text_sensor
|
||||
} // namespace esphome
|
||||
} // namespace esphome::text_sensor
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
#include "esphome/core/log.h"
|
||||
#include "esphome/core/hal.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace text_sensor {
|
||||
namespace esphome::text_sensor {
|
||||
|
||||
static const char *const TAG = "text_sensor.filter";
|
||||
|
||||
@@ -107,7 +106,6 @@ bool MapFilter::new_value(std::string &value) {
|
||||
return true; // Pass through if no match
|
||||
}
|
||||
|
||||
} // namespace text_sensor
|
||||
} // namespace esphome
|
||||
} // namespace esphome::text_sensor
|
||||
|
||||
#endif // USE_TEXT_SENSOR_FILTER
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
#include "esphome/core/component.h"
|
||||
#include "esphome/core/helpers.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace text_sensor {
|
||||
namespace esphome::text_sensor {
|
||||
|
||||
class TextSensor;
|
||||
|
||||
@@ -165,7 +164,6 @@ class MapFilter : public Filter {
|
||||
FixedVector<Substitution> mappings_;
|
||||
};
|
||||
|
||||
} // namespace text_sensor
|
||||
} // namespace esphome
|
||||
} // namespace esphome::text_sensor
|
||||
|
||||
#endif // USE_TEXT_SENSOR_FILTER
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
#include "esphome/core/log.h"
|
||||
#include <cstring>
|
||||
|
||||
namespace esphome {
|
||||
namespace text_sensor {
|
||||
namespace esphome::text_sensor {
|
||||
|
||||
static const char *const TAG = "text_sensor";
|
||||
|
||||
@@ -125,5 +124,4 @@ void TextSensor::notify_frontend_() {
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace text_sensor
|
||||
} // namespace esphome
|
||||
} // namespace esphome::text_sensor
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
#include <initializer_list>
|
||||
#include <memory>
|
||||
|
||||
namespace esphome {
|
||||
namespace text_sensor {
|
||||
namespace esphome::text_sensor {
|
||||
|
||||
class TextSensor;
|
||||
|
||||
@@ -84,5 +83,4 @@ class TextSensor : public EntityBase, public EntityBase_DeviceClass {
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace text_sensor
|
||||
} // namespace esphome
|
||||
} // namespace esphome::text_sensor
|
||||
|
||||
Reference in New Issue
Block a user