Skip to content

Commit 090ea2e

Browse files
committed
supported FUNIKI remote AC
1 parent dc0fd31 commit 090ea2e

12 files changed

+955
-6
lines changed

src/IRac.cpp

+79
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,9 @@ bool IRac::isProtocolSupported(const decode_type_t protocol) {
373373
#endif
374374
#if SEND_WHIRLPOOL_AC
375375
case decode_type_t::WHIRLPOOL_AC:
376+
#endif
377+
#if SEND_FUNIKI
378+
case decode_type_t::FUNIKI:
376379
#endif
377380
return true;
378381
default:
@@ -1274,7 +1277,56 @@ void IRac::fujitsu(IRFujitsuAC *ac, const fujitsu_ac_remote_model_t model,
12741277
ac->send();
12751278
}
12761279
#endif // SEND_FUJITSU_AC
1280+
#if SEND_FUNIKI
1281+
/// Send a Funiki A/C message with the supplied settings.
1282+
/// @param[in, out] ac A Ptr to an IRFujitsuAC object to use.
1283+
/// @param[in] model The A/C model to use.
1284+
/// @param[in] on The power setting.
1285+
/// @param[in] mode The operation mode setting.
1286+
/// @param[in] celsius Temperature units. True is Celsius, False is Fahrenheit.
1287+
/// @param[in] degrees The temperature setting in degrees.
1288+
/// @param[in] fan The speed setting for the fan.
1289+
/// @param[in] swingv The vertical swing setting.
1290+
/// @param[in] swingh The horizontal swing setting.
1291+
/// @param[in] clock The clock setting.
1292+
/// @param[in] iFeel Whether to enable iFeel (remote temp) mode on the A/C unit.
1293+
/// @param[in] turbo Run the device in turbo/powerful mode.
1294+
/// @param[in] econo Run the device in economical mode.
1295+
/// @param[in] light Turn on the LED/Display mode.
1296+
/// @param[in] clean Turn on the self-cleaning mode. e.g. Mould, dry filters etc
1297+
/// @param[in] sleep Nr. of minutes for sleep mode. <= 0 is Off, > 0 is on.
1298+
void IRac::funiki(IRFunikiAC *ac, const funiki_ac_remote_model_t model,
1299+
const bool on, const stdAc::opmode_t mode, const bool celsius,
1300+
const float degrees, const stdAc::fanspeed_t fan,
1301+
const stdAc::swingv_t swingv, const stdAc::swingh_t swingh,
1302+
const int16_t clock,
1303+
const bool iFeel, const bool turbo, const bool econo,
1304+
const bool light, const bool clean, const int16_t sleep) {
1305+
ac->begin();
1306+
ac->setModel(model);
1307+
ac->setPower(on);
1308+
ac->setMode(ac->convertMode(mode));
1309+
ac->setTemp(degrees, !celsius);
1310+
ac->setFan(ac->convertFan(fan));
1311+
ac->setSwingVertical(swingv == stdAc::swingv_t::kAuto, // Set auto flag.
1312+
ac->convertSwingV(swingv));
1313+
ac->setSleep(sleep >= 0); // Sleep on this A/C is either on or off.
1314+
// No Econo setting available.
1315+
(void)(swingh);
1316+
(void)(iFeel);
1317+
(void)(turbo);
1318+
(void)(econo);
1319+
(void)(light);
1320+
(void)(clean);
12771321

1322+
// No Filter setting available.
1323+
// No Beep setting available.
1324+
// No Quiet setting available.
1325+
// No Clock setting available.
1326+
if (clock >= 0) ac->setClock(clock);
1327+
ac->send();
1328+
}
1329+
#endif // SEND_FUNIKI
12781330
#if SEND_GOODWEATHER
12791331
/// Send a Goodweather A/C message with the supplied settings.
12801332
/// @param[in, out] ac A Ptr to an IRGoodweatherAc object to use.
@@ -3244,6 +3296,18 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) {
32443296
break;
32453297
}
32463298
#endif // SEND_FUJITSU_AC
3299+
#if SEND_FUNIKI
3300+
case FUNIKI:
3301+
{
3302+
IRFunikiAC ac(_pin, (funiki_ac_remote_model_t)send.model, _inverted,
3303+
_modulation);
3304+
funiki(&ac, (funiki_ac_remote_model_t)send.model, send.power, send.mode,
3305+
send.celsius, send.degrees, send.fanspeed, send.swingv, send.swingh,
3306+
send.clock,
3307+
send.turbo, send.econo, send.light, send.clean, send.sleep);
3308+
break;
3309+
}
3310+
#endif // SEND_FUNIKI
32473311
#if SEND_GOODWEATHER
32483312
case GOODWEATHER:
32493313
{
@@ -4215,6 +4279,13 @@ namespace IRAcUtils {
42154279
return ac.toString();
42164280
}
42174281
#endif // DECODE_FUJITSU_AC
4282+
#if DECODE_FUNIKI
4283+
case decode_type_t::FUNIKI: {
4284+
IRFunikiAC ac(kGpioUnused);
4285+
ac.setRaw(result->state);
4286+
return ac.toString();
4287+
}
4288+
#endif // DECODE_FUNIKI
42184289
#if DECODE_GOODWEATHER
42194290
case decode_type_t::GOODWEATHER: {
42204291
IRGoodweatherAc ac(kGpioUnused);
@@ -4716,6 +4787,14 @@ namespace IRAcUtils {
47164787
break;
47174788
}
47184789
#endif // DECODE_FUJITSU_AC
4790+
#if DECODE_FUNIKI
4791+
case decode_type_t::FUNIKI: {
4792+
IRFunikiAC ac(kGpioUnused);
4793+
ac.setRaw(decode->state);
4794+
*result = ac.toCommon();
4795+
break;
4796+
}
4797+
#endif // DECODE_FUNIKI
47194798
#if DECODE_GOODWEATHER
47204799
case decode_type_t::GOODWEATHER: {
47214800
IRGoodweatherAc ac(kGpioUnused);

src/IRac.h

+10-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
#include "ir_Voltas.h"
5151
#include "ir_Whirlpool.h"
5252
#include "ir_York.h"
53-
53+
#include "ir_Funiki.h"
5454
// Constants
5555
const int8_t kGpioUnused = -1; ///< A placeholder for not using an actual GPIO.
5656

@@ -276,6 +276,15 @@ void electra(IRElectraAc *ac,
276276
const bool quiet, const bool turbo, const bool econo,
277277
const bool filter, const bool clean, const int16_t sleep = -1);
278278
#endif // SEND_FUJITSU_AC
279+
#if SEND_FUNIKI
280+
void funiki(IRFunikiAC *ac, const funiki_ac_remote_model_t model,
281+
const bool on, const stdAc::opmode_t mode, const bool celsius,
282+
const float degrees, const stdAc::fanspeed_t fan,
283+
const stdAc::swingv_t swingv, const stdAc::swingh_t swingh,
284+
const int16_t clock,
285+
const bool iFeel, const bool turbo, const bool econo,
286+
const bool light, const bool clean, const int16_t sleep = -1);
287+
#endif // SEND_FUNIKI
279288
#if SEND_GOODWEATHER
280289
void goodweather(IRGoodweatherAc *ac,
281290
const bool on, const stdAc::opmode_t mode,

src/IRrecv.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,10 @@ bool IRrecv::decode(decode_results *results, irparams_t *save,
11851185
DPRINTLN("Attempting York decode");
11861186
if (decodeYork(results, offset, kYorkBits)) return true;
11871187
#endif // DECODE_YORK
1188+
#if DECODE_FUNIKI
1189+
DPRINTLN("Attempting Funiki decode");
1190+
if (decodeFuniki(results, offset)) return true;
1191+
#endif
11881192
// Typically new protocols are added above this line.
11891193
}
11901194
#if DECODE_HASH

src/IRrecv.h

+5
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,11 @@ class IRrecv {
883883
const uint16_t kYorkBits,
884884
const bool strict = true);
885885
#endif // DECODE_YORK
886+
#if DECODE_FUNIKI
887+
bool decodeFuniki(decode_results *results, uint16_t offset = kStartOffset,
888+
const uint16_t nbits = kFunikiBits,
889+
const bool strict = true);
890+
#endif // DECODE_FUNIKI
886891
};
887892

888893
#endif // IRRECV_H_

src/IRremoteESP8266.h

+13-3
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,13 @@
952952
#define SEND_YORK _IR_ENABLE_DEFAULT_
953953
#endif // SEND_YORK
954954

955+
#ifndef DECODE_FUNIKI
956+
#define DECODE_FUNIKI _IR_ENABLE_DEFAULT_
957+
#endif // DECODE_FUNIKI
958+
#ifndef SEND_FUNIKI
959+
#define SEND_FUNIKI _IR_ENABLE_DEFAULT_
960+
#endif // SEND_FUNIKI
961+
955962
#if (DECODE_ARGO || DECODE_DAIKIN || DECODE_FUJITSU_AC || DECODE_GREE || \
956963
DECODE_KELVINATOR || DECODE_MITSUBISHI_AC || DECODE_TOSHIBA_AC || \
957964
DECODE_TROTEC || DECODE_HAIER_AC || DECODE_HITACHI_AC || \
@@ -970,7 +977,7 @@
970977
DECODE_KELON168 || DECODE_HITACHI_AC296 || DECODE_CARRIER_AC128 || \
971978
DECODE_DAIKIN200 || DECODE_HAIER_AC160 || DECODE_TCL96AC || \
972979
DECODE_BOSCH144 || DECODE_SANYO_AC152 || DECODE_DAIKIN312 || \
973-
DECODE_CARRIER_AC84 || DECODE_YORK || \
980+
DECODE_CARRIER_AC84 || DECODE_YORK || DECODE_FUNIKI ||\
974981
false)
975982
// Add any DECODE to the above if it uses result->state (see kStateSizeMax)
976983
// you might also want to add the protocol to hasACState function
@@ -1137,8 +1144,9 @@ enum decode_type_t {
11371144
WOWWEE,
11381145
CARRIER_AC84, // 125
11391146
YORK,
1147+
FUNIKI,
11401148
// Add new entries before this one, and update it to point to the last entry.
1141-
kLastDecodeType = YORK,
1149+
kLastDecodeType = FUNIKI,
11421150
};
11431151

11441152
// Message lengths & required repeat values
@@ -1435,7 +1443,9 @@ const uint16_t kRhossDefaultRepeat = 0;
14351443
const uint16_t kClimaButlerBits = 52;
14361444
const uint16_t kYorkBits = 136;
14371445
const uint16_t kYorkStateLength = 17;
1438-
1446+
const uint16_t kFunikiStateLength = 10;
1447+
const uint16_t kFunikiBits = kFunikiStateLength * 8;
1448+
const uint16_t kFunikiDefaultRepeat = kNoRepeat;
14391449

14401450
// Legacy defines. (Deprecated)
14411451
#define AIWA_RC_T501_BITS kAiwaRcT501Bits

src/IRsend.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,8 @@ uint16_t IRsend::defaultBits(const decode_type_t protocol) {
798798
return kXmpBits;
799799
case YORK:
800800
return kYorkBits;
801+
case FUNIKI:
802+
return kFunikiBits;
801803
// No default amount of bits.
802804
case FUJITSU_AC:
803805
case MWM:
@@ -1434,6 +1436,11 @@ bool IRsend::send(const decode_type_t type, const uint8_t *state,
14341436
sendYork(state, nbytes);
14351437
break;
14361438
#endif // SEND_YORK
1439+
#if SEND_FUNIKI
1440+
case FUNIKI:
1441+
sendFuniki(state, nbytes);
1442+
break;
1443+
#endif // SEND_FUNIKI
14371444
default:
14381445
return false;
14391446
}

src/IRsend.h

+11-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,10 @@ enum fujitsu_ac_remote_model_t {
150150
ARRY4, ///< (5) AR-RY4 (Same as AR-RAH2E but with clean & filter)
151151
ARREW4E, ///< (6) Similar to ARRAH2E, but with different temp config.
152152
};
153-
153+
/// Funiki A/C model numbers
154+
enum funiki_ac_remote_model_t {
155+
UNKOWN = 1, // (1)(Default)
156+
};
154157
/// Gree A/C model numbers
155158
enum gree_ac_remote_model_t {
156159
YAW1F = 1, // (1) Ultimate, EKOKAI, RusClimate (Default)
@@ -885,6 +888,13 @@ class IRsend {
885888
const uint16_t nbytes = kYorkStateLength,
886889
const uint16_t repeat = kNoRepeat);
887890
#endif // SEND_YORK
891+
#if SEND_FUNIKI
892+
// void sendFuniki(const uint64_t data, const uint16_t nbits = kFunikiBits,
893+
// const uint16_t repeat = kFunikiDefaultRepeat);
894+
void sendFuniki(const uint8_t data[],
895+
const uint16_t nbytes = kFunikiStateLength,
896+
const uint16_t repeat = kFunikiDefaultRepeat);
897+
#endif // SEND_FUNIKI
888898

889899
protected:
890900
#ifdef UNIT_TEST

src/IRtext.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,8 @@ IRTEXT_CONST_BLOB_DECL(kAllProtocolNamesStr) {
555555
D_STR_CARRIER_AC84, D_STR_UNSUPPORTED) "\x0"
556556
COND(DECODE_YORK || SEND_YORK,
557557
D_STR_YORK, D_STR_UNSUPPORTED) "\x0"
558+
COND(DECODE_FUNIKI || SEND_FUNIKI,
559+
D_STR_FUNIKI, D_STR_UNSUPPORTED) "\x0"
558560
///< New protocol (macro) strings should be added just above this line.
559561
"\x0" ///< This string requires double null termination.
560562
};

src/IRutils.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ bool hasACState(const decode_type_t protocol) {
184184
case DAIKIN312:
185185
case ELECTRA_AC:
186186
case FUJITSU_AC:
187+
case FUNIKI:
187188
case GREE:
188189
case HAIER_AC:
189190
case HAIER_AC_YRW02:

0 commit comments

Comments
 (0)