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

[component] Show error message for failed component (#8478)

This commit is contained in:
Clyde Stubbs
2025-04-07 19:26:34 +10:00
committed by GitHub
parent 23e5cdb30e
commit 9637ef35bd
2 changed files with 9 additions and 1 deletions

View File

@@ -79,7 +79,7 @@ void Component::call_setup() { this->setup(); }
void Component::call_dump_config() {
this->dump_config();
if (this->is_failed()) {
ESP_LOGE(TAG, " Component %s is marked FAILED", this->get_component_source());
ESP_LOGE(TAG, " Component %s is marked FAILED: %s", this->get_component_source(), this->error_message_.c_str());
}
}
@@ -162,6 +162,8 @@ void Component::status_set_error(const char *message) {
this->component_state_ |= STATUS_LED_ERROR;
App.app_state_ |= STATUS_LED_ERROR;
ESP_LOGE(TAG, "Component %s set Error flag: %s", this->get_component_source(), message);
if (strcmp(message, "unspecified") != 0)
this->error_message_ = message;
}
void Component::status_clear_warning() {
if ((this->component_state_ & STATUS_LED_WARNING) == 0)