[component] Devirtualize call_dump_config (#14355)

This commit is contained in:
J. Nick Koston
2026-02-27 13:01:23 -07:00
committed by GitHub
parent 63e757807e
commit 52af4bced0
5 changed files with 3 additions and 11 deletions

View File

@@ -405,12 +405,6 @@ void MQTTComponent::process_resend() {
this->schedule_resend_state();
}
}
void MQTTComponent::call_dump_config() {
if (this->is_internal())
return;
this->dump_config();
}
void MQTTComponent::schedule_resend_state() { this->resend_state_ = true; }
bool MQTTComponent::is_connected_() const { return global_mqtt_client->is_connected(); }

View File

@@ -98,8 +98,6 @@ class MQTTComponent : public Component {
/// Override setup_ so that we can call send_discovery() when needed.
void call_setup() override;
void call_dump_config() override;
/// Send discovery info the Home Assistant, override this.
virtual void send_discovery(JsonObject root, SendDiscoveryConfig &config) = 0;

View File

@@ -256,7 +256,7 @@ void Application::process_dump_config_() {
#endif
}
this->components_[this->dump_config_at_]->call_dump_config();
this->components_[this->dump_config_at_]->call_dump_config_();
this->dump_config_at_++;
}

View File

@@ -211,7 +211,7 @@ bool Component::cancel_retry(uint32_t id) {
void Component::call_loop_() { this->loop(); }
void Component::call_setup() { this->setup(); }
void Component::call_dump_config() {
void Component::call_dump_config_() {
this->dump_config();
if (this->is_failed()) {
// Look up error message from global vector

View File

@@ -291,7 +291,7 @@ class Component {
void call_loop_();
virtual void call_setup();
virtual void call_dump_config();
void call_dump_config_();
/// Helper to set component state (clears state bits and sets new state)
void set_component_state_(uint8_t state);