1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-15 01:32:19 +01:00

Reduce Component memory usage by 20 bytes per component

This commit is contained in:
J. Nick Koston
2025-06-14 16:27:45 -05:00
parent ee37d2f9c8
commit 13824624f8
2 changed files with 3 additions and 2 deletions

View File

@@ -82,7 +82,8 @@ void Component::call_setup() { this->setup(); }
void Component::call_dump_config() { void Component::call_dump_config() {
this->dump_config(); this->dump_config();
if (this->is_failed()) { if (this->is_failed()) {
ESP_LOGE(TAG, " Component %s is marked FAILED: %s", this->get_component_source(), this->error_message_.c_str()); ESP_LOGE(TAG, " Component %s is marked FAILED: %s", this->get_component_source(),
this->error_message_ ? this->error_message_ : "unspecified");
} }
} }

View File

@@ -302,7 +302,7 @@ class Component {
float setup_priority_override_{NAN}; float setup_priority_override_{NAN};
const char *component_source_{nullptr}; const char *component_source_{nullptr};
uint32_t warn_if_blocking_over_{WARN_IF_BLOCKING_OVER_MS}; uint32_t warn_if_blocking_over_{WARN_IF_BLOCKING_OVER_MS};
std::string error_message_{}; const char *error_message_{nullptr};
}; };
/** This class simplifies creating components that periodically check a state. /** This class simplifies creating components that periodically check a state.