Skip to content

Commit

Permalink
Coolix: Add additional Unit test.
Browse files Browse the repository at this point in the history
* Add a unit test to verify ZoneFollow Fan speed is set when SensorTemp is set.
* No code changes, just a unit test confirming all is working.

For #1318 (comment)
  • Loading branch information
crankyoldgit committed Nov 22, 2020
1 parent 43ed95c commit 44ef381
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/ir_Coolix_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -920,3 +920,24 @@ TEST(TestCoolixACClass, SendStep) {
"m552s105244",
ac._irsend.outputStr());
}

// Ref: https://github.com/crankyoldgit/IRremoteESP8266/issues/1318#issuecomment-731578060
// Confirm ZoneFollow Fan is being set correctly when SensorTemp is set.
TEST(TestCoolixACClass, VerifyZoneFollowFan) {
IRCoolixAC ac(kGpioUnused);
EXPECT_NE(kCoolixFanZoneFollow, ac.getFan());
EXPECT_FALSE(ac.getZoneFollow());
ac.setPower(true);
ac.setMode(kCoolixHeat);
ac.setTemp(24); // C
EXPECT_NE(kCoolixFanZoneFollow, ac.getFan());
EXPECT_FALSE(ac.getZoneFollow());
ac.setSensorTemp(19); // C
EXPECT_EQ(kCoolixFanZoneFollow, ac.getFan());
EXPECT_TRUE(ac.getZoneFollow());
EXPECT_EQ(0xBAD34E, ac.getRaw());
EXPECT_EQ(
"Power: On, Mode: 3 (Heat), Fan: 6 (Zone Follow), Temp: 24C, "
"Zone Follow: On, Sensor Temp: 19C",
ac.toString());
}

0 comments on commit 44ef381

Please sign in to comment.