[openthread] channel range, fix typo, use C++17 nested namespace syntax (#12422)

This commit is contained in:
Thomas Rupprecht
2025-12-17 01:43:18 +01:00
committed by GitHub
parent 93621d85b0
commit 9727c7135c
6 changed files with 12 additions and 23 deletions

View File

@@ -91,7 +91,7 @@ def set_sdkconfig_options(config):
add_idf_sdkconfig_option("CONFIG_OPENTHREAD_SRP_CLIENT", True)
add_idf_sdkconfig_option("CONFIG_OPENTHREAD_SRP_CLIENT_MAX_SERVICES", 5)
# TODO: Add suport for synchronized sleepy end devices (SSED)
# TODO: Add support for synchronized sleepy end devices (SSED)
add_idf_sdkconfig_option(f"CONFIG_OPENTHREAD_{config.get(CONF_DEVICE_TYPE)}", True)
@@ -102,7 +102,7 @@ OpenThreadSrpComponent = openthread_ns.class_("OpenThreadSrpComponent", cg.Compo
_CONNECTION_SCHEMA = cv.Schema(
{
cv.Optional(CONF_PAN_ID): cv.hex_int,
cv.Optional(CONF_CHANNEL): cv.int_,
cv.Optional(CONF_CHANNEL): cv.int_range(min=11, max=26),
cv.Optional(CONF_NETWORK_KEY): cv.hex_int,
cv.Optional(CONF_EXT_PAN_ID): cv.hex_int,
cv.Optional(CONF_NETWORK_NAME): cv.string_strict,

View File

@@ -21,8 +21,7 @@
static const char *const TAG = "openthread";
namespace esphome {
namespace openthread {
namespace esphome::openthread {
OpenThreadComponent *global_openthread_component = // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
@@ -275,7 +274,5 @@ const char *OpenThreadComponent::get_use_address() const { return this->use_addr
void OpenThreadComponent::set_use_address(const char *use_address) { this->use_address_ = use_address; }
} // namespace openthread
} // namespace esphome
} // namespace esphome::openthread
#endif

View File

@@ -13,8 +13,7 @@
#include <optional>
#include <vector>
namespace esphome {
namespace openthread {
namespace esphome::openthread {
class InstanceLock;
@@ -91,6 +90,5 @@ class InstanceLock {
InstanceLock() {}
};
} // namespace openthread
} // namespace esphome
} // namespace esphome::openthread
#endif

View File

@@ -24,8 +24,7 @@
static const char *const TAG = "openthread";
namespace esphome {
namespace openthread {
namespace esphome::openthread {
void OpenThreadComponent::setup() {
// Used eventfds:
@@ -209,6 +208,5 @@ otInstance *InstanceLock::get_instance() { return esp_openthread_get_instance();
InstanceLock::~InstanceLock() { esp_openthread_lock_release(); }
} // namespace openthread
} // namespace esphome
} // namespace esphome::openthread
#endif

View File

@@ -3,8 +3,7 @@
#ifdef USE_OPENTHREAD
#include "esphome/core/log.h"
namespace esphome {
namespace openthread_info {
namespace esphome::openthread_info {
static const char *const TAG = "openthread_info";
@@ -19,6 +18,5 @@ void NetworkKeyOpenThreadInfo::dump_config() { LOG_TEXT_SENSOR("", "Network Key"
void PanIdOpenThreadInfo::dump_config() { LOG_TEXT_SENSOR("", "PAN ID", this); }
void ExtPanIdOpenThreadInfo::dump_config() { LOG_TEXT_SENSOR("", "Extended PAN ID", this); }
} // namespace openthread_info
} // namespace esphome
} // namespace esphome::openthread_info
#endif

View File

@@ -5,8 +5,7 @@
#include "esphome/core/component.h"
#ifdef USE_OPENTHREAD
namespace esphome {
namespace openthread_info {
namespace esphome::openthread_info {
using esphome::openthread::InstanceLock;
@@ -213,6 +212,5 @@ class ExtPanIdOpenThreadInfo : public DatasetOpenThreadInfo, public text_sensor:
std::array<uint8_t, 8> last_extpanid_{};
};
} // namespace openthread_info
} // namespace esphome
} // namespace esphome::openthread_info
#endif