1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 03:12:20 +01:00

[fan] Do not save state for fan if configured as NO_RESTORE (#9472)

This commit is contained in:
skyegecko
2025-07-15 04:15:47 +02:00
committed by Jesse Hills
parent 35b3f75f7c
commit 42b6939e90

View File

@@ -177,6 +177,10 @@ optional<FanRestoreState> Fan::restore_state_() {
return {}; return {};
} }
void Fan::save_state_() { void Fan::save_state_() {
if (this->restore_mode_ == FanRestoreMode::NO_RESTORE) {
return;
}
FanRestoreState state{}; FanRestoreState state{};
state.state = this->state; state.state = this->state;
state.oscillating = this->oscillating; state.oscillating = this->oscillating;