From f66f9c4eafe4360e17bc8d847d56b03446bd7b99 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 30 Oct 2025 19:00:02 -0500 Subject: [PATCH] simplify --- esphome/components/climate/climate.cpp | 4 ++-- esphome/components/climate/climate.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/esphome/components/climate/climate.cpp b/esphome/components/climate/climate.cpp index 20df78ea1f..a9d42523d8 100644 --- a/esphome/components/climate/climate.cpp +++ b/esphome/components/climate/climate.cpp @@ -300,14 +300,14 @@ const optional &ClimateCall::get_preset() const { return this->pr const char *ClimateCall::get_custom_fan_mode() const { return this->custom_fan_mode_; } const char *ClimateCall::get_custom_preset() const { return this->custom_preset_; } -optional ClimateCall::get_custom_fan_mode_optional() const { +optional ClimateCall::get_custom_fan_mode() const { if (this->custom_fan_mode_ != nullptr) { return std::string(this->custom_fan_mode_); } return {}; } -optional ClimateCall::get_custom_preset_optional() const { +optional ClimateCall::get_custom_preset() const { if (this->custom_preset_ != nullptr) { return std::string(this->custom_preset_); } diff --git a/esphome/components/climate/climate.h b/esphome/components/climate/climate.h index 0600cf234c..49ea2a47a8 100644 --- a/esphome/components/climate/climate.h +++ b/esphome/components/climate/climate.h @@ -110,12 +110,12 @@ class ClimateCall { const optional &get_fan_mode() const; const optional &get_swing_mode() const; const optional &get_preset() const; - /// @deprecated Use get_custom_fan_mode() (returns const char*) instead (since 2025.11.0) - optional get_custom_fan_mode() const; - /// @deprecated Use get_custom_preset() (returns const char*) instead (since 2025.11.0) - optional get_custom_preset() const; const char *get_custom_fan_mode() const; const char *get_custom_preset() const; + /// @deprecated Use get_custom_fan_mode() (returns const char*) instead (since 2025.11.0) + optional get_custom_fan_mode_optional() const; + /// @deprecated Use get_custom_preset() (returns const char*) instead (since 2025.11.0) + optional get_custom_preset_optional() const; protected: void validate_();