From 32f4e4ca130188895cb1eafdd6b17c5f05937515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vikstr=C3=B6m?= Date: Wed, 9 Apr 2025 19:20:28 +0200 Subject: [PATCH] Cleaning up --- esphome/core/application.h | 2 ++ esphome/core/entity_base.cpp | 2 +- esphome/cpp_helpers.py | 4 ---- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/esphome/core/application.h b/esphome/core/application.h index 4336ea43d5..2691f760a3 100644 --- a/esphome/core/application.h +++ b/esphome/core/application.h @@ -252,6 +252,8 @@ class Application { #ifdef USE_SUB_DEVICE const std::vector &get_sub_devices() { return this->sub_devices_; } + // /* Very likely no need for get_sub_device_by_key as it only seem to be used when requesting update from API + // and the sub_devices shaould only be sent once at connection. */ // devices::SubDevice *get_sub_device_by_key(uint32_t key, bool include_internal = false) { // for (auto *obj : this->sub_devices_) { // if (obj->get_object_id_hash() == key && (include_internal || !obj->is_internal())) diff --git a/esphome/core/entity_base.cpp b/esphome/core/entity_base.cpp index 8073879982..e5231ed759 100644 --- a/esphome/core/entity_base.cpp +++ b/esphome/core/entity_base.cpp @@ -35,7 +35,7 @@ std::string EntityBase::get_icon() const { } void EntityBase::set_icon(const char *icon) { this->icon_c_str_ = icon; } -// Entity Device Name +// Entity Device id const StringRef &EntityBase::get_device_id() const { if (this->device_id_.empty()) { return StringRef(""); diff --git a/esphome/cpp_helpers.py b/esphome/cpp_helpers.py index bfc9b3dc9b..3c91eafcf4 100644 --- a/esphome/cpp_helpers.py +++ b/esphome/cpp_helpers.py @@ -89,10 +89,6 @@ async def register_component(var, config): return var -# async def register_sub_device(var, value): -# pass - - async def register_parented(var, value): if isinstance(value, ID): paren = await get_variable(value)