Skip to content

Commit

Permalink
fix: build tests
Browse files Browse the repository at this point in the history
  • Loading branch information
StellaLupus committed Aug 10, 2024
1 parent d6bf0c6 commit ecccc3a
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/IRac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ bool IRac::isProtocolSupported(const decode_type_t protocol) {
case decode_type_t::ELECTRA_AC:
#endif
#if SEND_ELECTROLUX_AC
case decode_type_t::ELETROLUX_AC:
case decode_type_t::ELECTROLUX_AC:
#endif // SEND_ELECTROLUX_AC
#if SEND_FUJITSU_AC
case decode_type_t::FUJITSU_AC:
Expand Down Expand Up @@ -3678,7 +3678,7 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) {
}
#endif // SEND_TRANSCOLD_AC
#if SEND_ELECTROLUX_AC
case ELETROLUX_AC:
case ELECTROLUX_AC:
{
IRElectroluxAc ac(_pin, _inverted, _modulation);
electrolux(&ac, send.power, send.mode,
Expand Down Expand Up @@ -4567,7 +4567,7 @@ namespace IRAcUtils {
}
#endif // DECODE_YORK
#if DECODE_ELECTROLUX_AC
case decode_type_t::ELETROLUX_AC: {
case decode_type_t::ELECTROLUX_AC: {
IRElectroluxAc ac(kGpioUnused);
ac.setRaw(result->value); // ELETROLUX_AC uses value instead of state.
return ac.toString();
Expand Down Expand Up @@ -5118,7 +5118,7 @@ namespace IRAcUtils {
}
#endif // DECODE_YORK
#if DECODE_ELECTROLUX_AC
case decode_type_t::ELETROLUX_AC: {
case decode_type_t::ELECTROLUX_AC: {
IRCarrierAc64 ac(kGpioUnused);
ac.setRaw(decode->value); // Uses value instead of state.
*result = ac.toCommon();
Expand Down
4 changes: 2 additions & 2 deletions src/IRremoteESP8266.h
Original file line number Diff line number Diff line change
Expand Up @@ -1152,9 +1152,9 @@ enum decode_type_t {
CARRIER_AC84, // 125
YORK,
BLUESTARHEAVY,
ELETROLUX_AC,
ELECTROLUX_AC,
// Add new entries before this one, and update it to point to the last entry.
kLastDecodeType = ELETROLUX_AC,
kLastDecodeType = ELECTROLUX_AC,
};

// Message lengths & required repeat values
Expand Down
7 changes: 7 additions & 0 deletions src/IRsend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ uint16_t IRsend::minRepeats(const decode_type_t protocol) {
case COOLIX:
case COOLIX48:
case ELITESCREENS:
case ELECTROLUX_AC:
case GICABLE:
case INAX:
case MIDEA24:
Expand Down Expand Up @@ -646,6 +647,7 @@ uint16_t IRsend::defaultBits(const decode_type_t protocol) {
case ARRIS:
case CARRIER_AC:
case ELITESCREENS:
case ELECTROLUX_AC:
case EPSON:
case NEC:
case NEC_LIKE:
Expand Down Expand Up @@ -915,6 +917,11 @@ bool IRsend::send(const decode_type_t type, const uint64_t data,
sendEpson(data, nbits, min_repeat);
break;
#endif
#if SEND_ELECTROLUX_AC
case ELECTROLUX_AC:
sendElectroluxAc(data, nbits, min_repeat);
break;
#endif
#if SEND_GICABLE
case GICABLE:
sendGICable(data, nbits, min_repeat);
Expand Down
4 changes: 2 additions & 2 deletions src/ir_Electrolux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ bool IRrecv::decodeElectroluxAc(
return false;

// Success
results->decode_type = decode_type_t::ELETROLUX_AC;
results->decode_type = decode_type_t::ELECTROLUX_AC;
results->bits = nbits;
results->value = data;
results->command = data & 0xFFF;
Expand Down Expand Up @@ -373,7 +373,7 @@ stdAc::state_t IRElectroluxAc::toCommon(const stdAc::state_t *prev) const {
// e.g. Any setting that toggles should probably go here.
result.power = false;
}
result.protocol = ELETROLUX_AC;
result.protocol = ELECTROLUX_AC;
result.power = _.Power;
result.mode = toCommonMode(_.Mode);
result.celsius = !getTempModeFahrenheit();
Expand Down
19 changes: 19 additions & 0 deletions test/ir_Electrolux_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright 2024 Andrey Kravchenko (StellaLupus)

#include "ir_Electrolux.h"
#include "IRac.h"
#include "IRrecv.h"
#include "IRrecv_test.h"
#include "IRsend.h"
#include "IRsend_test.h"
#include "gtest/gtest.h"


TEST(TestUtils, Housekeeping) {
ASSERT_EQ("ELETROLUX_AC", typeToString(decode_type_t::ELECTROLUX_AC));
ASSERT_EQ(decode_type_t::ELECTROLUX_AC, strToDecodeType("ELETROLUX_AC"));
ASSERT_FALSE(hasACState(decode_type_t::ELECTROLUX_AC));
ASSERT_TRUE(IRac::isProtocolSupported(decode_type_t::ELECTROLUX_AC));
ASSERT_EQ(kElectroluxAcBits, IRsend::defaultBits(decode_type_t::ELECTROLUX_AC));
ASSERT_EQ(kElectroluxAcDefaultRepeat, IRsend::minRepeats(decode_type_t::ELECTROLUX_AC));
}

0 comments on commit ecccc3a

Please sign in to comment.