Skip to content

Commit

Permalink
Only update auto state when preset is actually set
Browse files Browse the repository at this point in the history
  • Loading branch information
mill1000 committed Jan 5, 2024
1 parent de53b20 commit 60343ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/winix_c545/winix_c545.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,8 @@ void WinixC545Fan::control(const fan::FanCall &call) {
this->preset_mode = call.get_preset_mode();

// Update auto mode
states.emplace(StateKey::Auto, (this->preset_mode == PRESET_AUTO) ? 1 : 2);
if (this->preset_mode == PRESET_AUTO)
states.emplace(StateKey::Auto, 1);

// Set sleep mode
if (this->preset_mode == PRESET_SLEEP)
Expand Down

0 comments on commit 60343ee

Please sign in to comment.