Climate preset fix (#5407)

This commit is contained in:
Joris S 2023-09-20 23:28:03 +02:00 committed by GitHub
parent bf253c21fa
commit 397f57ce74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -986,6 +986,7 @@ void ThermostatClimate::change_preset_(climate::ClimatePreset preset) {
// Fire any preset changed trigger if defined
Trigger<> *trig = this->preset_change_trigger_;
assert(trig != nullptr);
this->preset = preset;
trig->trigger();
this->refresh();
@ -1010,6 +1011,7 @@ void ThermostatClimate::change_custom_preset_(const std::string &custom_preset)
// Fire any preset changed trigger if defined
Trigger<> *trig = this->preset_change_trigger_;
assert(trig != nullptr);
this->custom_preset = custom_preset;
trig->trigger();
this->refresh();