[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 GitHub
parent 9ae45ba8aa
commit a572d4eb47
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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