MitsubishiAC: Fix code lint issue. (#1576)

* Fix a code linter warning.
* Improve documentation.
* Improve a unit test.

Ref #1572
This commit is contained in:
David Conran
2021-08-27 17:16:38 +10:00
committed by GitHub
parent e507b60832
commit bdff66753f
3 changed files with 4 additions and 1 deletions

View File

@@ -455,6 +455,7 @@ void IRMitsubishiAC::setMode(const uint8_t mode) {
}
/// Set the requested vane (Vertical Swing) operation mode of the a/c unit.
/// @note On some models, this represents the Right vertical vane.
/// @param[in] position The position/mode to set the vane to.
void IRMitsubishiAC::setVane(const uint8_t position) {
uint8_t pos = std::min(position, kMitsubishiAcVaneAutoMove); // bounds check
@@ -469,6 +470,7 @@ void IRMitsubishiAC::setWideVane(const uint8_t position) {
}
/// Get the Vane (Vertical Swing) mode of the A/C.
/// @note On some models, this represents the Right vertical vane.
/// @return The native position/mode setting.
uint8_t IRMitsubishiAC::getVane(void) const {
return _.Vane;

View File

@@ -91,7 +91,7 @@ union Mitsubishi144Protocol{
uint8_t :8;
// Byte 16
uint8_t :3;
uint8_t VaneLeft :3; // SwingV(Left)
uint8_t VaneLeft :3; // SwingV(Left)
uint8_t :2;
// Byte 17
uint8_t Sum :8;

View File

@@ -725,6 +725,7 @@ TEST(TestMitsubishiACClass, MessageConstuction) {
EXPECT_EQ(kMitsubishiAcCool, ac.getMode());
EXPECT_EQ(27, ac.getTemp());
EXPECT_EQ(3, ac.getVane());
EXPECT_EQ(2, ac.getVaneLeft());
EXPECT_TRUE(ac.getPower());
irsend.reset();