From 9d49ca58b5ade7971a2c1e85033d76a51db75d9d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 24 Nov 2025 12:16:52 -0600 Subject: [PATCH] silence warning for nullptr --- esphome/core/component.cpp | 6 ++++++ esphome/core/component.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/esphome/core/component.cpp b/esphome/core/component.cpp index aa487d8ef5..7d60a3d792 100644 --- a/esphome/core/component.cpp +++ b/esphome/core/component.cpp @@ -333,6 +333,12 @@ void Component::status_set_warning(const LogString *message) { ESP_LOGW(TAG, "%s set Warning flag: %s", LOG_STR_ARG(this->get_component_log_str()), message ? LOG_STR_ARG(message) : LOG_STR_LITERAL("unspecified")); } +void Component::status_set_error() { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + this->status_set_error(nullptr); +#pragma GCC diagnostic pop +} void Component::status_set_error(const char *message) { if ((this->component_state_ & STATUS_LED_ERROR) != 0) return; diff --git a/esphome/core/component.h b/esphome/core/component.h index 82ac66f23c..db716d5b4a 100644 --- a/esphome/core/component.h +++ b/esphome/core/component.h @@ -227,9 +227,10 @@ class Component { void status_set_warning(const char *message = nullptr); void status_set_warning(const LogString *message); + void status_set_error(); // Set error flag without message // Remove before 2026.6.0 ESPDEPRECATED("Use status_set_error(LOG_STR(message)) instead. Will stop working in 2026.6.0", "2025.12.0") - void status_set_error(const char *message = nullptr); + void status_set_error(const char *message); void status_set_error(const LogString *message); void status_clear_warning();