Skip to content

Commit 8a20c90

Browse files
committed
Add support for the Eurom A/C protocol
1 parent 3390e72 commit 8a20c90

File tree

13 files changed

+1205
-1
lines changed

13 files changed

+1205
-1
lines changed

src/IRac.cpp

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "ir_Daikin.h"
3535
#include "ir_Ecoclim.h"
3636
#include "ir_Electra.h"
37+
#include "ir_Eurom.h"
3738
#include "ir_Fujitsu.h"
3839
#include "ir_Haier.h"
3940
#include "ir_Hitachi.h"
@@ -244,6 +245,9 @@ bool IRac::isProtocolSupported(const decode_type_t protocol) {
244245
#if SEND_ELECTRA_AC
245246
case decode_type_t::ELECTRA_AC:
246247
#endif
248+
#if SEND_EUROM
249+
case decode_type_t::EUROM:
250+
#endif
247251
#if SEND_FUJITSU_AC
248252
case decode_type_t::FUJITSU_AC:
249253
#endif
@@ -1211,6 +1215,31 @@ void IRac::electra(IRElectraAc *ac,
12111215
}
12121216
#endif // SEND_ELECTRA_AC
12131217

1218+
#if SEND_EUROM
1219+
/// Send an Eurom A/C message with the supplied settings.
1220+
/// @param[in, out] ac A Ptr to an IREuromAc object to use.
1221+
/// @param[in] power The power setting.
1222+
/// @param[in] mode The operation mode setting.
1223+
/// @param[in] degrees The temperature setting in degrees, normally Celsius.
1224+
/// @param[in] fahrenheit If the given temperature is in Fahrenheit instead.
1225+
/// @param[in] fan The speed setting for the fan.
1226+
/// @param[in] swingv The swing setting.
1227+
/// @param[in] sleep The sleep mode setting.
1228+
void IRac::eurom(IREuromAc *ac, const bool power, const stdAc::opmode_t mode,
1229+
const float degrees, const bool fahrenheit,
1230+
const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv,
1231+
const bool sleep) {
1232+
ac->begin();
1233+
ac->setPower(power);
1234+
ac->setMode(ac->convertMode(mode));
1235+
ac->setTemp(degrees, fahrenheit);
1236+
ac->setFan(ac->convertFan(fan));
1237+
ac->setSwing(ac->convertSwing(swingv));
1238+
ac->setSleep(sleep);
1239+
ac->send();
1240+
}
1241+
#endif // SEND_EUROM
1242+
12141243
#if SEND_FUJITSU_AC
12151244
/// Send a Fujitsu A/C message with the supplied settings.
12161245
/// @param[in, out] ac A Ptr to an IRFujitsuAC object to use.
@@ -3239,6 +3268,15 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) {
32393268
break;
32403269
}
32413270
#endif // SEND_ELECTRA_AC
3271+
#if SEND_EUROM
3272+
case EUROM:
3273+
{
3274+
IREuromAc ac(_pin, _inverted, _modulation);
3275+
eurom(&ac, send.power, send.mode, send.degrees, !send.celsius,
3276+
send.fanspeed, send.swingv, send.sleep);
3277+
break;
3278+
}
3279+
#endif // SEND_EUROM
32423280
#if SEND_FUJITSU_AC
32433281
case FUJITSU_AC:
32443282
{
@@ -4215,6 +4253,13 @@ String resultAcToString(const decode_results * const result) {
42154253
return ac.toString();
42164254
}
42174255
#endif // DECODE_ELECTRA_AC
4256+
#if DECODE_EUROM
4257+
case decode_type_t::EUROM: {
4258+
IREuromAc ac(kGpioUnused);
4259+
ac.setRaw(result->state);
4260+
return ac.toString();
4261+
}
4262+
#endif // DECODE_EUROM
42184263
#if DECODE_FUJITSU_AC
42194264
case decode_type_t::FUJITSU_AC: {
42204265
IRFujitsuAC ac(kGpioUnused);
@@ -4715,6 +4760,14 @@ bool decodeToState(const decode_results *decode, stdAc::state_t *result,
47154760
break;
47164761
}
47174762
#endif // DECODE_ELECTRA_AC
4763+
#if DECODE_EUROM
4764+
case decode_type_t::EUROM: {
4765+
IREuromAc ac(kGpioUnused);
4766+
ac.setRaw(decode->state);
4767+
*result = ac.toCommon();
4768+
break;
4769+
}
4770+
#endif // DECODE_EUROM
47184771
#if DECODE_FUJITSU_AC
47194772
case decode_type_t::FUJITSU_AC: {
47204773
IRFujitsuAC ac(kGpioUnused);

src/IRac.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "ir_Fujitsu.h"
2323
#include "ir_Ecoclim.h"
2424
#include "ir_Electra.h"
25+
#include "ir_Eurom.h"
2526
#include "ir_Goodweather.h"
2627
#include "ir_Gree.h"
2728
#include "ir_Haier.h"
@@ -267,6 +268,12 @@ void electra(IRElectraAc *ac,
267268
const stdAc::swingh_t swingh, const bool iFeel, const bool quiet,
268269
const bool turbo, const bool lighttoggle, const bool clean);
269270
#endif // SEND_ELECTRA_AC
271+
#if SEND_EUROM
272+
void eurom(IREuromAc *ac, const bool power, const stdAc::opmode_t mode,
273+
const float degrees, const bool fahrenheit,
274+
const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv,
275+
const bool sleep);
276+
#endif // SEND_EUROM
270277
#if SEND_FUJITSU_AC
271278
void fujitsu(IRFujitsuAC *ac, const fujitsu_ac_remote_model_t model,
272279
const bool on, const stdAc::opmode_t mode,

src/IRrecv.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,10 @@ bool IRrecv::decode(decode_results *results, irparams_t *save,
11891189
DPRINTLN("Attempting BluestarHeavy decode");
11901190
if (decodeBluestarHeavy(results, offset, kBluestarHeavyBits)) return true;
11911191
#endif // DECODE_BLUESTARHEAVY
1192+
#if DECODE_EUROM
1193+
DPRINTLN("Attempting Eurom decode");
1194+
if (decodeEurom(results, offset, kEuromBits)) return true;
1195+
#endif // DECODE_EUROM
11921196
// Typically new protocols are added above this line.
11931197
}
11941198
#if DECODE_HASH

src/IRrecv.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,12 @@ class IRrecv {
889889
const uint16_t nbits = kBluestarHeavyBits,
890890
const bool strict = true);
891891
#endif // DECODE_BLUESTARHEAVY
892+
#if DECODE_EUROM
893+
bool decodeEurom(decode_results *results,
894+
uint16_t offset = kStartOffset,
895+
const uint16_t nbits = kEuromBits,
896+
const bool strict = true);
897+
#endif // DECODE_EUROM
892898
};
893899

894900
#endif // IRRECV_H_

src/IRremoteESP8266.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,13 @@
959959
#define SEND_BLUESTARHEAVY _IR_ENABLE_DEFAULT_
960960
#endif // SEND_BLUESTARHEAVY
961961

962+
#ifndef DECODE_EUROM
963+
#define DECODE_EUROM _IR_ENABLE_DEFAULT_
964+
#endif // DECODE_EUROM
965+
#ifndef SEND_EUROM
966+
#define SEND_EUROM _IR_ENABLE_DEFAULT_
967+
#endif // SEND_EUROM
968+
962969
#if (DECODE_ARGO || DECODE_DAIKIN || DECODE_FUJITSU_AC || DECODE_GREE || \
963970
DECODE_KELVINATOR || DECODE_MITSUBISHI_AC || DECODE_TOSHIBA_AC || \
964971
DECODE_TROTEC || DECODE_HAIER_AC || DECODE_HITACHI_AC || \
@@ -978,6 +985,7 @@
978985
DECODE_DAIKIN200 || DECODE_HAIER_AC160 || DECODE_TCL96AC || \
979986
DECODE_BOSCH144 || DECODE_SANYO_AC152 || DECODE_DAIKIN312 || \
980987
DECODE_CARRIER_AC84 || DECODE_YORK || DECODE_BLUESTARHEAVY || \
988+
DECODE_EUROM || \
981989
false)
982990
// Add any DECODE to the above if it uses result->state (see kStateSizeMax)
983991
// you might also want to add the protocol to hasACState function
@@ -1145,8 +1153,9 @@ enum decode_type_t {
11451153
CARRIER_AC84, // 125
11461154
YORK,
11471155
BLUESTARHEAVY,
1156+
EUROM,
11481157
// Add new entries before this one, and update it to point to the last entry.
1149-
kLastDecodeType = BLUESTARHEAVY,
1158+
kLastDecodeType = EUROM,
11501159
};
11511160

11521161
// Message lengths & required repeat values
@@ -1445,6 +1454,8 @@ const uint16_t kRhossDefaultRepeat = 0;
14451454
const uint16_t kClimaButlerBits = 52;
14461455
const uint16_t kYorkBits = 136;
14471456
const uint16_t kYorkStateLength = 17;
1457+
const uint16_t kEuromStateLength = 12;
1458+
const uint16_t kEuromBits = kEuromStateLength * 8;
14481459

14491460
// Legacy defines. (Deprecated)
14501461
#define AIWA_RC_T501_BITS kAiwaRcT501Bits

src/IRsend.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,8 @@ uint16_t IRsend::defaultBits(const decode_type_t protocol) {
721721
return kDaikin64Bits;
722722
case ELECTRA_AC:
723723
return kElectraAcBits;
724+
case EUROM:
725+
return kEuromBits;
724726
case GREE:
725727
return kGreeBits;
726728
case HAIER_AC:
@@ -1245,6 +1247,11 @@ bool IRsend::send(const decode_type_t type, const uint8_t *state,
12451247
sendElectraAC(state, nbytes);
12461248
break;
12471249
#endif // SEND_ELECTRA_AC
1250+
#if SEND_EUROM
1251+
case EUROM:
1252+
sendEurom(state, nbytes);
1253+
break;
1254+
#endif // SEND_EUROM
12481255
#if SEND_FUJITSU_AC
12491256
case FUJITSU_AC:
12501257
sendFujitsuAC(state, nbytes);

src/IRsend.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,11 @@ class IRsend {
899899
const uint16_t nbytes = kBluestarHeavyStateLength,
900900
const uint16_t repeat = kNoRepeat);
901901
#endif // SEND_BLUESTARHEAVY
902+
#if SEND_EUROM
903+
void sendEurom(const uint8_t data[],
904+
const uint16_t nbytes = kEuromStateLength,
905+
const uint16_t repeat = kNoRepeat);
906+
#endif // SEND_EUROM
902907

903908
protected:
904909
#ifdef UNIT_TEST

src/IRtext.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,8 @@ IRTEXT_CONST_BLOB_DECL(kAllProtocolNamesStr) {
561561
D_STR_YORK, D_STR_UNSUPPORTED) "\x0"
562562
COND(DECODE_BLUESTARHEAVY || SEND_BLUESTARHEAVY,
563563
D_STR_BLUESTARHEAVY, D_STR_UNSUPPORTED) "\x0"
564+
COND(DECODE_EUROM || SEND_EUROM,
565+
D_STR_EUROM, D_STR_UNSUPPORTED) "\x0"
564566
///< New protocol (macro) strings should be added just above this line.
565567
"\x0" ///< This string requires double null termination.
566568
};

src/IRutils.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ bool hasACState(const decode_type_t protocol) {
184184
case DAIKIN216:
185185
case DAIKIN312:
186186
case ELECTRA_AC:
187+
case EUROM:
187188
case FUJITSU_AC:
188189
case GREE:
189190
case HAIER_AC:

0 commit comments

Comments
 (0)