Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions src/IRac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "ir_Daikin.h"
#include "ir_Ecoclim.h"
#include "ir_Electra.h"
#include "ir_Eurom.h"
#include "ir_Fujitsu.h"
#include "ir_Haier.h"
#include "ir_Hitachi.h"
Expand Down Expand Up @@ -244,6 +245,9 @@ bool IRac::isProtocolSupported(const decode_type_t protocol) {
#if SEND_ELECTRA_AC
case decode_type_t::ELECTRA_AC:
#endif
#if SEND_EUROM
case decode_type_t::EUROM:
#endif
#if SEND_FUJITSU_AC
case decode_type_t::FUJITSU_AC:
#endif
Expand Down Expand Up @@ -1211,6 +1215,31 @@ void IRac::electra(IRElectraAc *ac,
}
#endif // SEND_ELECTRA_AC

#if SEND_EUROM
/// Send an Eurom A/C message with the supplied settings.
/// @param[in, out] ac A Ptr to an IREuromAc object to use.
/// @param[in] power The power setting.
/// @param[in] mode The operation mode setting.
/// @param[in] degrees The temperature setting in degrees, normally Celsius.
/// @param[in] fahrenheit If the given temperature is in Fahrenheit instead.
/// @param[in] fan The speed setting for the fan.
/// @param[in] swingv The swing setting.
/// @param[in] sleep The sleep mode setting.
void IRac::eurom(IREuromAc *ac, const bool power, const stdAc::opmode_t mode,
const float degrees, const bool fahrenheit,
const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv,
const bool sleep) {
ac->begin();
ac->setPower(power);
ac->setMode(ac->convertMode(mode));
ac->setTemp(degrees, fahrenheit);
ac->setFan(ac->convertFan(fan));
ac->setSwing(ac->convertSwing(swingv));
ac->setSleep(sleep);
ac->send();
}
#endif // SEND_EUROM

#if SEND_FUJITSU_AC
/// Send a Fujitsu A/C message with the supplied settings.
/// @param[in, out] ac A Ptr to an IRFujitsuAC object to use.
Expand Down Expand Up @@ -3239,6 +3268,15 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) {
break;
}
#endif // SEND_ELECTRA_AC
#if SEND_EUROM
case EUROM:
{
IREuromAc ac(_pin, _inverted, _modulation);
eurom(&ac, send.power, send.mode, send.degrees, !send.celsius,
send.fanspeed, send.swingv, send.sleep);
break;
}
#endif // SEND_EUROM
#if SEND_FUJITSU_AC
case FUJITSU_AC:
{
Expand Down Expand Up @@ -4215,6 +4253,13 @@ String resultAcToString(const decode_results * const result) {
return ac.toString();
}
#endif // DECODE_ELECTRA_AC
#if DECODE_EUROM
case decode_type_t::EUROM: {
IREuromAc ac(kGpioUnused);
ac.setRaw(result->state);
return ac.toString();
}
#endif // DECODE_EUROM
#if DECODE_FUJITSU_AC
case decode_type_t::FUJITSU_AC: {
IRFujitsuAC ac(kGpioUnused);
Expand Down Expand Up @@ -4715,6 +4760,14 @@ bool decodeToState(const decode_results *decode, stdAc::state_t *result,
break;
}
#endif // DECODE_ELECTRA_AC
#if DECODE_EUROM
case decode_type_t::EUROM: {
IREuromAc ac(kGpioUnused);
ac.setRaw(decode->state);
*result = ac.toCommon();
break;
}
#endif // DECODE_EUROM
#if DECODE_FUJITSU_AC
case decode_type_t::FUJITSU_AC: {
IRFujitsuAC ac(kGpioUnused);
Expand Down
7 changes: 7 additions & 0 deletions 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_Eurom.h"
#include "ir_Goodweather.h"
#include "ir_Gree.h"
#include "ir_Haier.h"
Expand Down Expand Up @@ -267,6 +268,12 @@ void electra(IRElectraAc *ac,
const stdAc::swingh_t swingh, const bool iFeel, const bool quiet,
const bool turbo, const bool lighttoggle, const bool clean);
#endif // SEND_ELECTRA_AC
#if SEND_EUROM
void eurom(IREuromAc *ac, const bool power, const stdAc::opmode_t mode,
const float degrees, const bool fahrenheit,
const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv,
const bool sleep);
#endif // SEND_EUROM
#if SEND_FUJITSU_AC
void fujitsu(IRFujitsuAC *ac, const fujitsu_ac_remote_model_t model,
const bool on, const stdAc::opmode_t mode,
Expand Down
4 changes: 4 additions & 0 deletions src/IRrecv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1189,6 +1189,10 @@ bool IRrecv::decode(decode_results *results, irparams_t *save,
DPRINTLN("Attempting BluestarHeavy decode");
if (decodeBluestarHeavy(results, offset, kBluestarHeavyBits)) return true;
#endif // DECODE_BLUESTARHEAVY
#if DECODE_EUROM
DPRINTLN("Attempting Eurom decode");
if (decodeEurom(results, offset, kEuromBits)) return true;
#endif // DECODE_EUROM
// Typically new protocols are added above this line.
}
#if DECODE_HASH
Expand Down
6 changes: 6 additions & 0 deletions src/IRrecv.h
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,12 @@ class IRrecv {
const uint16_t nbits = kBluestarHeavyBits,
const bool strict = true);
#endif // DECODE_BLUESTARHEAVY
#if DECODE_EUROM
bool decodeEurom(decode_results *results,
uint16_t offset = kStartOffset,
const uint16_t nbits = kEuromBits,
const bool strict = true);
#endif // DECODE_EUROM
};

#endif // IRRECV_H_
13 changes: 12 additions & 1 deletion src/IRremoteESP8266.h
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,13 @@
#define SEND_BLUESTARHEAVY _IR_ENABLE_DEFAULT_
#endif // SEND_BLUESTARHEAVY

#ifndef DECODE_EUROM
#define DECODE_EUROM _IR_ENABLE_DEFAULT_
#endif // DECODE_EUROM
#ifndef SEND_EUROM
#define SEND_EUROM _IR_ENABLE_DEFAULT_
#endif // SEND_EUROM

#if (DECODE_ARGO || DECODE_DAIKIN || DECODE_FUJITSU_AC || DECODE_GREE || \
DECODE_KELVINATOR || DECODE_MITSUBISHI_AC || DECODE_TOSHIBA_AC || \
DECODE_TROTEC || DECODE_HAIER_AC || DECODE_HITACHI_AC || \
Expand All @@ -978,6 +985,7 @@
DECODE_DAIKIN200 || DECODE_HAIER_AC160 || DECODE_TCL96AC || \
DECODE_BOSCH144 || DECODE_SANYO_AC152 || DECODE_DAIKIN312 || \
DECODE_CARRIER_AC84 || DECODE_YORK || DECODE_BLUESTARHEAVY || \
DECODE_EUROM || \
false)
// Add any DECODE to the above if it uses result->state (see kStateSizeMax)
// you might also want to add the protocol to hasACState function
Expand Down Expand Up @@ -1145,8 +1153,9 @@ enum decode_type_t {
CARRIER_AC84, // 125
YORK,
BLUESTARHEAVY,
EUROM,
// Add new entries before this one, and update it to point to the last entry.
kLastDecodeType = BLUESTARHEAVY,
kLastDecodeType = EUROM,
};

// Message lengths & required repeat values
Expand Down Expand Up @@ -1445,6 +1454,8 @@ const uint16_t kRhossDefaultRepeat = 0;
const uint16_t kClimaButlerBits = 52;
const uint16_t kYorkBits = 136;
const uint16_t kYorkStateLength = 17;
const uint16_t kEuromStateLength = 12;
const uint16_t kEuromBits = kEuromStateLength * 8;

// Legacy defines. (Deprecated)
#define AIWA_RC_T501_BITS kAiwaRcT501Bits
Expand Down
7 changes: 7 additions & 0 deletions src/IRsend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,8 @@ uint16_t IRsend::defaultBits(const decode_type_t protocol) {
return kDaikin64Bits;
case ELECTRA_AC:
return kElectraAcBits;
case EUROM:
return kEuromBits;
case GREE:
return kGreeBits;
case HAIER_AC:
Expand Down Expand Up @@ -1245,6 +1247,11 @@ bool IRsend::send(const decode_type_t type, const uint8_t *state,
sendElectraAC(state, nbytes);
break;
#endif // SEND_ELECTRA_AC
#if SEND_EUROM
case EUROM:
sendEurom(state, nbytes);
break;
#endif // SEND_EUROM
#if SEND_FUJITSU_AC
case FUJITSU_AC:
sendFujitsuAC(state, nbytes);
Expand Down
5 changes: 5 additions & 0 deletions src/IRsend.h
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,11 @@ class IRsend {
const uint16_t nbytes = kBluestarHeavyStateLength,
const uint16_t repeat = kNoRepeat);
#endif // SEND_BLUESTARHEAVY
#if SEND_EUROM
void sendEurom(const uint8_t data[],
const uint16_t nbytes = kEuromStateLength,
const uint16_t repeat = kNoRepeat);
#endif // SEND_EUROM

protected:
#ifdef UNIT_TEST
Expand Down
2 changes: 2 additions & 0 deletions src/IRtext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,8 @@ IRTEXT_CONST_BLOB_DECL(kAllProtocolNamesStr) {
D_STR_YORK, D_STR_UNSUPPORTED) "\x0"
COND(DECODE_BLUESTARHEAVY || SEND_BLUESTARHEAVY,
D_STR_BLUESTARHEAVY, D_STR_UNSUPPORTED) "\x0"
COND(DECODE_EUROM || SEND_EUROM,
D_STR_EUROM, D_STR_UNSUPPORTED) "\x0"
///< New protocol (macro) strings should be added just above this line.
"\x0" ///< This string requires double null termination.
};
Expand Down
1 change: 1 addition & 0 deletions src/IRutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ bool hasACState(const decode_type_t protocol) {
case DAIKIN216:
case DAIKIN312:
case ELECTRA_AC:
case EUROM:
case FUJITSU_AC:
case GREE:
case HAIER_AC:
Expand Down
Loading