From 7591f1d4732bfc6881e4ee4d83a7bee270156dfd Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 26 Mar 2026 15:41:47 -1000 Subject: [PATCH] Add deprecated array overloads for compat, fix Copilot review --- esphome/components/climate/climate_traits.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/esphome/components/climate/climate_traits.h b/esphome/components/climate/climate_traits.h index 58d82ecfb3..c0bc78f8db 100644 --- a/esphome/components/climate/climate_traits.h +++ b/esphome/components/climate/climate_traits.h @@ -164,6 +164,12 @@ class ClimateTraits { void set_supported_custom_fan_modes(const std::vector &modes) { this->compat_custom_fan_modes_ = modes; } + // Remove before 2026.11.0 + template + ESPDEPRECATED("Call set_supported_custom_fan_modes() on the Climate entity instead. Removed in 2026.11.0", "2026.5.0") + void set_supported_custom_fan_modes(const char *const (&modes)[N]) { + this->compat_custom_fan_modes_.assign(modes, modes + N); + } // 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; @@ -196,6 +202,12 @@ class ClimateTraits { void set_supported_custom_presets(const std::vector &presets) { this->compat_custom_presets_ = presets; } + // Remove before 2026.11.0 + template + ESPDEPRECATED("Call set_supported_custom_presets() on the Climate entity instead. Removed in 2026.11.0", "2026.5.0") + void set_supported_custom_presets(const char *const (&presets)[N]) { + this->compat_custom_presets_.assign(presets, presets + N); + } // 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;