diff --git a/esphome/components/bedjet/climate/bedjet_climate.cpp b/esphome/components/bedjet/climate/bedjet_climate.cpp index 737000f9ae..52cc76f147 100644 --- a/esphome/components/bedjet/climate/bedjet_climate.cpp +++ b/esphome/components/bedjet/climate/bedjet_climate.cpp @@ -144,8 +144,7 @@ void BedJetClimate::control(const ClimateCall &call) { if (result) { this->mode = CLIMATE_MODE_HEAT; - this->preset = CLIMATE_PRESET_BOOST; - this->clear_custom_preset_(); + this->set_preset_(CLIMATE_PRESET_BOOST); } } else if (preset == CLIMATE_PRESET_NONE && this->preset.has_value()) { if (this->mode == CLIMATE_MODE_HEAT && this->preset == CLIMATE_PRESET_BOOST) { @@ -259,7 +258,6 @@ void BedJetClimate::on_status(const BedjetStatusPacket *data) { case MODE_HEAT: this->mode = CLIMATE_MODE_HEAT; this->action = CLIMATE_ACTION_HEATING; - this->preset.reset(); if (this->heating_mode_ == HEAT_MODE_EXTENDED) { this->set_custom_preset_("LTD HT"); } else { @@ -270,7 +268,6 @@ void BedJetClimate::on_status(const BedjetStatusPacket *data) { case MODE_EXTHT: this->mode = CLIMATE_MODE_HEAT; this->action = CLIMATE_ACTION_HEATING; - this->preset.reset(); if (this->heating_mode_ == HEAT_MODE_EXTENDED) { this->clear_custom_preset_(); } else { @@ -293,8 +290,7 @@ void BedJetClimate::on_status(const BedjetStatusPacket *data) { break; case MODE_TURBO: - this->preset = CLIMATE_PRESET_BOOST; - this->clear_custom_preset_(); + this->set_preset_(CLIMATE_PRESET_BOOST); this->mode = CLIMATE_MODE_HEAT; this->action = CLIMATE_ACTION_HEATING; break; diff --git a/esphome/components/demo/demo_climate.h b/esphome/components/demo/demo_climate.h index 0a71ec6dab..f8944b0735 100644 --- a/esphome/components/demo/demo_climate.h +++ b/esphome/components/demo/demo_climate.h @@ -37,7 +37,7 @@ class DemoClimate : public climate::Climate, public Component { this->mode = climate::CLIMATE_MODE_HEAT_COOL; this->set_custom_fan_mode_("Auto Low"); this->swing_mode = climate::CLIMATE_SWING_HORIZONTAL; - this->preset = climate::CLIMATE_PRESET_AWAY; + this->set_preset_(climate::CLIMATE_PRESET_AWAY); break; } this->publish_state(); diff --git a/esphome/components/thermostat/thermostat_climate.cpp b/esphome/components/thermostat/thermostat_climate.cpp index 5e52c4721e..d2f5db3b32 100644 --- a/esphome/components/thermostat/thermostat_climate.cpp +++ b/esphome/components/thermostat/thermostat_climate.cpp @@ -1162,7 +1162,7 @@ void ThermostatClimate::change_preset_(climate::ClimatePreset preset) { this->preset.value() != preset) { // Fire any preset changed trigger if defined Trigger<> *trig = this->preset_change_trigger_; - this->preset = preset; + this->set_preset_(preset); if (trig != nullptr) { trig->trigger(); } @@ -1172,8 +1172,6 @@ void ThermostatClimate::change_preset_(climate::ClimatePreset preset) { } else { ESP_LOGI(TAG, "No changes required to apply preset %s", LOG_STR_ARG(climate::climate_preset_to_string(preset))); } - this->clear_custom_preset_(); - this->preset = preset; } else { ESP_LOGW(TAG, "Preset %s not configured; ignoring", LOG_STR_ARG(climate::climate_preset_to_string(preset))); }