mirror of
https://github.com/esphome/esphome.git
synced 2026-01-10 12:10:48 -07:00
[openthread] channel range, fix typo, use C++17 nested namespace syntax (#12422)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user