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 {