mirror of
https://github.com/esphome/esphome.git
synced 2026-09-22 12:38:40 +00:00
fix trigge on preset mode cleared
This commit is contained in:
@@ -177,7 +177,7 @@ void Fan::publish_state() {
|
||||
ESP_LOGD(TAG, " Direction: %s", LOG_STR_ARG(fan_direction_to_string(this->direction)));
|
||||
}
|
||||
const char *preset = this->get_preset_mode();
|
||||
if (traits.supports_preset_modes() && preset != nullptr) {
|
||||
if (preset != nullptr) {
|
||||
ESP_LOGD(TAG, " Preset Mode: %s", preset);
|
||||
}
|
||||
this->state_callback_.call();
|
||||
|
||||
@@ -156,6 +156,8 @@ class Fan : public EntityBase {
|
||||
CallbackManager<void()> state_callback_{};
|
||||
ESPPreferenceObject rtc_;
|
||||
FanRestoreMode restore_mode_;
|
||||
|
||||
private:
|
||||
const char *preset_mode_{nullptr};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user