Skip to content

Commit

Permalink
Merge branch 'crankyoldgit:master' into feature/electrolux-ac-eacm
Browse files Browse the repository at this point in the history
  • Loading branch information
StellaLupus authored Sep 19, 2024
2 parents a9e750c + ce0a65e commit 5dd87d6
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/ir_Airton.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const uint8_t kAirtonFanHigh = 0b100; // 4
const uint8_t kAirtonFanMax = 0b101; // 5

const uint8_t kAirtonMinTemp = 16; // 16C
const uint8_t kAirtonMaxTemp = 25; // 25C
const uint8_t kAirtonMaxTemp = 31; // 31C


/// Class for handling detailed Airton 56-bit A/C messages.
Expand Down
1 change: 1 addition & 0 deletions src/ir_Coolix.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// Brand: Midea, Model: RG52D/BGE Remote
// Brand: Midea, Model: MS12FU-10HRDN1-QRD0GW(B) A/C
// Brand: Midea, Model: MSABAU-07HRFN1-QRD0GW A/C (circa 2016)
// Brand: Comfee (Midea), Model: Breezy Cool Pro 2.6
// Brand: Tokio, Model: AATOEMF17-12CHR1SW split-type RG51|50/BGE Remote
// Brand: Airwell, Model: RC08B remote
// Brand: Kastron, Model: RG57A7/BGEF Inverter remote
Expand Down
1 change: 1 addition & 0 deletions src/ir_Daikin.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
// Brand: Daikin, Model: BRC4M150W16 remote (DAIKIN200)
// Brand: Daikin, Model: FTXM20R5V1B A/C (DAIKIN312)
// Brand: Daikin, Model: ARC466A67 remote (DAIKIN312)
// Brand: Daikin, Model: ARC443A5 remote (DAIKIN)

#ifndef IR_DAIKIN_H_
#define IR_DAIKIN_H_
Expand Down
4 changes: 3 additions & 1 deletion src/ir_Gree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ void IRGreeAC::setSwingVertical(const bool automatic, const uint8_t position) {
uint8_t new_position = position;
if (!automatic) {
switch (position) {
case kGreeSwingLastPos:
case kGreeSwingUp:
case kGreeSwingMiddleUp:
case kGreeSwingMiddle:
Expand Down Expand Up @@ -503,6 +504,7 @@ uint8_t IRGreeAC::convertFan(const stdAc::fanspeed_t speed) {
/// @return The native equivalent of the enum.
uint8_t IRGreeAC::convertSwingV(const stdAc::swingv_t swingv) {
switch (swingv) {
case stdAc::swingv_t::kOff: return kGreeSwingLastPos;
case stdAc::swingv_t::kHighest: return kGreeSwingUp;
case stdAc::swingv_t::kHigh: return kGreeSwingMiddleUp;
case stdAc::swingv_t::kMiddle: return kGreeSwingMiddle;
Expand Down Expand Up @@ -562,7 +564,7 @@ stdAc::swingv_t IRGreeAC::toCommonSwingV(const uint8_t pos) {
case kGreeSwingMiddle: return stdAc::swingv_t::kMiddle;
case kGreeSwingMiddleDown: return stdAc::swingv_t::kLow;
case kGreeSwingDown: return stdAc::swingv_t::kLowest;
default: return stdAc::swingv_t::kAuto;
default: return stdAc::swingv_t::kOff;
}
}

Expand Down
5 changes: 5 additions & 0 deletions test/ir_Gree_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,11 @@ TEST(TestGreeClass, toCommon) {
ASSERT_FALSE(ac.toCommon().filter);
ASSERT_FALSE(ac.toCommon().beep);
ASSERT_EQ(-1, ac.toCommon().clock);

// Test kGreeSwingLastPos following the pattern in IRac::gree().
ASSERT_EQ(kGreeSwingLastPos, ac.convertSwingV(stdAc::swingv_t::kOff));
ac.setSwingVertical(false, kGreeSwingLastPos);
ASSERT_EQ(stdAc::swingv_t::kOff, ac.toCommon().swingv);
}

TEST(TestGreeClass, Issue814Power) {
Expand Down
11 changes: 7 additions & 4 deletions tools/auto_analyse_raw_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def add_data_code(self, bin_str, name="", footer=True):
code.append(f" // Data Section #{self.section_count}")
code.append(f" // e.g. data = 0x{int(bin_str, 2):X}, nbits = {nbits}")
code.append(f" sendData(k{name}BitMark, k{name}OneSpace, k{name}BitMark,"
f" k{name}ZeroSpace, send_data, {nbits}, true);")
f" k{name}ZeroSpace, send_data, {nbits}, k{name}MsbFirst);")
code.append(f" send_data >>= {nbits};")
if footer:
code.append(" // Footer")
Expand All @@ -122,7 +122,8 @@ def add_data_decode_code(self, bin_str, name="", footer=True):
f" // e.g. data_result.data = 0x{int(bin_str, 2):X}, nbits = {nbits}",
f" data_result = matchData(&(results->rawbuf[offset]), {nbits},",
f" k{name}BitMark, k{name}OneSpace,",
f" k{name}BitMark, k{name}ZeroSpace);",
f" k{name}BitMark, k{name}ZeroSpace,",
f" kUseDefTol, kMarkExcess, k{name}MsbFirst);",
" offset += data_result.used;",
" if (data_result.success == false) return false; // Fail",
f" data <<= {nbits}; // Make room for the new bits of data.",
Expand Down Expand Up @@ -163,7 +164,8 @@ def add_data_byte_code(self, bin_str, name="", ambles=None):
f" k{name}BitMark, k{name}ZeroSpace,",
f" {lastmark}, {lastspace},",
f" data + pos, {int(nbytes)}, // Bytes",
f" k{name}Freq, true, kNoRepeat, kDutyDefault);",
f" k{name}Freq, k{name}MsbFirst, kNoRepeat,"
" kDutyDefault);",
f" pos += {int(nbytes)};"
f" // Adjust by how many bytes of data we sent"])
return code
Expand Down Expand Up @@ -198,7 +200,7 @@ def add_data_byte_decode_code(self, bin_str, name="", ambles=None):
f" {firstmark}, {firstspace},",
f" k{name}BitMark, k{name}OneSpace,",
f" k{name}BitMark, k{name}ZeroSpace,",
f" {lastmark}, {lastspace}, true);",
f" {lastmark}, {lastspace}, k{name}MsbFirst);",
" if (used == 0) return false; // We failed to find any data.",
" offset += used; // Adjust for how much of the message we read.",
f" pos += {int(nbytes)};"
Expand Down Expand Up @@ -351,6 +353,7 @@ def dump_constants(message, defines, name="", output=sys.stdout):
defines.append(f"const uint16_t k{name}SpaceGap{count} = {gap};")
defines.append(f"const uint16_t k{name}Freq = 38000; "
"// Hz. (Guessing the most common frequency.)")
defines.append(f"const bool k{name}MsbFirst = true; // default assumption")


def parse_and_report(rawdata_str, margin, gen_code=False, name="",
Expand Down
Loading

0 comments on commit 5dd87d6

Please sign in to comment.