1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-19 16:25:50 +00:00

Compare commits

..

1 Commits

Author SHA1 Message Date
J. Nick Koston
66e471cf2a [mdns] Modernize to C++17 nested namespace syntax 2025-11-18 14:33:07 -06:00
10 changed files with 26 additions and 34 deletions

View File

@@ -4,7 +4,8 @@
#include "esphome/core/automation.h"
#include "esphome/core/component.h"
namespace esphome::lock {
namespace esphome {
namespace lock {
template<typename... Ts> class LockAction : public Action<Ts...> {
public:
@@ -71,4 +72,5 @@ class LockUnlockTrigger : public Trigger<> {
}
};
} // namespace esphome::lock
} // namespace lock
} // namespace esphome

View File

@@ -3,7 +3,8 @@
#include "esphome/core/controller_registry.h"
#include "esphome/core/log.h"
namespace esphome::lock {
namespace esphome {
namespace lock {
static const char *const TAG = "lock";
@@ -107,4 +108,5 @@ LockCall &LockCall::set_state(const std::string &state) {
}
const optional<LockState> &LockCall::get_state() const { return this->state_; }
} // namespace esphome::lock
} // namespace lock
} // namespace esphome

View File

@@ -7,7 +7,8 @@
#include "esphome/core/preferences.h"
#include <initializer_list>
namespace esphome::lock {
namespace esphome {
namespace lock {
class Lock;
@@ -176,4 +177,5 @@ class Lock : public EntityBase {
ESPPreferenceObject rtc_;
};
} // namespace esphome::lock
} // namespace lock
} // namespace esphome

View File

@@ -21,8 +21,7 @@
#include "esphome/components/dashboard_import/dashboard_import.h"
#endif
namespace esphome {
namespace mdns {
namespace esphome::mdns {
static const char *const TAG = "mdns";
@@ -189,6 +188,5 @@ void MDNSComponent::dump_config() {
#endif
}
} // namespace mdns
} // namespace esphome
} // namespace esphome::mdns
#endif

View File

@@ -6,8 +6,7 @@
#include "esphome/core/component.h"
#include "esphome/core/helpers.h"
namespace esphome {
namespace mdns {
namespace esphome::mdns {
// Helper struct that identifies strings that may be stored in flash storage (similar to LogString)
struct MDNSString;
@@ -79,6 +78,5 @@ class MDNSComponent : public Component {
void compile_records_(StaticVector<MDNSService, MDNS_SERVICE_COUNT> &services);
};
} // namespace mdns
} // namespace esphome
} // namespace esphome::mdns
#endif

View File

@@ -7,8 +7,7 @@
#include "esphome/core/log.h"
#include "mdns_component.h"
namespace esphome {
namespace mdns {
namespace esphome::mdns {
static const char *const TAG = "mdns";
@@ -56,7 +55,6 @@ void MDNSComponent::on_shutdown() {
delay(40); // Allow the mdns packets announcing service removal to be sent
}
} // namespace mdns
} // namespace esphome
} // namespace esphome::mdns
#endif // USE_ESP32

View File

@@ -9,8 +9,7 @@
#include "esphome/core/log.h"
#include "mdns_component.h"
namespace esphome {
namespace mdns {
namespace esphome::mdns {
void MDNSComponent::setup() {
#ifdef USE_MDNS_STORE_SERVICES
@@ -52,7 +51,6 @@ void MDNSComponent::on_shutdown() {
delay(10);
}
} // namespace mdns
} // namespace esphome
} // namespace esphome::mdns
#endif

View File

@@ -6,8 +6,7 @@
#include "esphome/core/log.h"
#include "mdns_component.h"
namespace esphome {
namespace mdns {
namespace esphome::mdns {
void MDNSComponent::setup() {
// Host platform doesn't have actual mDNS implementation
@@ -15,7 +14,6 @@ void MDNSComponent::setup() {
void MDNSComponent::on_shutdown() {}
} // namespace mdns
} // namespace esphome
} // namespace esphome::mdns
#endif

View File

@@ -9,8 +9,7 @@
#include <mDNS.h>
namespace esphome {
namespace mdns {
namespace esphome::mdns {
void MDNSComponent::setup() {
#ifdef USE_MDNS_STORE_SERVICES
@@ -46,7 +45,6 @@ void MDNSComponent::setup() {
void MDNSComponent::on_shutdown() {}
} // namespace mdns
} // namespace esphome
} // namespace esphome::mdns
#endif

View File

@@ -9,8 +9,7 @@
#include <ESP8266mDNS.h>
namespace esphome {
namespace mdns {
namespace esphome::mdns {
void MDNSComponent::setup() {
#ifdef USE_MDNS_STORE_SERVICES
@@ -51,7 +50,6 @@ void MDNSComponent::on_shutdown() {
delay(40);
}
} // namespace mdns
} // namespace esphome
} // namespace esphome::mdns
#endif