Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Fix the Coolix fan-only mode in IRac class. #2104

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/IRac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -736,8 +736,10 @@ void IRac::coolix(IRCoolixAC *ac,
ac->send();
return;
}
ac->setMode(ac->convertMode(mode));
ac->setTemp(degrees);
// Mode needs to be set after temp as Fan-only uses a special temp.
ac->setMode(ac->convertMode(mode));
// Fan needs to be set after mode, as setMode can change the fan speed.
ac->setFan(ac->convertFan(fan));
// No Filter setting available.
// No Beep setting available.
Expand Down
30 changes: 30 additions & 0 deletions test/IRac_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,36 @@ TEST(TestIRac, Coolix) {
ASSERT_EQ(stdAc::ac_command_t::kControlCommand, r.command);
}

TEST(TestIRac, Coolix_Issue2103) {
IRCoolixAC ac(kGpioUnused);
IRac irac(kGpioUnused);
IRrecv capture(kGpioUnused);
char expected[] =
"Power: On, Mode: 4 (Fan), Fan: 5 (Auto), Zone Follow: Off, "
"Sensor Temp: Off";

ac.begin();
irac.coolix(&ac,
true, // Power
stdAc::opmode_t::kFan, // Mode
21, // Celsius
kNoTempValue, // Sensor Temp
stdAc::fanspeed_t::kAuto, // Fan speed
stdAc::swingv_t::kOff, // Vertical swing
stdAc::swingh_t::kOff, // Horizontal swing
false, // iFeel
false, // Turbo
false, // Light
false, // Clean
-1); // Sleep
ASSERT_EQ(expected, ac.toString());
ac._irsend.makeDecodeResult();
EXPECT_TRUE(capture.decode(&ac._irsend.capture));
ASSERT_EQ(COOLIX, ac._irsend.capture.decode_type);
ASSERT_EQ(kCoolixBits, ac._irsend.capture.bits);
ASSERT_EQ(expected, IRAcUtils::resultAcToString(&ac._irsend.capture));
}

TEST(TestIRac, Corona) {
IRCoronaAc ac(kGpioUnused);
IRac irac(kGpioUnused);
Expand Down
Loading