From 0f11cbea816fe8b8e9c9a643bbbe4978461fdf38 Mon Sep 17 00:00:00 2001 From: crankyoldgit Date: Fri, 27 Aug 2021 15:52:43 +1000 Subject: [PATCH] MitsubishiAC: Fix code lint issue. * Fix a code linter warning. * Improve documentation. * Improve a unit test. Ref #1572 --- src/ir_Mitsubishi.cpp | 2 ++ src/ir_Mitsubishi.h | 2 +- test/ir_Mitsubishi_test.cpp | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ir_Mitsubishi.cpp b/src/ir_Mitsubishi.cpp index 3fc504da6..03e562ef5 100644 --- a/src/ir_Mitsubishi.cpp +++ b/src/ir_Mitsubishi.cpp @@ -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; diff --git a/src/ir_Mitsubishi.h b/src/ir_Mitsubishi.h index f5e2d6457..1f3a42184 100644 --- a/src/ir_Mitsubishi.h +++ b/src/ir_Mitsubishi.h @@ -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; diff --git a/test/ir_Mitsubishi_test.cpp b/test/ir_Mitsubishi_test.cpp index fae5c431c..28cc04d8e 100644 --- a/test/ir_Mitsubishi_test.cpp +++ b/test/ir_Mitsubishi_test.cpp @@ -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();