From 413202e02e150b5026bb18fff455b5e5052906cf Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 26 Mar 2026 14:31:06 -1000 Subject: [PATCH] Restore deleted std::string overloads for clear compile-time diagnostics --- esphome/components/climate/climate_traits.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/esphome/components/climate/climate_traits.h b/esphome/components/climate/climate_traits.h index 939bf96ed5..d364be0ac8 100644 --- a/esphome/components/climate/climate_traits.h +++ b/esphome/components/climate/climate_traits.h @@ -169,6 +169,10 @@ class ClimateTraits { this->compat_custom_fan_modes_ = modes; } + // Deleted overloads to catch incorrect std::string usage at compile time with clear error messages + void set_supported_custom_fan_modes(const std::vector &modes) = delete; + void set_supported_custom_fan_modes(std::initializer_list modes) = delete; + // Compat: returns const ref with empty fallback. In 2026.11.0 change to return const vector *. const std::vector &get_supported_custom_fan_modes() const; bool supports_custom_fan_mode(const char *custom_fan_mode) const { @@ -201,6 +205,10 @@ class ClimateTraits { this->compat_custom_presets_ = presets; } + // Deleted overloads to catch incorrect std::string usage at compile time with clear error messages + void set_supported_custom_presets(const std::vector &presets) = delete; + void set_supported_custom_presets(std::initializer_list presets) = delete; + // Compat: returns const ref with empty fallback. In 2026.11.0 change to return const vector *. const std::vector &get_supported_custom_presets() const; bool supports_custom_preset(const char *custom_preset) const {