Skip to content

Commit

Permalink
fix: build tests
Browse files Browse the repository at this point in the history
fix: code cleanup and formatting
fix: test build
  • Loading branch information
StellaLupus committed Aug 10, 2024
1 parent b198a53 commit a9e750c
Show file tree
Hide file tree
Showing 11 changed files with 449 additions and 398 deletions.
16 changes: 9 additions & 7 deletions src/IRac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ bool IRac::isProtocolSupported(const decode_type_t protocol) {
#if SEND_ELECTRA_AC
case decode_type_t::ELECTRA_AC:
#endif
#if SEND_ELECTROLUX_AC
case decode_type_t::ELECTROLUX_AC:
#endif // SEND_ELECTROLUX_AC
#if SEND_FUJITSU_AC
case decode_type_t::FUJITSU_AC:
#endif
Expand Down Expand Up @@ -375,9 +378,6 @@ bool IRac::isProtocolSupported(const decode_type_t protocol) {
#if SEND_WHIRLPOOL_AC
case decode_type_t::WHIRLPOOL_AC:
#endif
#if SEND_ELECTROLUX_AC
case decode_type_t::ELETROLUX_AC:
#endif // SEND_ELECTROLUX_AC
return true;
default:
return false;
Expand Down Expand Up @@ -3678,10 +3678,12 @@ 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, send.celsius, send.degrees, send.fanspeed, send.quiet);
electrolux(&ac, send.power, send.mode,
send.celsius, send.degrees,
send.fanspeed, send.quiet);
break;
}
#endif // SEND_ELECTROLUX_AC
Expand Down Expand Up @@ -4565,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 @@ -5116,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
2 changes: 1 addition & 1 deletion src/IRac.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "ir_Fujitsu.h"
#include "ir_Ecoclim.h"
#include "ir_Electra.h"
#include "ir_Electrolux.h"
#include "ir_Goodweather.h"
#include "ir_Gree.h"
#include "ir_Haier.h"
Expand Down Expand Up @@ -50,7 +51,6 @@
#include "ir_Voltas.h"
#include "ir_Whirlpool.h"
#include "ir_York.h"
#include "ir_Electrolux.h"

// Constants
const int8_t kGpioUnused = -1; ///< A placeholder for not using an actual GPIO.
Expand Down
2 changes: 1 addition & 1 deletion src/IRrecv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ bool IRrecv::decode(decode_results *results, irparams_t *save,
#if DECODE_ELECTROLUX_AC
DPRINTLN("Attempting Electrolux AC decode");
if (decodeElectroluxAc(results, offset)) return true;
#endif //DECODE_ELECTROLUX_AC
#endif // DECODE_ELECTROLUX_AC
// Typically new protocols are added above this line.
}
#if DECODE_HASH
Expand Down
9 changes: 5 additions & 4 deletions src/IRrecv.h
Original file line number Diff line number Diff line change
Expand Up @@ -890,10 +890,11 @@ class IRrecv {
const bool strict = true);
#endif // DECODE_BLUESTARHEAVY
#if DECODE_ELECTROLUX_AC
bool decodeElectroluxAc(decode_results *results, uint16_t offset = kStartOffset,
const uint16_t nbits = kElectroluxAcBits,
const bool strict = true);
#endif // DECODE_ELECTROLUX_AC
bool decodeElectroluxAc(decode_results *results,
uint16_t offset = kStartOffset,
const uint16_t nbits = kElectroluxAcBits,
const bool strict = true);
#endif // DECODE_ELECTROLUX_AC
};

#endif // IRRECV_H_
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
Loading

0 comments on commit a9e750c

Please sign in to comment.