1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-19 08:15:49 +00:00

Compare commits

..

1 Commits

Author SHA1 Message Date
J. Nick Koston
99acc62c3b [lock] Modernize to C++17 nested namespaces 2025-11-18 14:51:37 -06:00
10 changed files with 34 additions and 26 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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