mirror of
https://github.com/esphome/esphome.git
synced 2026-02-08 00:31:58 +00:00
[sensor] Use C++17 nested namespace syntax (#13116)
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
#include "automation.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace sensor {
|
||||
namespace esphome::sensor {
|
||||
|
||||
static const char *const TAG = "sensor.automation";
|
||||
|
||||
} // namespace sensor
|
||||
} // namespace esphome
|
||||
} // namespace esphome::sensor
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
#include "esphome/core/automation.h"
|
||||
#include "esphome/components/sensor/sensor.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace sensor {
|
||||
namespace esphome::sensor {
|
||||
|
||||
class SensorStateTrigger : public Trigger<float> {
|
||||
public:
|
||||
@@ -107,5 +106,4 @@ template<typename... Ts> class SensorInRangeCondition : public Condition<Ts...>
|
||||
float max_{NAN};
|
||||
};
|
||||
|
||||
} // namespace sensor
|
||||
} // namespace esphome
|
||||
} // namespace esphome::sensor
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
#include "esphome/core/log.h"
|
||||
#include "sensor.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace sensor {
|
||||
namespace esphome::sensor {
|
||||
|
||||
static const char *const TAG = "sensor.filter";
|
||||
|
||||
@@ -574,5 +573,4 @@ void StreamingMovingAverageFilter::reset_batch() {
|
||||
this->valid_count_ = 0;
|
||||
}
|
||||
|
||||
} // namespace sensor
|
||||
} // namespace esphome
|
||||
} // namespace esphome::sensor
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
#include "esphome/core/component.h"
|
||||
#include "esphome/core/helpers.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace sensor {
|
||||
namespace esphome::sensor {
|
||||
|
||||
class Sensor;
|
||||
|
||||
@@ -632,5 +631,4 @@ class StreamingMovingAverageFilter : public StreamingFilter {
|
||||
size_t valid_count_{0};
|
||||
};
|
||||
|
||||
} // namespace sensor
|
||||
} // namespace esphome
|
||||
} // namespace esphome::sensor
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
#include "esphome/core/controller_registry.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace sensor {
|
||||
namespace esphome::sensor {
|
||||
|
||||
static const char *const TAG = "sensor";
|
||||
|
||||
@@ -135,5 +134,4 @@ void Sensor::internal_send_state_to_frontend(float state) {
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace sensor
|
||||
} // namespace esphome
|
||||
} // namespace esphome::sensor
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
#include <initializer_list>
|
||||
#include <memory>
|
||||
|
||||
namespace esphome {
|
||||
namespace sensor {
|
||||
namespace esphome::sensor {
|
||||
|
||||
void log_sensor(const char *tag, const char *prefix, const char *type, Sensor *obj);
|
||||
|
||||
@@ -143,5 +142,4 @@ class Sensor : public EntityBase, public EntityBase_DeviceClass, public EntityBa
|
||||
} sensor_flags_{};
|
||||
};
|
||||
|
||||
} // namespace sensor
|
||||
} // namespace esphome
|
||||
} // namespace esphome::sensor
|
||||
|
||||
Reference in New Issue
Block a user