From 5e299580bdc365037a526be5127734fd0373817f Mon Sep 17 00:00:00 2001 From: crankyoldgit Date: Sat, 26 Jun 2021 17:55:42 +1000 Subject: [PATCH] [GREE] Update inter-message gap timing * Based on ground-truth data & similarity to the Kelvinator protocol, I'm changing the `kGreeMsgSpace` to approx 20ms instead of 19ms. Ref: - https://github.com/crankyoldgit/IRremoteESP8266/blob/e70cd5b9a46b7a4e14f7f21e439f1b70568d50cf/test/ir_Gree_test.cpp#L609 - https://github.com/crankyoldgit/IRremoteESP8266/blob/e70cd5b9a46b7a4e14f7f21e439f1b70568d50cf/src/ir_Kelvinator.cpp#L42-L43 * Update supported model info. Fixed #1508 --- src/ir_Gree.cpp | 3 ++- src/ir_Gree.h | 3 +++ test/ir_Gree_test.cpp | 28 ++++++++++++++-------------- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/ir_Gree.cpp b/src/ir_Gree.cpp index 285bb71e1..51bf0fd7e 100644 --- a/src/ir_Gree.cpp +++ b/src/ir_Gree.cpp @@ -4,6 +4,7 @@ /// @file /// @brief Support for Gree A/C protocols. /// @see https://github.com/ToniA/arduino-heatpumpir/blob/master/GreeHeatpumpIR.h +/// @see https://github.com/crankyoldgit/IRremoteESP8266/issues/1508 #include "ir_Gree.h" #include @@ -24,7 +25,7 @@ const uint16_t kGreeHdrSpace = 4500; ///< See #684 & real example in unit tests const uint16_t kGreeBitMark = 620; const uint16_t kGreeOneSpace = 1600; const uint16_t kGreeZeroSpace = 540; -const uint16_t kGreeMsgSpace = 19000; +const uint16_t kGreeMsgSpace = 19980; ///< See #1508, #386, & Kelvinator const uint8_t kGreeBlockFooter = 0b010; const uint8_t kGreeBlockFooterBits = 3; diff --git a/src/ir_Gree.h b/src/ir_Gree.h index 9fbb1f88a..4f89fde5c 100644 --- a/src/ir_Gree.h +++ b/src/ir_Gree.h @@ -3,6 +3,7 @@ /// @file /// @brief Support for Gree A/C protocols. /// @see https://github.com/ToniA/arduino-heatpumpir/blob/master/GreeHeatpumpIR.h +/// @see https://github.com/crankyoldgit/IRremoteESP8266/issues/1508 // Supports: // Brand: Ultimate, Model: Heat Pump @@ -15,6 +16,8 @@ // Brand: Gree, Model: YB1F2F remote // Brand: Amana, Model: PBC093G00CC A/C // Brand: Amana, Model: YX1FF remote +// Brand: Cooper & Hunter, Model: YB1F2 remote +// Brand: Cooper & Hunter, Model: CH-S09FTXG A/C #ifndef IR_GREE_H_ #define IR_GREE_H_ diff --git a/test/ir_Gree_test.cpp b/test/ir_Gree_test.cpp index 46b1b17b4..597fd3c09 100644 --- a/test/ir_Gree_test.cpp +++ b/test/ir_Gree_test.cpp @@ -28,12 +28,12 @@ TEST(TestSendGreeChars, SendData) { "m620s540m620s1600m620s1600m620s540m620s1600m620s540m620s1600m620s540" "m620s540m620s540m620s540m620s1600m620s1600m620s1600m620s1600m620s540" "m620s540m620s1600m620s540" - "m620s19000" + "m620s19980" "m620s540m620s540m620s540m620s540m620s1600m620s540m620s540m620s1600" "m620s1600m620s1600m620s540m620s1600m620s540m620s1600m620s540m620s1600" "m620s1600m620s540m620s1600m620s1600m620s540m620s540m620s1600m620s1600" "m620s1600m620s1600m620s1600m620s1600m620s540m620s1600m620s1600m620s1600" - "m620s19000", + "m620s19980", irsend.outputStr()); } @@ -51,12 +51,12 @@ TEST(TestSendGreeUint64, SendData) { "m620s540m620s1600m620s1600m620s540m620s1600m620s540m620s1600m620s540" "m620s540m620s540m620s540m620s1600m620s1600m620s1600m620s1600m620s540" "m620s540m620s1600m620s540" - "m620s19000" + "m620s19980" "m620s540m620s540m620s540m620s540m620s1600m620s540m620s540m620s1600" "m620s1600m620s1600m620s540m620s1600m620s540m620s1600m620s540m620s1600" "m620s1600m620s540m620s1600m620s1600m620s540m620s540m620s1600m620s1600" "m620s1600m620s1600m620s1600m620s1600m620s540m620s1600m620s1600m620s1600" - "m620s19000", + "m620s19980", irsend.outputStr()); } @@ -79,24 +79,24 @@ TEST(TestSendGreeChars, SendWithRepeats) { "m620s540m620s1600m620s1600m620s540m620s1600m620s540m620s1600m620s540" "m620s540m620s540m620s540m620s1600m620s1600m620s1600m620s1600m620s540" "m620s540m620s1600m620s540" - "m620s19000" + "m620s19980" "m620s540m620s540m620s540m620s540m620s1600m620s540m620s540m620s1600" "m620s1600m620s1600m620s540m620s1600m620s540m620s1600m620s540m620s1600" "m620s1600m620s540m620s1600m620s1600m620s540m620s540m620s1600m620s1600" "m620s1600m620s1600m620s1600m620s1600m620s540m620s1600m620s1600m620s1600" - "m620s19000" + "m620s19980" "m9000s4500" "m620s540m620s1600m620s540m620s540m620s1600m620s540m620s540m620s540" "m620s540m620s540m620s1600m620s540m620s1600m620s1600m620s540m620s540" "m620s540m620s1600m620s1600m620s540m620s1600m620s540m620s1600m620s540" "m620s540m620s540m620s540m620s1600m620s1600m620s1600m620s1600m620s540" "m620s540m620s1600m620s540" - "m620s19000" + "m620s19980" "m620s540m620s540m620s540m620s540m620s1600m620s540m620s540m620s1600" "m620s1600m620s1600m620s540m620s1600m620s540m620s1600m620s540m620s1600" "m620s1600m620s540m620s1600m620s1600m620s540m620s540m620s1600m620s1600" "m620s1600m620s1600m620s1600m620s1600m620s540m620s1600m620s1600m620s1600" - "m620s19000", + "m620s19980", irsend.outputStr()); } @@ -114,24 +114,24 @@ TEST(TestSendGreeUint64, SendWithRepeats) { "m620s540m620s1600m620s1600m620s540m620s1600m620s540m620s1600m620s540" "m620s540m620s540m620s540m620s1600m620s1600m620s1600m620s1600m620s540" "m620s540m620s1600m620s540" - "m620s19000" + "m620s19980" "m620s540m620s540m620s540m620s540m620s1600m620s540m620s540m620s1600" "m620s1600m620s1600m620s540m620s1600m620s540m620s1600m620s540m620s1600" "m620s1600m620s540m620s1600m620s1600m620s540m620s540m620s1600m620s1600" "m620s1600m620s1600m620s1600m620s1600m620s540m620s1600m620s1600m620s1600" - "m620s19000" + "m620s19980" "m9000s4500" "m620s540m620s1600m620s540m620s540m620s1600m620s540m620s540m620s540" "m620s540m620s540m620s1600m620s540m620s1600m620s1600m620s540m620s540" "m620s540m620s1600m620s1600m620s540m620s1600m620s540m620s1600m620s540" "m620s540m620s540m620s540m620s1600m620s1600m620s1600m620s1600m620s540" "m620s540m620s1600m620s540" - "m620s19000" + "m620s19980" "m620s540m620s540m620s540m620s540m620s1600m620s540m620s540m620s1600" "m620s1600m620s1600m620s540m620s1600m620s540m620s1600m620s540m620s1600" "m620s1600m620s540m620s1600m620s1600m620s540m620s540m620s1600m620s1600" "m620s1600m620s1600m620s1600m620s1600m620s540m620s1600m620s1600m620s1600" - "m620s19000", + "m620s19980", irsend.outputStr()); } @@ -158,13 +158,13 @@ TEST(TestSendGreeChars, SendUnexpectedSizes) { "m620s540m620s1600m620s1600m620s540m620s1600m620s540m620s1600m620s540" "m620s540m620s540m620s540m620s1600m620s1600m620s1600m620s1600m620s540" "m620s540m620s1600m620s540" - "m620s19000" + "m620s19980" "m620s540m620s540m620s540m620s540m620s1600m620s540m620s540m620s1600" "m620s1600m620s1600m620s540m620s1600m620s540m620s1600m620s540m620s1600" "m620s1600m620s540m620s1600m620s1600m620s540m620s540m620s1600m620s1600" "m620s1600m620s1600m620s1600m620s1600m620s540m620s1600m620s1600m620s1600" "m620s540m620s1600m620s540m620s540m620s1600m620s540m620s540m620s540" - "m620s19000", + "m620s19980", irsend.outputStr()); }