diff --git a/src/ir_Mitsubishi.cpp b/src/ir_Mitsubishi.cpp index 3d74ebf68..286072bdc 100644 --- a/src/ir_Mitsubishi.cpp +++ b/src/ir_Mitsubishi.cpp @@ -62,7 +62,7 @@ const uint16_t kMitsubishiAcBitMark = 450; const uint16_t kMitsubishiAcOneSpace = 1300; const uint16_t kMitsubishiAcZeroSpace = 420; const uint16_t kMitsubishiAcRptMark = 440; -const uint16_t kMitsubishiAcRptSpace = 17100; +const uint16_t kMitsubishiAcRptSpace = 15500; const uint8_t kMitsubishiAcExtraTolerance = 5; // Mitsubishi 136 bit A/C diff --git a/src/ir_Mitsubishi.h b/src/ir_Mitsubishi.h index 55afcdce6..85e61eefd 100644 --- a/src/ir_Mitsubishi.h +++ b/src/ir_Mitsubishi.h @@ -35,6 +35,7 @@ // Brand: Mitsubishi Electric, Model: SG15D remote (MITSUBISHI_AC) // Brand: Mitsubishi Electric, Model: MSZ-ZW4017S A/C (MITSUBISHI_AC) // Brand: Mitsubishi Electric, Model: MSZ-FHnnVE A/C (MITSUBISHI_AC) +// Brand: Mitsubishi Electric, Model: RH151 remote (MITSUBISHI_AC) #ifndef IR_MITSUBISHI_H_ #define IR_MITSUBISHI_H_ diff --git a/test/ir_Mitsubishi_test.cpp b/test/ir_Mitsubishi_test.cpp index 815d4f996..cbed3084e 100644 --- a/test/ir_Mitsubishi_test.cpp +++ b/test/ir_Mitsubishi_test.cpp @@ -353,7 +353,7 @@ TEST(TestSendMitsubishiAC, SendDataOnly) { "m450s420m450s420m450s420m450s420m450s420m450s420m450s420m450s420" "m450s420m450s420m450s420m450s420m450s420m450s420m450s420m450s420" "m450s1300m450s1300m450s1300m450s1300m450s1300m450s420m450s420m450s420" - "m440s17100" + "m440s15500" "m3400s1750" "m450s1300m450s1300m450s420m450s420m450s420m450s1300m450s420m450s420" "m450s1300m450s1300m450s420m450s1300m450s420m450s420m450s1300m450s1300" @@ -373,7 +373,7 @@ TEST(TestSendMitsubishiAC, SendDataOnly) { "m450s420m450s420m450s420m450s420m450s420m450s420m450s420m450s420" "m450s420m450s420m450s420m450s420m450s420m450s420m450s420m450s420" "m450s1300m450s1300m450s1300m450s1300m450s1300m450s420m450s420m450s420" - "m440s17100", + "m440s15500", irsend.outputStr()); } @@ -409,7 +409,7 @@ TEST(TestSendMitsubishiAC, SendWithRepeats) { "m450s420m450s420m450s420m450s420m450s420m450s420m450s420m450s420" "m450s420m450s420m450s420m450s420m450s420m450s420m450s420m450s420" "m450s1300m450s1300m450s1300m450s1300m450s1300m450s420m450s420m450s420" - "m440s17100", + "m440s15500", irsend.outputStr()); irsend.reset(); @@ -435,7 +435,7 @@ TEST(TestSendMitsubishiAC, SendWithRepeats) { "m450s420m450s420m450s420m450s420m450s420m450s420m450s420m450s420" "m450s420m450s420m450s420m450s420m450s420m450s420m450s420m450s420" "m450s1300m450s1300m450s1300m450s1300m450s1300m450s420m450s420m450s420" - "m440s17100" + "m440s15500" "m3400s1750" "m450s1300m450s1300m450s420m450s420m450s420m450s1300m450s420m450s420" "m450s1300m450s1300m450s420m450s1300m450s420m450s420m450s1300m450s1300" @@ -455,7 +455,7 @@ TEST(TestSendMitsubishiAC, SendWithRepeats) { "m450s420m450s420m450s420m450s420m450s420m450s420m450s420m450s420" "m450s420m450s420m450s420m450s420m450s420m450s420m450s420m450s420" "m450s1300m450s1300m450s1300m450s1300m450s1300m450s420m450s420m450s420" - "m440s17100" + "m440s15500" "m3400s1750" "m450s1300m450s1300m450s420m450s420m450s420m450s1300m450s420m450s420" "m450s1300m450s1300m450s420m450s1300m450s420m450s420m450s1300m450s1300" @@ -475,7 +475,7 @@ TEST(TestSendMitsubishiAC, SendWithRepeats) { "m450s420m450s420m450s420m450s420m450s420m450s420m450s420m450s420" "m450s420m450s420m450s420m450s420m450s420m450s420m450s420m450s420" "m450s1300m450s1300m450s1300m450s1300m450s1300m450s420m450s420m450s420" - "m440s17100", + "m440s15500", irsend.outputStr()); } @@ -518,7 +518,7 @@ TEST(TestSendMitsubishiAC, SendUnexpectedSizes) { "m450s420m450s420m450s420m450s420m450s420m450s420m450s420m450s420" "m450s1300m450s1300m450s1300m450s1300m450s1300m450s420m450s420m450s420" "m450s420m450s420m450s420m450s420m450s420m450s420m450s420m450s420" - "m440s17100" + "m440s15500" "m3400s1750" "m450s1300m450s1300m450s420m450s420m450s420m450s1300m450s420m450s420" "m450s1300m450s1300m450s420m450s1300m450s420m450s420m450s1300m450s1300" @@ -539,7 +539,7 @@ TEST(TestSendMitsubishiAC, SendUnexpectedSizes) { "m450s420m450s420m450s420m450s420m450s420m450s420m450s420m450s420" "m450s1300m450s1300m450s1300m450s1300m450s1300m450s420m450s420m450s420" "m450s420m450s420m450s420m450s420m450s420m450s420m450s420m450s420" - "m440s17100", + "m440s15500", irsend.outputStr()); } @@ -751,7 +751,7 @@ TEST(TestMitsubishiACClass, MessageConstuction) { "m450s420m450s420m450s420m450s420m450s420m450s420m450s420m450s420" "m450s420m450s420m450s420m450s420m450s1300m450s420m450s420m450s420" "m450s420m450s1300m450s1300m450s1300m450s1300m450s420m450s1300m450s420" - "m440s17100" + "m440s15500" "m3400s1750" "m450s1300m450s1300m450s420m450s420m450s420m450s1300m450s420m450s420" "m450s1300m450s1300m450s420m450s1300m450s420m450s420m450s1300m450s1300" @@ -771,7 +771,7 @@ TEST(TestMitsubishiACClass, MessageConstuction) { "m450s420m450s420m450s420m450s420m450s420m450s420m450s420m450s420" "m450s420m450s420m450s420m450s420m450s1300m450s420m450s420m450s420" "m450s420m450s1300m450s1300m450s1300m450s1300m450s420m450s1300m450s420" - "m440s17100", + "m440s15500", irsend.outputStr()); } @@ -1712,3 +1712,74 @@ TEST(TestMitsubishiACClass, WeeklyTimerEnabled) { ac.setRaw(weekly_off); EXPECT_FALSE(ac.getWeeklyTimerEnabled()); } + +// Decode a 'real' example for a MLZ-RX5017AS A/C +TEST(TestDecodeMitsubishiAC, Issue1759) { + IRsendTest irsend(kGpioUnused); + IRrecv irrecv(kGpioUnused); + irsend.begin(); + + irsend.reset(); + const uint16_t rawData[583] = { + 3392, 1638, 456, 1220, 456, 1220, 456, 382, 454, 382, 456, 380, 456, 1222, + 454, 380, 456, 382, 456, 1220, 456, 1220, 456, 382, 454, 1222, 454, 382, + 456, 384, 454, 1222, 454, 1220, 454, 382, 456, 1220, 456, 1220, 456, 382, + 456, 382, 456, 1220, 456, 380, 456, 382, 456, 1220, 456, 380, 456, 382, + 456, 382, 456, 380, 456, 382, 456, 380, 458, 382, 456, 380, 456, 382, 456, + 382, 456, 382, 456, 382, 456, 382, 456, 382, 456, 382, 456, 382, 456, 382, + 456, 380, 458, 382, 456, 380, 456, 1220, 456, 380, 456, 382, 456, 382, + 456, 382, 456, 382, 456, 1220, 456, 382, 456, 382, 456, 382, 456, 380, + 456, 382, 456, 382, 456, 1220, 456, 382, 456, 382, 456, 382, 456, 382, + 454, 382, 456, 382, 456, 382, 456, 382, 454, 384, 454, 382, 456, 380, 456, + 382, 456, 382, 456, 382, 456, 382, 454, 382, 456, 382, 456, 382, 456, 382, + 456, 1222, 454, 1220, 456, 382, 456, 382, 456, 382, 454, 1220, 456, 1220, + 454, 1222, 454, 1220, 454, 382, 456, 382, 456, 382, 454, 382, 454, 382, + 456, 382, 456, 382, 456, 382, 454, 382, 456, 380, 456, 382, 454, 382, 454, + 384, 454, 382, 456, 382, 454, 384, 454, 382, 456, 382, 456, 382, 456, 384, + 454, 384, 454, 382, 456, 382, 454, 382, 454, 384, 454, 382, 456, 1220, + 456, 382, 456, 382, 454, 382, 456, 382, 456, 382, 454, 1220, 456, 382, + 456, 382, 456, 382, 456, 382, 454, 382, 456, 382, 456, 382, 454, 382, 456, + 382, 454, 382, 456, 382, 456, 382, 456, 382, 456, 382, 456, 382, 456, 382, + 454, 1220, 456, 1220, 456, 380, 456, 1220, 456, 1220, 456, 1222, 454, + 1220, 456, 1220, 456, 11280, + 3392, 1638, 454, 1220, 456, 1220, 456, 382, 456, 382, 456, 382, 456, 1220, + 456, 380, 456, 382, 456, 1220, 456, 1220, 454, 382, 456, 1220, 456, 382, + 456, 382, 456, 1220, 456, 1222, 454, 382, 456, 1220, 456, 1220, 454, 382, + 456, 382, 456, 1220, 454, 382, 456, 382, 456, 1220, 456, 382, 456, 382, + 454, 382, 456, 382, 454, 382, 456, 382, 456, 382, 456, 382, 456, 382, 454, + 382, 456, 382, 456, 382, 456, 382, 456, 382, 456, 382, 456, 382, 454, 382, + 456, 382, 456, 382, 456, 382, 456, 1220, 456, 382, 456, 382, 456, 382, + 454, 382, 456, 382, 456, 1220, 456, 380, 456, 382, 456, 382, 456, 382, + 456, 382, 456, 382, 456, 1220, 456, 382, 454, 382, 456, 382, 454, 382, + 456, 382, 456, 382, 456, 382, 456, 382, 456, 382, 456, 380, 456, 382, 456, + 380, 456, 382, 456, 382, 456, 382, 454, 382, 456, 382, 454, 382, 456, 382, + 456, 1220, 454, 1220, 456, 382, 456, 382, 456, 382, 454, 1220, 456, 1220, + 454, 1222, 454, 1220, 454, 382, 456, 382, 456, 382, 456, 382, 456, 382, + 456, 382, 456, 382, 454, 382, 456, 382, 456, 382, 456, 382, 456, 382, 456, + 382, 456, 382, 456, 382, 454, 382, 456, 382, 456, 382, 456, 382, 456, 382, + 456, 382, 456, 382, 456, 380, 456, 382, 456, 382, 456, 382, 456, 1220, + 456, 382, 456, 382, 456, 382, 454, 382, 456, 382, 456, 1222, 454, 380, + 456, 382, 456, 382, 456, 382, 456, 380, 456, 382, 456, 382, 454, 382, 454, + 382, 456, 382, 456, 382, 456, 382, 456, 382, 456, 382, 456, 382, 456, 382, + 456, 1220, 456, 1220, 454, 382, 456, 1222, 454, 1220, 454, 1220, 454, + 1222, 454, 1220, 456}; // UNKNOWN 76CCC723 + irsend.sendRaw(rawData, 583, 38); + irsend.makeDecodeResult(); + + ASSERT_TRUE(irrecv.decode(&irsend.capture)); + ASSERT_EQ(MITSUBISHI_AC, irsend.capture.decode_type); + EXPECT_EQ(kMitsubishiACBits, irsend.capture.bits); + uint8_t expected[kMitsubishiACStateLength] = { + 0x23, 0xCB, 0x26, 0x01, 0x00, 0x20, 0x08, 0x04, 0x00, 0xC0, + 0x78, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0xFB}; + EXPECT_STATE_EQ(expected, irsend.capture.state, irsend.capture.bits); + EXPECT_EQ( + "Power: On, Mode: 1 (Heat), Temp: 20C, Fan: 0 (Auto), " + "Swing(V): 0 (Auto), Swing(H): 0 (UNKNOWN), Clock: 20:00, " + "On Timer: 00:00, Off Timer: 00:00, Timer: -, Weekly Timer: Off, " + "10C Heat: Off, ISee: Off, Econo: Off, Absense detect: Off, " + "Direct / Indirect Mode: 0, Fresh: Off", + IRAcUtils::resultAcToString(&irsend.capture)); + stdAc::state_t r, p; + ASSERT_TRUE(IRAcUtils::decodeToState(&irsend.capture, &r, &p)); +}