From f0305236dbc431123332afcb5ef5a198ba5c93f8 Mon Sep 17 00:00:00 2001
From: Florian <1technophile@users.noreply.github.com>
Date: Thu, 7 Feb 2019 22:43:02 +0100
Subject: [PATCH] Update IRRemoteESP8266 version to 2.5.5 factorize IR send
signal function between the 2 types of receiving Add new IRRemoteESP8266
protocols replace pins on mega according schema remove unecessaries spaces
---
ZgatewayIR.ino | 853 ++++-----
config_IR.h | 33 +-
lib/IRremoteESP8266/.github/Contributors.md | 2 +
lib/IRremoteESP8266/.gitignore | 4 +
lib/IRremoteESP8266/.gitmodules | 1 +
lib/IRremoteESP8266/.travis.yml | 11 +-
lib/IRremoteESP8266/README.md | 22 +-
lib/IRremoteESP8266/ReleaseNotes.md | 120 ++
.../ControlSamsungAC/ControlSamsungAC.ino | 99 +
.../examples/ControlSamsungAC/platformio.ini | 17 +
.../examples/IRGCSendDemo/IRGCSendDemo.ino | 21 +-
.../examples/IRGCTCPServer/IRGCTCPServer.ino | 8 +-
.../examples/IRMQTTServer/IRMQTTServer.ino | 753 ++++++--
.../examples/IRMQTTServer/platformio.ini | 2 +-
.../examples/IRServer/IRServer.ino | 14 +-
.../examples/IRrecvDemo/IRrecvDemo.ino | 8 +-
.../examples/IRrecvDump/IRrecvDump.ino | 4 +-
.../examples/IRrecvDumpV2/IRrecvDumpV2.ino | 154 +-
.../examples/IRsendDemo/IRsendDemo.ino | 25 +-
.../IRsendProntoDemo/IRsendProntoDemo.ino | 6 +-
.../JVCPanasonicSendDemo.ino | 22 +-
.../examples/LGACSend/LGACSend.ino | 10 +-
.../examples/LGACSend/platformio.ini | 17 +
.../examples/TurnOnArgoAC/TurnOnArgoAC.ino | 20 +-
.../TurnOnDaikinAC/TurnOnDaikinAC.ino | 30 +-
.../TurnOnFujitsuAC/TurnOnFujitsuAC.ino | 32 +-
.../TurnOnKelvinatorAC/TurnOnKelvinatorAC.ino | 43 +-
.../TurnOnMitsubishiAC/TurnOnMitsubishiAC.ino | 31 +-
.../TurnOnToshibaAC/TurnOnToshibaAC.ino | 28 +-
.../TurnOnTrotecAC/TurnOnTrotecAC.ino | 18 +-
lib/IRremoteESP8266/keywords.txt | 1673 ++++++++++++-----
lib/IRremoteESP8266/library.json | 2 +-
lib/IRremoteESP8266/library.properties | 2 +-
lib/IRremoteESP8266/src/IRrecv.cpp | 303 +--
lib/IRremoteESP8266/src/IRrecv.h | 242 ++-
lib/IRremoteESP8266/src/IRremoteESP8266.h | 473 +++--
lib/IRremoteESP8266/src/IRsend.cpp | 163 +-
lib/IRremoteESP8266/src/IRsend.h | 231 ++-
lib/IRremoteESP8266/src/IRtimer.cpp | 10 +-
lib/IRremoteESP8266/src/IRutils.cpp | 359 +++-
lib/IRremoteESP8266/src/IRutils.h | 7 +
lib/IRremoteESP8266/src/ir_Aiwa.cpp | 37 +-
lib/IRremoteESP8266/src/ir_Argo.cpp | 90 +-
lib/IRremoteESP8266/src/ir_Argo.h | 72 +-
lib/IRremoteESP8266/src/ir_Carrier.cpp | 53 +-
lib/IRremoteESP8266/src/ir_Coolix.cpp | 351 +++-
lib/IRremoteESP8266/src/ir_Coolix.h | 140 ++
lib/IRremoteESP8266/src/ir_Daikin.cpp | 1030 ++++++++--
lib/IRremoteESP8266/src/ir_Daikin.h | 330 +++-
lib/IRremoteESP8266/src/ir_Denon.cpp | 76 +-
lib/IRremoteESP8266/src/ir_Dish.cpp | 67 +-
lib/IRremoteESP8266/src/ir_Electra.cpp | 112 ++
lib/IRremoteESP8266/src/ir_Fujitsu.cpp | 298 ++-
lib/IRremoteESP8266/src/ir_Fujitsu.h | 85 +-
lib/IRremoteESP8266/src/ir_GICable.cpp | 71 +-
lib/IRremoteESP8266/src/ir_GlobalCache.cpp | 31 +-
lib/IRremoteESP8266/src/ir_Gree.cpp | 262 ++-
lib/IRremoteESP8266/src/ir_Gree.h | 88 +-
lib/IRremoteESP8266/src/ir_Haier.cpp | 674 +++++--
lib/IRremoteESP8266/src/ir_Haier.h | 251 ++-
lib/IRremoteESP8266/src/ir_Hitachi.cpp | 323 +++-
lib/IRremoteESP8266/src/ir_Hitachi.h | 76 +
lib/IRremoteESP8266/src/ir_JVC.cpp | 92 +-
lib/IRremoteESP8266/src/ir_Kelvinator.cpp | 336 ++--
lib/IRremoteESP8266/src/ir_Kelvinator.h | 48 +-
lib/IRremoteESP8266/src/ir_LG.cpp | 218 ++-
lib/IRremoteESP8266/src/ir_Lasertag.cpp | 60 +-
lib/IRremoteESP8266/src/ir_Lutron.cpp | 156 ++
lib/IRremoteESP8266/src/ir_MWM.cpp | 202 ++
lib/IRremoteESP8266/src/ir_Magiquest.cpp | 64 +-
lib/IRremoteESP8266/src/ir_Magiquest.h | 30 +-
lib/IRremoteESP8266/src/ir_Midea.cpp | 211 +--
lib/IRremoteESP8266/src/ir_Midea.h | 60 +-
lib/IRremoteESP8266/src/ir_Mitsubishi.cpp | 524 ++++--
lib/IRremoteESP8266/src/ir_Mitsubishi.h | 76 +-
lib/IRremoteESP8266/src/ir_NEC.cpp | 103 +-
lib/IRremoteESP8266/src/ir_NEC.h | 46 +
lib/IRremoteESP8266/src/ir_Nikai.cpp | 68 +-
lib/IRremoteESP8266/src/ir_Panasonic.cpp | 794 +++++++-
lib/IRremoteESP8266/src/ir_Panasonic.h | 145 ++
lib/IRremoteESP8266/src/ir_Pioneer.cpp | 143 ++
lib/IRremoteESP8266/src/ir_Pronto.cpp | 30 +-
lib/IRremoteESP8266/src/ir_RC5_RC6.cpp | 211 +--
lib/IRremoteESP8266/src/ir_RCMM.cpp | 116 +-
lib/IRremoteESP8266/src/ir_Samsung.cpp | 543 +++++-
lib/IRremoteESP8266/src/ir_Samsung.h | 109 ++
lib/IRremoteESP8266/src/ir_Sanyo.cpp | 99 +-
lib/IRremoteESP8266/src/ir_Sharp.cpp | 110 +-
lib/IRremoteESP8266/src/ir_Sherwood.cpp | 9 +-
lib/IRremoteESP8266/src/ir_Sony.cpp | 75 +-
lib/IRremoteESP8266/src/ir_Toshiba.cpp | 141 +-
lib/IRremoteESP8266/src/ir_Toshiba.h | 39 +-
lib/IRremoteESP8266/src/ir_Trotec.cpp | 105 +-
lib/IRremoteESP8266/src/ir_Trotec.h | 52 +-
lib/IRremoteESP8266/src/ir_Vestel.cpp | 481 +++++
lib/IRremoteESP8266/src/ir_Vestel.h | 160 ++
lib/IRremoteESP8266/src/ir_Whirlpool.cpp | 634 +++++++
lib/IRremoteESP8266/src/ir_Whirlpool.h | 161 ++
lib/IRremoteESP8266/src/ir_Whynter.cpp | 95 +-
lib/IRremoteESP8266/test/IRrecv_test.cpp | 123 +-
lib/IRremoteESP8266/test/IRrecv_test.h | 9 +-
lib/IRremoteESP8266/test/IRsend_test.cpp | 62 +-
lib/IRremoteESP8266/test/IRsend_test.h | 65 +-
lib/IRremoteESP8266/test/IRutils_test.cpp | 126 +-
lib/IRremoteESP8266/test/Makefile | 102 +-
lib/IRremoteESP8266/test/ir_Aiwa_test.cpp | 114 +-
lib/IRremoteESP8266/test/ir_Carrier_test.cpp | 164 +-
lib/IRremoteESP8266/test/ir_Coolix_test.cpp | 269 ++-
lib/IRremoteESP8266/test/ir_Daikin_test.cpp | 955 ++++++++--
lib/IRremoteESP8266/test/ir_Denon_test.cpp | 68 +-
lib/IRremoteESP8266/test/ir_Dish_test.cpp | 129 +-
lib/IRremoteESP8266/test/ir_Electra_test.cpp | 98 +
lib/IRremoteESP8266/test/ir_Fujitsu_test.cpp | 163 +-
lib/IRremoteESP8266/test/ir_GICable_test.cpp | 59 +-
.../test/ir_GlobalCache_test.cpp | 61 +-
lib/IRremoteESP8266/test/ir_Gree_test.cpp | 357 ++--
lib/IRremoteESP8266/test/ir_Haier_test.cpp | 875 ++++++---
lib/IRremoteESP8266/test/ir_Hitachi_test.cpp | 816 ++++----
lib/IRremoteESP8266/test/ir_JVC_test.cpp | 83 +-
.../test/ir_Kelvinator_test.cpp | 137 +-
lib/IRremoteESP8266/test/ir_LG_test.cpp | 192 +-
lib/IRremoteESP8266/test/ir_Lasertag_test.cpp | 141 +-
lib/IRremoteESP8266/test/ir_Lutron_test.cpp | 143 ++
lib/IRremoteESP8266/test/ir_MWM_test.cpp | 124 ++
.../test/ir_Magiquest_test.cpp | 45 +-
lib/IRremoteESP8266/test/ir_Midea_test.cpp | 339 ++--
.../test/ir_Mitsubishi_test.cpp | 546 ++++--
lib/IRremoteESP8266/test/ir_NEC_test.cpp | 147 +-
lib/IRremoteESP8266/test/ir_Nikai_test.cpp | 144 +-
.../test/ir_Panasonic_test.cpp | 810 +++++++-
lib/IRremoteESP8266/test/ir_Pioneer_test.cpp | 152 ++
lib/IRremoteESP8266/test/ir_Pronto_test.cpp | 128 +-
lib/IRremoteESP8266/test/ir_RC5_RC6_test.cpp | 321 ++--
lib/IRremoteESP8266/test/ir_RCMM_test.cpp | 88 +-
lib/IRremoteESP8266/test/ir_Samsung_test.cpp | 852 ++++++++-
lib/IRremoteESP8266/test/ir_Sanyo_test.cpp | 124 +-
lib/IRremoteESP8266/test/ir_Sharp_test.cpp | 99 +-
lib/IRremoteESP8266/test/ir_Sherwood_test.cpp | 46 +-
lib/IRremoteESP8266/test/ir_Sony_test.cpp | 272 +--
lib/IRremoteESP8266/test/ir_Toshiba_test.cpp | 514 ++---
lib/IRremoteESP8266/test/ir_Vestel_test.cpp | 511 +++++
.../test/ir_Whirlpool_test.cpp | 584 ++++++
lib/IRremoteESP8266/test/ir_Whynter_test.cpp | 65 +-
lib/IRremoteESP8266/tools/Makefile | 32 +-
.../tools/auto_analyse_raw_data.py | 146 +-
.../tools/auto_analyse_raw_data_test.py | 298 ++-
lib/IRremoteESP8266/tools/gc_decode.cpp | 47 +-
lib/IRremoteESP8266/tools/mkkeywords | 4 +-
lib/IRremoteESP8266/tools/mode2_decode.cpp | 122 ++
149 files changed, 20957 insertions(+), 7850 deletions(-)
create mode 100644 lib/IRremoteESP8266/examples/ControlSamsungAC/ControlSamsungAC.ino
create mode 100644 lib/IRremoteESP8266/examples/ControlSamsungAC/platformio.ini
create mode 100644 lib/IRremoteESP8266/examples/LGACSend/platformio.ini
create mode 100644 lib/IRremoteESP8266/src/ir_Coolix.h
create mode 100644 lib/IRremoteESP8266/src/ir_Electra.cpp
create mode 100644 lib/IRremoteESP8266/src/ir_Hitachi.h
create mode 100644 lib/IRremoteESP8266/src/ir_Lutron.cpp
create mode 100644 lib/IRremoteESP8266/src/ir_MWM.cpp
create mode 100644 lib/IRremoteESP8266/src/ir_NEC.h
create mode 100644 lib/IRremoteESP8266/src/ir_Panasonic.h
create mode 100644 lib/IRremoteESP8266/src/ir_Pioneer.cpp
create mode 100644 lib/IRremoteESP8266/src/ir_Samsung.h
create mode 100644 lib/IRremoteESP8266/src/ir_Vestel.cpp
create mode 100644 lib/IRremoteESP8266/src/ir_Vestel.h
create mode 100644 lib/IRremoteESP8266/src/ir_Whirlpool.cpp
create mode 100644 lib/IRremoteESP8266/src/ir_Whirlpool.h
create mode 100644 lib/IRremoteESP8266/test/ir_Electra_test.cpp
create mode 100644 lib/IRremoteESP8266/test/ir_Lutron_test.cpp
create mode 100644 lib/IRremoteESP8266/test/ir_MWM_test.cpp
create mode 100644 lib/IRremoteESP8266/test/ir_Pioneer_test.cpp
create mode 100644 lib/IRremoteESP8266/test/ir_Vestel_test.cpp
create mode 100644 lib/IRremoteESP8266/test/ir_Whirlpool_test.cpp
create mode 100644 lib/IRremoteESP8266/tools/mode2_decode.cpp
diff --git a/ZgatewayIR.ino b/ZgatewayIR.ino
index ca1492f..48c34cf 100644
--- a/ZgatewayIR.ino
+++ b/ZgatewayIR.ino
@@ -248,229 +248,18 @@ void IRtoMQTT(){
trc(valueRPT);
}
- #ifdef ESP8266 // send coolix not available for arduino IRRemote library
- #ifdef IR_COOLIX
- if (strstr(topicOri, "IR_COOLIX") != NULL){
- if (valueBITS == 0) valueBITS = COOLIX_BITS;
- irsend.sendCOOLIX(data, valueBITS, valueRPT);
+ if(topicOri && (strstr(topicOri, "IR_NEC") == NULL)){
+ signalSent = sendIdentifiedProtocol(topicOri, data, (unsigned char *)datacallback, valueBITS, valueRPT);
+ }else{
+ trc(F("Using NEC protocol"));
+ if (valueBITS == 0) valueBITS = NEC_BITS;
+ #ifdef ESP8266
+ irsend.sendNEC(data, valueBITS, valueRPT);
+ #else
+ for (int i=0; i <= valueRPT; i++) irsend.sendNEC(data, valueBITS);
+ #endif
signalSent = true;
- }
- #endif
- #endif
- if (strstr(topicOri, "IR_NEC") != NULL || strstr(topicOri, subjectMQTTtoIR) != NULL ){
- if (valueBITS == 0) valueBITS = NEC_BITS;
- #ifdef ESP8266
- irsend.sendNEC(data, valueBITS, valueRPT);
- #else
- for (int i=0; i <= valueRPT; i++) irsend.sendNEC(data, valueBITS);
- #endif
- signalSent = true;
- }
- #ifdef IR_Whynter
- if (strstr(topicOri, "IR_Whynter") != NULL){
- if (valueBITS == 0) valueBITS = WHYNTER_BITS;
- #ifdef ESP8266
- irsend.sendWhynter(data, valueBITS, valueRPT);
- #else
- for (int i=0; i <= valueRPT; i++) irsend.sendWhynter(data, valueBITS);
- #endif
- signalSent = true;
- }
- #endif
- #ifdef IR_LG
- if (strstr(topicOri, "IR_LG") != NULL){
- if (valueBITS == 0) valueBITS = LG_BITS;
- #ifdef ESP8266
- irsend.sendLG(data, valueBITS, valueRPT);
- #else
- for (int i=0; i <= valueRPT; i++) irsend.sendLG(data, valueBITS);
- #endif
- signalSent = true;
- }
- #endif
- #ifdef IR_Sony
- if (strstr(topicOri, "IR_Sony") != NULL){
- if (valueBITS == 0) valueBITS = SONY_12_BITS;
- if (valueRPT == 0) valueRPT = repeatIRwNumber;
- #ifdef ESP8266
- irsend.sendSony(data, valueBITS, valueRPT);
- #else
- for (int i=0; i <= valueRPT; i++) irsend.sendSony(data, valueBITS);
- #endif
- signalSent = true;
- }
- #endif
- #ifdef IR_DISH
- if (strstr(topicOri, "IR_DISH") != NULL){
- if (valueBITS == 0) valueBITS = DISH_BITS;
- #ifdef ESP8266
- irsend.sendDISH(data, valueBITS, valueRPT);
- #else
- for (int i=0; i <= valueRPT; i++) irsend.sendDISH(data, valueBITS);
- #endif
- signalSent = true;
- }
- #endif
- #ifdef IR_RC5
- if (strstr(topicOri, "IR_RC5") != NULL){
- if (valueBITS == 0) valueBITS = RC5_BITS;
- #ifdef ESP8266
- irsend.sendRC5(data, valueBITS, valueRPT);
- #else
- for (int i=0; i <= valueRPT; i++) irsend.sendRC5(data, valueBITS);
- #endif
- signalSent = true;
- }
- #endif
- #ifdef IR_RC6
- if (strstr(topicOri, "IR_RC6") != NULL){
- if (valueBITS == 0) valueBITS = RC6_MODE0_BITS;
- #ifdef ESP8266
- irsend.sendRC6(data, valueBITS, valueRPT);
- #else
- for (int i=0; i <= valueRPT; i++) irsend.sendRC6(data, valueBITS);
- #endif
- signalSent = true;
- }
- #endif
- #ifdef IR_Sharp
- if (strstr(topicOri, "IR_Sharp") != NULL){
- if (valueBITS == 0) valueBITS = SHARP_BITS;
- #ifdef ESP8266
- irsend.sendSharpRaw(data, valueBITS, valueRPT);
- #else
- for (int i=0; i <= valueRPT; i++) irsend.sendSharpRaw(data, valueBITS);
- #endif
- signalSent = true;
- }
- #endif
- #ifdef IR_SAMSUNG
- if (strstr(topicOri, "IR_SAMSUNG") != NULL){
- if (valueBITS == 0) valueBITS = SAMSUNG_BITS;
- #ifdef ESP8266
- irsend.sendSAMSUNG(data, valueBITS, valueRPT);
- #else
- for (int i=0; i <= valueRPT; i++) irsend.sendSAMSUNG(data, valueBITS);
- #endif
- signalSent = true;
- }
- #endif
- #ifdef IR_JVC
- if (strstr(topicOri, "IR_JVC") != NULL){
- if (valueBITS == 0) valueBITS = JVC_BITS;
- if (valueRPT == 0) valueRPT = repeatIRwNumber;
- #ifdef ESP8266
- irsend.sendJVC(data, valueBITS, valueRPT);
- #else
- for (int i=0; i <= valueRPT; i++) irsend.sendJVC(data, valueBITS);
- #endif
- signalSent = true;
- }
- #endif
- #ifdef IR_PANASONIC
- if (strstr(topicOri, "IR_PANASONIC") != NULL){
- if (valueRPT == 0) valueRPT = repeatIRwNumber;
- #ifdef ESP8266
- if (valueBITS == 0) valueBITS = PANASONIC_BITS;
- irsend.sendPanasonic(PanasonicAddress, data, valueBITS, valueRPT);
- #else
- for (int i=0; i <= valueRPT; i++) irsend.sendPanasonic(PanasonicAddress, data);
- #endif
- signalSent = true;
- }
- #endif
-
- #ifdef ESP8266 // sendings not available on arduino
- #ifdef IR_RCMM
- if (strstr(topicOri, "IR_RCMM") != NULL){
- if (valueBITS == 0) valueBITS = RCMM_BITS;
- irsend.sendRCMM(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #ifdef IR_DENON
- if (strstr(topicOri, "IR_DENON") != NULL){
- if (valueBITS == 0) valueBITS = DENON_BITS;
- irsend.sendDenon(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #ifdef IR_GICABLE
- if (strstr(topicOri, "IR_GICABLE") != NULL){
- if (valueBITS == 0) valueBITS = GICABLE_BITS;
- if (valueRPT == 0) valueRPT = std::max(valueRPT, (uint16_t) GICABLE_MIN_REPEAT);
- irsend.sendGICable(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #ifdef IR_SHERWOOD
- if (strstr(topicOri, "IR_SHERWOOD") != NULL){
- if (valueBITS == 0) valueBITS = SHERWOOD_BITS;
- if (valueRPT == 0) valueRPT = std::max(valueRPT, (uint16_t) SHERWOOD_MIN_REPEAT);
- irsend.sendSherwood(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #ifdef IR_MITSUBISHI
- if (strstr(topicOri, "IR_MITSUBISHI") != NULL){
- if (valueBITS == 0) valueBITS = MITSUBISHI_BITS;
- if (valueRPT == 0) valueRPT = std::max(valueRPT, (uint16_t) MITSUBISHI_MIN_REPEAT);
- irsend.sendMitsubishi(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #ifdef IR_NIKAI
- if (strstr(topicOri, "IR_NIKAI") != NULL){
- if (valueBITS == 0) valueBITS = NIKAI_BITS;
- irsend.sendNikai(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #ifdef IR_MIDEA
- if (strstr(topicOri, "IR_MIDEA") != NULL){
- if (valueBITS == 0) valueBITS = MIDEA_BITS;
- irsend.sendMidea(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #ifdef IR_MAGIQUEST
- if (strstr(topicOri, "IR_MAGIQUEST") != NULL){
- if (valueBITS == 0) valueBITS = MAGIQUEST_BITS;
- irsend.sendMagiQuest(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #ifdef IR_LASERTAG
- if (strstr(topicOri, "IR_LASERTAG") != NULL){
- if (valueBITS == 0) valueBITS = LASERTAG_BITS;
- irsend.sendLasertag(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #ifdef IR_CARRIER_AC
- if (strstr(topicOri, "IR_CARRIER_AC") != NULL){
- if (valueBITS == 0) valueBITS = CARRIER_AC_BITS;
- irsend.sendCarrierAC(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #ifdef IR_MITSUBISHI2
- if (strstr(topicOri, "IR_MITSUBISHI2") != NULL){
- if (valueBITS == 0) valueBITS = MITSUBISHI_BITS;
- if (valueRPT == 0) valueRPT = std::max(valueRPT, (uint16_t) MITSUBISHI_MIN_REPEAT);
- irsend.sendMitsubishi2(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #ifdef IR_AIWA_RC_T501
- if (strstr(topicOri, "IR_MITSUBISHI") != NULL){
- if (valueBITS == 0) valueBITS = AIWA_RC_T501_BITS;
- if (valueRPT == 0) valueRPT = std::max(valueRPT, (uint16_t) AIWA_RC_T501_MIN_REPEAT);
- irsend.sendAiwaRCT501(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #endif
+ }
if (signalSent){ // we acknowledge the sending by publishing the value to an acknowledgement topic, for the moment even if it is a signal repetition we acknowledge also
pub(subjectGTWIRtoMQTT, datacallback);
@@ -486,7 +275,8 @@ void IRtoMQTT(){
trc(F("MQTTtoIR json"));
unsigned long data = IRdata["value"];
const char * raw = IRdata["raw"];
- if (data != 0||raw) {
+ const char * datastring = IRdata["datastring"];
+ if (data != 0||raw) {
trc(F("MQTTtoIR data || raw ok"));
boolean signalSent = false;
trc("value");
@@ -557,220 +347,9 @@ void IRtoMQTT(){
signalSent = true;
}
#endif
- }else if(protocol_name && (strstr(protocol_name, "IR_NEC") == NULL)){
- #ifdef ESP8266 // send coolix not available for arduino IRRemote library
- #ifdef IR_COOLIX
- if (strstr(protocol_name, "IR_COOLIX") != NULL){
- if (valueBITS == 0) valueBITS = COOLIX_BITS;
- irsend.sendCOOLIX(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #endif
- #ifdef IR_Whynter
- if (strstr(protocol_name, "IR_Whynter") != NULL){
- if (valueBITS == 0) valueBITS = WHYNTER_BITS;
- #ifdef ESP8266
- irsend.sendWhynter(data, valueBITS, valueRPT);
- #else
- for (int i=0; i <= valueRPT; i++) irsend.sendWhynter(data, valueBITS);
- #endif
- signalSent = true;
- }
- #endif
- #ifdef IR_LG
- if (strstr(protocol_name, "IR_LG") != NULL){
- if (valueBITS == 0) valueBITS = LG_BITS;
- #ifdef ESP8266
- irsend.sendLG(data, valueBITS, valueRPT);
- #else
- for (int i=0; i <= valueRPT; i++) irsend.sendLG(data, valueBITS);
- #endif
- signalSent = true;
- }
- #endif
- #ifdef IR_Sony
- if (strstr(protocol_name, "IR_Sony") != NULL){
- if (valueBITS == 0) valueBITS = SONY_12_BITS;
- #ifdef ESP8266
- irsend.sendSony(data, valueBITS, valueRPT);
- #else
- for (int i=0; i <= valueRPT; i++) irsend.sendSony(data, valueBITS);
- #endif
- signalSent = true;
- }
- #endif
- #ifdef IR_DISH
- if (strstr(protocol_name, "IR_DISH") != NULL){
- if (valueBITS == 0) valueBITS = DISH_BITS;
- #ifdef ESP8266
- irsend.sendDISH(data, valueBITS, valueRPT);
- #else
- for (int i=0; i <= valueRPT; i++) irsend.sendDISH(data, valueBITS);
- #endif
- signalSent = true;
- }
- #endif
- #ifdef IR_RC5
- if (strstr(protocol_name, "IR_RC5") != NULL){
- if (valueBITS == 0) valueBITS = RC5_BITS;
- #ifdef ESP8266
- irsend.sendRC5(data, valueBITS, valueRPT);
- #else
- for (int i=0; i <= valueRPT; i++) irsend.sendRC5(data, valueBITS);
- #endif
- signalSent = true;
- }
- #endif
- #ifdef IR_RC6
- if (strstr(protocol_name, "IR_RC6") != NULL){
- if (valueBITS == 0) valueBITS = RC6_MODE0_BITS;
- #ifdef ESP8266
- irsend.sendRC6(data, valueBITS, valueRPT);
- #else
- for (int i=0; i <= valueRPT; i++) irsend.sendRC6(data, valueBITS);
- #endif
- signalSent = true;
- }
- #endif
- #ifdef IR_Sharp
- if (strstr(protocol_name, "IR_Sharp") != NULL){
- if (valueBITS == 0) valueBITS = SHARP_BITS;
- #ifdef ESP8266
- irsend.sendSharpRaw(data, valueBITS, valueRPT);
- #else
- for (int i=0; i <= valueRPT; i++) irsend.sendSharpRaw(data, valueBITS);
- #endif
- signalSent = true;
- }
- #endif
- #ifdef IR_SAMSUNG
- if (strstr(protocol_name, "IR_SAMSUNG") != NULL){
- if (valueBITS == 0) valueBITS = SAMSUNG_BITS;
- #ifdef ESP8266
- irsend.sendSAMSUNG(data, valueBITS, valueRPT);
- #else
- for (int i=0; i <= valueRPT; i++) irsend.sendSAMSUNG(data, valueBITS);
- #endif
- signalSent = true;
- }
- #endif
- #ifdef IR_JVC
- if (strstr(protocol_name, "IR_JVC") != NULL){
- if (valueBITS == 0) valueBITS = JVC_BITS;
- #ifdef ESP8266
- irsend.sendJVC(data, valueBITS, valueRPT);
- #else
- for (int i=0; i <= valueRPT; i++) irsend.sendJVC(data, valueBITS);
- #endif
- signalSent = true;
- }
- #endif
- #ifdef IR_PANASONIC
- if (strstr(protocol_name, "IR_PANASONIC") != NULL){
- #ifdef ESP8266
- if (valueBITS == 0) valueBITS = PANASONIC_BITS;
- irsend.sendPanasonic(PanasonicAddress, data, valueBITS, valueRPT);
- #else
- for (int i=0; i <= valueRPT; i++) irsend.sendPanasonic(PanasonicAddress, data);
- #endif
- signalSent = true;
- }
- #endif
-
- #ifdef ESP8266 // sendings not available on arduino
- #ifdef IR_RCMM
- if (strstr(protocol_name, "IR_RCMM") != NULL){
- if (valueBITS == 0) valueBITS = RCMM_BITS;
- irsend.sendRCMM(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #ifdef IR_DENON
- if (strstr(protocol_name, "IR_DENON") != NULL){
- if (valueBITS == 0) valueBITS = DENON_BITS;
- irsend.sendDenon(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #ifdef IR_GICABLE
- if (strstr(protocol_name, "IR_GICABLE") != NULL){
- if (valueBITS == 0) valueBITS = GICABLE_BITS;
- if (valueRPT == repeatIRwNumber) valueRPT = std::max(valueRPT, (uint16_t) GICABLE_MIN_REPEAT);
- irsend.sendGICable(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #ifdef IR_SHERWOOD
- if (strstr(protocol_name, "IR_SHERWOOD") != NULL){
- if (valueBITS == 0) valueBITS = SHERWOOD_BITS;
- if (valueRPT == repeatIRwNumber) valueRPT = std::max(valueRPT, (uint16_t) SHERWOOD_MIN_REPEAT);
- irsend.sendSherwood(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #ifdef IR_MITSUBISHI
- if (strstr(protocol_name, "IR_MITSUBISHI") != NULL){
- if (valueBITS == 0) valueBITS = MITSUBISHI_BITS;
- if (valueRPT == repeatIRwNumber) valueRPT = std::max(valueRPT, (uint16_t) MITSUBISHI_MIN_REPEAT);
- irsend.sendMitsubishi(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #ifdef IR_NIKAI
- if (strstr(protocol_name, "IR_NIKAI") != NULL){
- if (valueBITS == 0) valueBITS = NIKAI_BITS;
- irsend.sendNikai(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #ifdef IR_MIDEA
- if (strstr(protocol_name, "IR_MIDEA") != NULL){
- if (valueBITS == 0) valueBITS = MIDEA_BITS;
- irsend.sendMidea(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #ifdef IR_MAGIQUEST
- if (strstr(protocol_name, "IR_MAGIQUEST") != NULL){
- if (valueBITS == 0) valueBITS = MAGIQUEST_BITS;
- irsend.sendMagiQuest(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #ifdef IR_LASERTAG
- if (strstr(protocol_name, "IR_LASERTAG") != NULL){
- if (valueBITS == 0) valueBITS = LASERTAG_BITS;
- irsend.sendLasertag(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #ifdef IR_CARRIER_AC
- if (strstr(protocol_name, "IR_CARRIER_AC") != NULL){
- if (valueBITS == 0) valueBITS = CARRIER_AC_BITS;
- irsend.sendCarrierAC(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #ifdef IR_MITSUBISHI2
- if (strstr(protocol_name, "IR_MITSUBISHI2") != NULL){
- if (valueBITS == 0) valueBITS = MITSUBISHI_BITS;
- if (valueRPT == repeatIRwNumber) valueRPT = std::max(valueRPT, (uint16_t) MITSUBISHI_MIN_REPEAT);
- irsend.sendMitsubishi2(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #ifdef IR_AIWA_RC_T501
- if (strstr(protocol_name, "IR_MITSUBISHI") != NULL){
- if (valueBITS == 0) valueBITS = AIWA_RC_T501_BITS;
- if (valueRPT == repeatIRwNumber) valueRPT = std::max(valueRPT, (uint16_t) AIWA_RC_T501_MIN_REPEAT);
- irsend.sendAiwaRCT501(data, valueBITS, valueRPT);
- signalSent = true;
- }
- #endif
- #endif
-
- }else{
+ }else if(protocol_name && (strstr(protocol_name, "IR_NEC") == NULL)){
+ signalSent = sendIdentifiedProtocol(protocol_name, data, (unsigned char*)datastring, valueBITS, valueRPT);
+ }else{
trc(F("Using NEC protocol"));
if (valueBITS == 0) valueBITS = NEC_BITS;
#ifdef ESP8266
@@ -791,4 +370,404 @@ void IRtoMQTT(){
}
}
#endif
+
+boolean sendIdentifiedProtocol(const char * protocol_name, unsigned long data, unsigned char * datastring, unsigned int valueBITS, uint16_t valueRPT){
+ #ifdef IR_Whynter
+ if (strstr(protocol_name, "IR_Whynter") != NULL){
+ if (valueBITS == 0) valueBITS = WHYNTER_BITS;
+ #ifdef ESP8266
+ irsend.sendWhynter(data, valueBITS, valueRPT);
+ #else
+ for (int i=0; i <= valueRPT; i++) irsend.sendWhynter(data, valueBITS);
+ #endif
+ return true;
+ }
+ #endif
+ #ifdef IR_LG
+ if (strstr(protocol_name, "IR_LG") != NULL){
+ if (valueBITS == 0) valueBITS = LG_BITS;
+ #ifdef ESP8266
+ irsend.sendLG(data, valueBITS, valueRPT);
+ #else
+ for (int i=0; i <= valueRPT; i++) irsend.sendLG(data, valueBITS);
+ #endif
+ return true;
+ }
+ #endif
+ #ifdef IR_Sony
+ if (strstr(protocol_name, "IR_Sony") != NULL){
+ if (valueBITS == 0) valueBITS = SONY_12_BITS;
+ #ifdef ESP8266
+ irsend.sendSony(data, valueBITS, valueRPT);
+ #else
+ for (int i=0; i <= valueRPT; i++) irsend.sendSony(data, valueBITS);
+ #endif
+ return true;
+ }
+ #endif
+ #ifdef IR_DISH
+ if (strstr(protocol_name, "IR_DISH") != NULL){
+ if (valueBITS == 0) valueBITS = DISH_BITS;
+ #ifdef ESP8266
+ irsend.sendDISH(data, valueBITS, valueRPT);
+ #else
+ for (int i=0; i <= valueRPT; i++) irsend.sendDISH(data, valueBITS);
+ #endif
+ return true;
+ }
+ #endif
+ #ifdef IR_RC5
+ if (strstr(protocol_name, "IR_RC5") != NULL){
+ if (valueBITS == 0) valueBITS = RC5_BITS;
+ #ifdef ESP8266
+ irsend.sendRC5(data, valueBITS, valueRPT);
+ #else
+ for (int i=0; i <= valueRPT; i++) irsend.sendRC5(data, valueBITS);
+ #endif
+ return true;
+ }
+ #endif
+ #ifdef IR_RC6
+ if (strstr(protocol_name, "IR_RC6") != NULL){
+ if (valueBITS == 0) valueBITS = RC6_MODE0_BITS;
+ #ifdef ESP8266
+ irsend.sendRC6(data, valueBITS, valueRPT);
+ #else
+ for (int i=0; i <= valueRPT; i++) irsend.sendRC6(data, valueBITS);
+ #endif
+ return true;
+ }
+ #endif
+ #ifdef IR_Sharp
+ if (strstr(protocol_name, "IR_Sharp") != NULL){
+ if (valueBITS == 0) valueBITS = SHARP_BITS;
+ #ifdef ESP8266
+ irsend.sendSharpRaw(data, valueBITS, valueRPT);
+ #else
+ for (int i=0; i <= valueRPT; i++) irsend.sendSharpRaw(data, valueBITS);
+ #endif
+ return true;
+ }
+ #endif
+ #ifdef IR_SAMSUNG
+ if (strstr(protocol_name, "IR_SAMSUNG") != NULL){
+ if (valueBITS == 0) valueBITS = SAMSUNG_BITS;
+ #ifdef ESP8266
+ irsend.sendSAMSUNG(data, valueBITS, valueRPT);
+ #else
+ for (int i=0; i <= valueRPT; i++) irsend.sendSAMSUNG(data, valueBITS);
+ #endif
+ return true;
+ }
+ #endif
+ #ifdef IR_JVC
+ if (strstr(protocol_name, "IR_JVC") != NULL){
+ if (valueBITS == 0) valueBITS = JVC_BITS;
+ #ifdef ESP8266
+ irsend.sendJVC(data, valueBITS, valueRPT);
+ #else
+ for (int i=0; i <= valueRPT; i++) irsend.sendJVC(data, valueBITS);
+ #endif
+ return true;
+ }
+ #endif
+ #ifdef IR_PANASONIC
+ if (strstr(protocol_name, "IR_PANASONIC") != NULL){
+ #ifdef ESP8266
+ if (valueBITS == 0) valueBITS = PANASONIC_BITS;
+ irsend.sendPanasonic(PanasonicAddress, data, valueBITS, valueRPT);
+ #else
+ for (int i=0; i <= valueRPT; i++) irsend.sendPanasonic(PanasonicAddress, data);
+ #endif
+ return true;
+ }
+ #endif
+
+ #ifdef ESP8266 // sendings not available on arduino
+ #ifdef IR_COOLIX
+ if (strstr(protocol_name, "IR_COOLIX") != NULL){
+ if (valueBITS == 0) valueBITS = kCoolixBits;
+ irsend.sendCOOLIX(data, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_RCMM
+ if (strstr(protocol_name, "IR_RCMM") != NULL){
+ if (valueBITS == 0) valueBITS = kRCMMBits;
+ irsend.sendRCMM(data, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_DENON
+ if (strstr(protocol_name, "IR_DENON") != NULL){
+ if (valueBITS == 0) valueBITS = DENON_BITS;
+ irsend.sendDenon(data, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_GICABLE
+ if (strstr(protocol_name, "IR_GICABLE") != NULL){
+ if (valueBITS == 0) valueBITS = kGicableBits;
+ if (valueRPT == repeatIRwNumber) valueRPT = std::max(valueRPT, kGicableMinRepeat);
+ irsend.sendGICable(data, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_SHERWOOD
+ if (strstr(protocol_name, "IR_SHERWOOD") != NULL){
+ if (valueBITS == 0) valueBITS = kSherwoodBits;
+ if (valueRPT == repeatIRwNumber) valueRPT = std::max(valueRPT, kSherwoodMinRepeat);
+ irsend.sendSherwood(data, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_MITSUBISHI
+ if (strstr(protocol_name, "IR_MITSUBISHI") != NULL){
+ if (valueBITS == 0) valueBITS = kMitsubishiBits;
+ if (valueRPT == repeatIRwNumber) valueRPT = std::max(valueRPT, kMitsubishiMinRepeat);
+ irsend.sendMitsubishi(data, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_NIKAI
+ if (strstr(protocol_name, "IR_NIKAI") != NULL){
+ if (valueBITS == 0) valueBITS = kNikaiBits;
+ irsend.sendNikai(data, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_MIDEA
+ if (strstr(protocol_name, "IR_MIDEA") != NULL){
+ if (valueBITS == 0) valueBITS = kMideaBits;
+ irsend.sendMidea(data, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_MAGIQUEST
+ if (strstr(protocol_name, "IR_MAGIQUEST") != NULL){
+ if (valueBITS == 0) valueBITS = kMagiquestBits;
+ irsend.sendMagiQuest(data, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_LASERTAG
+ if (strstr(protocol_name, "IR_LASERTAG") != NULL){
+ if (valueBITS == 0) valueBITS = kLasertagBits;
+ irsend.sendLasertag(data, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_CARRIER_AC
+ if (strstr(protocol_name, "IR_CARRIER_AC") != NULL){
+ if (valueBITS == 0) valueBITS = kCarrierAcBits;
+ irsend.sendCarrierAC(data, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_MITSUBISHI2
+ if (strstr(protocol_name, "IR_MITSUBISHI2") != NULL){
+ if (valueBITS == 0) valueBITS = kMitsubishiBits;
+ if (valueRPT == repeatIRwNumber) valueRPT = std::max(valueRPT, kMitsubishiMinRepeat);
+ irsend.sendMitsubishi2(data, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_AIWA_RC_T501
+ if (strstr(protocol_name, "IR_AIWA_RC_T501") != NULL){
+ if (valueBITS == 0) valueBITS = kAiwaRcT501Bits;
+ if (valueRPT == repeatIRwNumber) valueRPT = std::max(valueRPT, kAiwaRcT501MinRepeats);
+ irsend.sendAiwaRCT501(data, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_SANYO
+ if (strstr(protocol_name, "IR_SANYO") != NULL){
+ if (valueBITS == 0) valueBITS = kSanyoLC7461Bits;
+ irsend.sendSanyoLC7461(data, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_DAIKIN
+ if (strstr(protocol_name, "IR_DAIKIN") != NULL){
+ if (valueBITS == 0) valueBITS = kDaikinStateLength;
+ irsend.sendDaikin(datastring, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_KELVINATOR
+ if (strstr(protocol_name, "IR_KELVINATOR") != NULL){
+ if (valueBITS == 0) valueBITS = kKelvinatorStateLength;
+ irsend.sendKelvinator(datastring, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_MITSUBISHI_AC
+ if (strstr(protocol_name, "IR_MITSUBISHI_AC") != NULL){
+ if (valueBITS == 0) valueBITS = kMitsubishiACStateLength;
+ irsend.sendMitsubishiAC(datastring, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_SANYO
+ if (strstr(protocol_name, "IR_SANYO") != NULL){
+ if (valueBITS == 0) valueBITS = kSanyoLC7461Bits;
+ irsend.sendSanyoLC7461(data, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_GREE
+ if (strstr(protocol_name, "IR_GREE") != NULL){
+ if (valueBITS == 0) valueBITS = kGreeStateLength;
+ irsend.sendGree(data, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_ARGO
+ if (strstr(protocol_name, "IR_ARGO") != NULL){
+ if (valueBITS == 0) valueBITS = kArgoStateLength;
+ irsend.sendArgo(datastring, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_TROTEC
+ if (strstr(protocol_name, "IR_TROTEC") != NULL){
+ if (valueBITS == 0) valueBITS = kTrotecStateLength;
+ irsend.sendTrotec(datastring, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_TOSHIBA_AC
+ if (strstr(protocol_name, "IR_TOSHIBA_AC") != NULL){
+ if (valueBITS == 0) valueBITS = kToshibaACBits;
+ irsend.sendToshibaAC(datastring, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_FUJITSU_AC
+ if (strstr(protocol_name, "IR_FUJITSU_AC") != NULL){
+ irsend.sendFujitsuAC(datastring, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_MAGIQUEST
+ if (strstr(protocol_name, "IR_MAGIQUEST") != NULL){
+ if (valueBITS == 0) valueBITS = kMagiquestBits;
+ irsend.sendMagiQuest(data, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_HAIER_AC
+ if (strstr(protocol_name, "IR_HAIER_AC") != NULL){
+ if (valueBITS == 0) valueBITS = kHaierACStateLength;
+ irsend.sendHaierAC(datastring, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_HITACHI_AC
+ if (strstr(protocol_name, "IR_HITACHI_AC") != NULL){
+ if (valueBITS == 0) valueBITS = kHitachiAc2StateLength;
+ irsend.sendHitachiAC(datastring, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_HITACHI_AC1
+ if (strstr(protocol_name, "IR_HITACHI_AC1") != NULL){
+ if (valueBITS == 0) valueBITS = kHitachiAc2StateLength;
+ irsend.sendHitachiAC1(datastring, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_HITACHI_AC2
+ if (strstr(protocol_name, "IR_HITACHI_AC2") != NULL){
+ if (valueBITS == 0) valueBITS = kHitachiAc2StateLength;
+ irsend.sendHitachiAC2(datastring, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_GICABLE
+ if (strstr(protocol_name, "IR_GICABLE") != NULL){
+ if (valueBITS == 0) valueBITS = kGicableBits;
+ irsend.sendGICable(data, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_HAIER_AC_YRW02
+ if (strstr(protocol_name, "IR_HAIER_AC_YRW02") != NULL){
+ if (valueBITS == 0) valueBITS = kHaierACYRW02StateLength;
+ irsend.sendHaierACYRW02(datastring, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_WHIRLPOOL_AC
+ if (strstr(protocol_name, "IR_WHIRLPOOL_AC") != NULL){
+ if (valueBITS == 0) valueBITS = kWhirlpoolAcStateLength;
+ irsend.sendWhirlpoolAC(datastring, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_SAMSUNG_AC
+ if (strstr(protocol_name, "IR_SAMSUNG_AC") != NULL){
+ if (valueBITS == 0) valueBITS = kSamsungAcStateLength;
+ irsend.sendSamsungAC(datastring, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_LUTRON
+ if (strstr(protocol_name, "IR_LUTRON") != NULL){
+ if (valueBITS == 0) valueBITS = kLutronBits;
+ irsend.sendLutron(data, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_ELECTRA_AC
+ if (strstr(protocol_name, "IR_ELECTRA_AC") != NULL){
+ if (valueBITS == 0) valueBITS = kElectraAcStateLength;
+ irsend.sendElectraAC(datastring, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_PANASONIC_AC
+ if (strstr(protocol_name, "IR_PANASONIC_AC") != NULL){
+ if (valueBITS == 0) valueBITS = kPanasonicAcStateLength;
+ irsend.sendPanasonicAC(datastring, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_PIONEER
+ if (strstr(protocol_name, "IR_PIONEER") != NULL){
+ if (valueBITS == 0) valueBITS = kPioneerBits;
+ irsend.sendPioneer(data, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_LG2
+ if (strstr(protocol_name, "IR_LG2") != NULL){
+ if (valueBITS == 0) valueBITS = kLgBits;
+ irsend.sendLG2(data, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_MWM
+ if (strstr(protocol_name, "IR_MWM") != NULL){
+ irsend.sendMWM(datastring, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_DAIKIN2
+ if (strstr(protocol_name, "IR_DAIKIN2") != NULL){
+ if (valueBITS == 0) valueBITS = kDaikin2StateLength;
+ irsend.sendDaikin2(datastring, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ #ifdef IR_VESTEL_AC
+ if (strstr(protocol_name, "IR_VESTEL_AC") != NULL){
+ if (valueBITS == 0) valueBITS = kVestelACBits;
+ irsend.sendVestelAC(data, valueBITS, valueRPT);
+ return true;
+ }
+ #endif
+ return false;
+ #endif
+}
#endif
diff --git a/config_IR.h b/config_IR.h
index 99dedac..b4c9a03 100644
--- a/config_IR.h
+++ b/config_IR.h
@@ -68,6 +68,33 @@
#define IR_DENON
#define IR_AIWA_RC_T501
#define IR_JVC
+ #define IR_SANYO
+ #define IR_DAIKIN
+ #define IR_KELVINATOR
+ #define IR_MITSUBISHI_AC
+ #define IR_SANYO_LC7461
+ #define IR_GREE
+ #define IR_ARGO
+ #define IR_TROTEC
+ #define IR_TOSHIBA_AC
+ #define IR_FUJITSU_AC
+ #define IR_MAGIQUEST
+ #define IR_HAIER_AC
+ #define IR_HITACHI_AC
+ #define IR_HITACHI_AC1
+ #define IR_HITACHI_AC2
+ #define IR_GICABLE
+ #define IR_HAIER_AC_YRW02
+ #define IR_WHIRLPOOL_AC
+ #define IR_SAMSUNG_AC
+ #define IR_LUTRON
+ #define IR_ELECTRA_AC
+ #define IR_PANASONIC_AC
+ #define IR_PIONEER
+ #define IR_LG2
+ #define IR_MWM
+ #define IR_DAIKIN2
+ #define IR_VESTEL_AC
#elif ESP32
#define IR_Raw
#define IR_COOLIX
@@ -105,14 +132,14 @@
/*-------------------PIN DEFINITIONS----------------------*/
#ifdef ESP8266
- #define IR_RECEIVER_PIN 2
- #define IR_EMITTER_PIN 16 // replace by 0 (D3) if you use IR LOLIN controller shield
+ #define IR_RECEIVER_PIN 2 //D4
+ #define IR_EMITTER_PIN 16 //D0/ replace by 0 (D3) if you use IR LOLIN controller shield
#elif ESP32
#define IR_RECEIVER_PIN 27
#define IR_EMITTER_PIN 14
#elif __AVR_ATmega2560__
#define IR_RECEIVER_PIN 2 // 2 = D2 on mega
- #define IR_EMITTER_PIN 7
+ #define IR_EMITTER_PIN 9
#else
#define IR_RECEIVER_PIN 0 // 0 = D2 on arduino
#define IR_EMITTER_PIN 9
diff --git a/lib/IRremoteESP8266/.github/Contributors.md b/lib/IRremoteESP8266/.github/Contributors.md
index 151a0c0..5f75ea3 100644
--- a/lib/IRremoteESP8266/.github/Contributors.md
+++ b/lib/IRremoteESP8266/.github/Contributors.md
@@ -10,6 +10,8 @@
- [Jonny Graham](https://github.com/jonnygraham/)
- [Stu Fisher](https://github.com/stufisher/)
- [Jorge Cisneros](https://github.com/jorgecis/)
+- [Denes Varga](https://github.com/denxhun/)
+- [Brett T. Warden](https://github.com/bwarden/)
All contributors can be found on the [contributors site](https://github.com/markszabo/IRremoteESP8266/graphs/contributors).
diff --git a/lib/IRremoteESP8266/.gitignore b/lib/IRremoteESP8266/.gitignore
index c9dfea7..23e21ca 100644
--- a/lib/IRremoteESP8266/.gitignore
+++ b/lib/IRremoteESP8266/.gitignore
@@ -35,8 +35,12 @@ test/*_test
tools/*.o
tools/*.a
tools/gc_decode
+tools/mode2_decode
.pioenvs
.piolibdeps
.clang_complete
.gcc-flags.json
+
+#Cygwin builds
+*.exe
diff --git a/lib/IRremoteESP8266/.gitmodules b/lib/IRremoteESP8266/.gitmodules
index 80925b8..c28fe05 100644
--- a/lib/IRremoteESP8266/.gitmodules
+++ b/lib/IRremoteESP8266/.gitmodules
@@ -1,3 +1,4 @@
[submodule "lib/googletest"]
path = lib/googletest
url = https://github.com/google/googletest.git
+ branch = v1.8.x
diff --git a/lib/IRremoteESP8266/.travis.yml b/lib/IRremoteESP8266/.travis.yml
index 4331425..39d2d0b 100644
--- a/lib/IRremoteESP8266/.travis.yml
+++ b/lib/IRremoteESP8266/.travis.yml
@@ -1,14 +1,14 @@
language: c
env:
- - BD=esp8266:esp8266:nodemcuv2:CpuFrequency=80,FlashSize=4M3M
- - BD=esp8266:esp8266:d1_mini:CpuFrequency=80,FlashSize=4M3M
+ - BD=esp8266:esp8266:nodemcuv2:xtal=80,eesz=4M3M,ip=lm2f,exception=disabled
+ - BD=esp8266:esp8266:d1_mini:xtal=80,eesz=4M3M,ip=lm2f,exception=disabled
before_install:
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16"
- sleep 3
- export DISPLAY=:1.0
- - wget http://downloads.arduino.cc/arduino-1.8.2-linux64.tar.xz
- - tar xf arduino-1.8.2-linux64.tar.xz
- - sudo mv arduino-1.8.2 /usr/local/share/arduino
+ - wget http://downloads.arduino.cc/arduino-1.8.8-linux64.tar.xz
+ - tar xf arduino-1.8.8-linux64.tar.xz
+ - sudo mv arduino-1.8.8 /usr/local/share/arduino
- sudo ln -s /usr/local/share/arduino/arduino /usr/local/bin/arduino
- wget https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py
install:
@@ -40,6 +40,7 @@ script:
- arduino --verify --board $BD $PWD/examples/TurnOnArgoAC/TurnOnArgoAC.ino
- arduino --verify --board $BD $PWD/examples/IRMQTTServer/IRMQTTServer.ino
- arduino --verify --board $BD $PWD/examples/TurnOnToshibaAC/TurnOnToshibaAC.ino
+ - arduino --verify --board $BD $PWD/examples/ControlSamsungAC/ControlSamsungAC.ino
# Also check the tools programs compile.
- (cd tools; make all)
# Check for lint issues.
diff --git a/lib/IRremoteESP8266/README.md b/lib/IRremoteESP8266/README.md
index ad039a9..a179214 100644
--- a/lib/IRremoteESP8266/README.md
+++ b/lib/IRremoteESP8266/README.md
@@ -1,17 +1,33 @@
# IRremote ESP8266 Library
[](https://travis-ci.org/markszabo/IRremoteESP8266)
+[](https://www.ardu-badge.com/IRremoteESP8266)
[](http://isitmaintained.com/project/markszabo/IRremoteESP8266 "Average time to resolve an issue")
[](http://isitmaintained.com/project/markszabo/IRremoteESP8266 "Percentage of issues still open")
[](https://gitlicense.com/license/markszabo/IRremoteESP8266)
This library enables you to **send _and_ receive** infra-red signals on an [ESP8266 using the Arduino framework](https://github.com/esp8266/Arduino) using common 940nm IR LEDs and common IR receiver modules. e.g. TSOP{17,22,24,36,38,44,48}* etc.
-## v2.4.2 Now Available
-Version 2.4.2 of the library is now [available](https://github.com/markszabo/IRremoteESP8266/releases/latest). You can view the [Release Notes](ReleaseNotes.md) for all the significant changes.
+## v2.5.5 Now Available
+Version 2.5.5 of the library is now [available](https://github.com/markszabo/IRremoteESP8266/releases/latest). You can view the [Release Notes](ReleaseNotes.md) for all the significant changes.
#### Upgrading from pre-v2.0
-Usage of the library slight changed at v2.0. You will need to change your usage to work with v2.0 and beyond. You can read more about the changes required on our [Upgrade to v2.0](https://github.com/markszabo/IRremoteESP8266/wiki/Upgrading-to-v2.0) page.
+Usage of the library has been slightly changed in v2.0. You will need to change your usage to work with v2.0 and beyond. You can read more about the changes required on our [Upgrade to v2.0](https://github.com/markszabo/IRremoteESP8266/wiki/Upgrading-to-v2.0) page.
+
+#### Upgrading from pre-v2.5
+The library has changed from using constants declared as `#define` to
+[const](https://google.github.io/styleguide/cppguide.html#Constant_Names) with
+the appropriate naming per the
+[C++ style guide](https://google.github.io/styleguide/cppguide.html).
+This may potentially cause old programs to not compile.
+The most likely externally used `#define`s have been _aliased_ for limited
+backward compatibility for projects using the old style. Going forward, only the
+new `kConstantName` style will be supported for new protocol additions.
+
+In the unlikely case it does break your code, then you may have been referencing
+something you likely should not have. You should be able to quickly determine
+the new name from the old. e.g. `CONSTANT_NAME` to `kConstantName`.
+Use common sense or examining the library's code if this does affect code.
## Troubleshooting
Before reporting an issue or asking for help, please try to follow our [Troubleshooting Guide](https://github.com/markszabo/IRremoteESP8266/wiki/Troubleshooting-Guide) first.
diff --git a/lib/IRremoteESP8266/ReleaseNotes.md b/lib/IRremoteESP8266/ReleaseNotes.md
index 23bb971..533b952 100644
--- a/lib/IRremoteESP8266/ReleaseNotes.md
+++ b/lib/IRremoteESP8266/ReleaseNotes.md
@@ -1,5 +1,125 @@
# Release Notes
+## _v2.5.5 (20190207)_
+
+**[Bug Fixes]**
+- Fix decoding of Samsung A/C Extended messages. (#610)
+- Fix IRMQTTServer example to work with GPIO0 as IR_RX (#608)
+- Fix incorrect #define usage. (#597, #596)
+
+**[Features]**
+- Add deep decoding/construction of Daikin2 messages (#600)
+- Added Old Vestel A/C support (56 Bits) with full functions. (#607)
+
+**[Misc]**
+- Add ControlSamsungAC example code. (#599)
+- Add how to send a state/air-con to IRsendDemo.ino (#594)
+
+
+## _v2.5.4 (20190102)_
+
+**[Features]**
+- Experimental basic support for 39 Byte Daikin A/C (#583)
+- Handle send() repeats in A/C classes. Improve Coolix support. (#580)
+- Add optional RX pin pullup and dump raw messages in IRMQTTServer.ino (#589)
+
+**[Misc]**
+- Make auto_analyse_raw_data.py work with Python3 (#581)
+- Update CI/travis config due to esp8266 core 2.5.0 changes (#591)
+
+
+## _v2.5.3 (20181123)_
+
+**[Features]**
+- Add deep support for the Hitachi 28-Byte A/C Protocol (#563)
+- Deep decoding for Whirlpool A/C (#572)
+- Improve security options for IRMQTTServer example. (#575)
+- Require a changed firmware password before upload. (#576)
+
+**[Misc]**
+- Add missing '}' in output of Auto analyse. (#562)
+- Make A/C example code a bit more simple. (#571)
+
+
+## _v2.5.2 (20181021)_
+
+**[Bug Fixes]**
+- Add missing send() method to IRPanasonicAC class. (#545)
+- Add missing sendWhirlpoolAC() to IRMQTTServer.ino (#558)
+
+**[Features]**
+- Add IR receiving support to IRMQTTServer. (#543)
+- Pioneer support (#547)
+- Add support for a second LG protocol variant. (#552)
+- Support for short Panasonic A/C messages. (#553)
+- Add support for Panasonic CKP series A/Cs. (#554)
+- Experimental timer/clock support for Panasonic A/Cs. (#546)
+- Add Made With Magic (MWM) support (#557)
+
+**[Misc]**
+- Grammar and typo fixes (#541, #549)
+- Increase Panasonic A/C message tolerances. (#542)
+- Added command mode2_decode in tools/ (#557)
+- General code style cleanup (#560)
+
+
+## _v2.5.1 (20181002)_
+
+**[Bug Fixes]**
+- Correct the byte used for Samsung AC Swing. (#529)
+- Fix not sending Samsung A/C messages in IRMQTTServer. (#529)
+
+**[Features]**
+- Experimental support for Electra A/C messages. (#528)
+- Experimental support for Panasonic A/C messages. (#535)
+- Samsung A/C fixes & improvements (#529)
+- IRMQTTServer v0.6.0 (#530)
+
+**[Misc]**
+- Change required WifiManager lib version to v0.14
+- Add alias for RAWTICK to kRawTick. (#535)
+- Update sendLutron() status. (#515)
+- Remove leftover debug message in IRrecvDumpV2 (#526)
+
+
+## _v2.5.0 (20180919)_
+
+**[Bug Fixes]**
+- Fix HTML menu error for GICABLE in IRMQTTServer. (#516)
+- Fix Mitsubishi A/C mode setting. (#514)
+- Add missing ',' in auto analyse tool generated code. (#513)
+- Fix Fujitsu checksum validation. (#501)
+- Remove errant Repeat debug statement in IRMQTTServer. (#507)
+
+**[Features]**
+- Mitsubishi A/C decode improvements. (#514)
+- Basic support for Whirlpool A/C messages. (#511)
+- Basic support for Samsung A/C messages. (#512)
+- Experimental support for detailed Samsung A/C messages. (#521)
+- Experimental support for detailed Coolix A/C messages. (#518)
+- Experimental support for Lutron protocol. (#516)
+- Calculate and use average values for timings in analysing tool. (#513)
+
+**[Misc]**
+- Style change from using #define's for constants to `const kConstantName`.
+- Improve the JVC example code.
+
+
+## _v2.4.3 (20180727)_
+
+**[Bug Fixes]**
+- Handle Space Gaps better in auto analyse tool. (#482)
+- Correct min repeat for GICABLE in IRMQTTServer. (#494)
+
+**[Features]**
+- Add static IP config option to IRMQTTServer (#480)
+- Full decoding/encoding support for the Haier YRW02 A/C. (#485 #486 #487)
+
+**[Misc]**
+- Update LG (28-bit) HDR mark and space timings. (#492)
+- Spelling and grammar fixes (#491)
+
+
## _v2.4.2 (20180601)_
**[Bug Fixes]**
diff --git a/lib/IRremoteESP8266/examples/ControlSamsungAC/ControlSamsungAC.ino b/lib/IRremoteESP8266/examples/ControlSamsungAC/ControlSamsungAC.ino
new file mode 100644
index 0000000..df910fe
--- /dev/null
+++ b/lib/IRremoteESP8266/examples/ControlSamsungAC/ControlSamsungAC.ino
@@ -0,0 +1,99 @@
+/* Copyright 2019 David Conran
+*
+* An IR LED circuit *MUST* be connected to the ESP8266 on a pin
+* as specified by kIrLed below.
+*
+* TL;DR: The IR LED needs to be driven by a transistor for a good result.
+*
+* Suggested circuit:
+* https://github.com/markszabo/IRremoteESP8266/wiki#ir-sending
+*
+* Common mistakes & tips:
+* * Don't just connect the IR LED directly to the pin, it won't
+* have enough current to drive the IR LED effectively.
+* * Make sure you have the IR LED polarity correct.
+* See: https://learn.sparkfun.com/tutorials/polarity/diode-and-led-polarity
+* * Typical digital camera/phones can be used to see if the IR LED is flashed.
+* Replace the IR LED with a normal LED if you don't have a digital camera
+* when debugging.
+* * Avoid using the following pins unless you really know what you are doing:
+* * Pin 0/D3: Can interfere with the boot/program mode & support circuits.
+* * Pin 1/TX/TXD0: Any serial transmissions from the ESP8266 will interfere.
+* * Pin 3/RX/RXD0: Any serial transmissions to the ESP8266 will interfere.
+* * ESP-01 modules are tricky. We suggest you use a module with more GPIOs
+* for your first time. e.g. ESP-12 etc.
+*/
+#ifndef UNIT_TEST
+#include ESP8266 IR MQTT Server
"
"IR Lib Version: " _IRREMOTEESP8266_VERSION_ "
"
"ESP8266 Core Version: " + ESP.getCoreVersion() + "
"
- "Total send requests: " + String(sendReqCounter) + "
Server: " MQTT_SERVER ":" + String(MQTT_PORT) + " (" +
- (mqtt_client.connected() ? "Connected" : "Disconnected") + ")
"
+ "
Server: " MQTT_SERVER ":" + String(kMqttPort) + " (" +
+ (mqtt_client.connected() ? "Connected " + timeSince(lastDisconnectedTime)
+ : "Disconnected " + timeSince(lastConnectedTime)) +
+ ")
"
+ "Disconnections: " + String(mqttDisconnectCounter - 1) + "
"
"Client id: " + mqtt_clientid + "
"
"Command topic: " MQTTcommand "
"
"Acknowledgements topic: " MQTTack "
"
- "Last command seen: " +
+#ifdef IR_RX
+ "IR Received topic: " MQTTrecv "
"
+#endif // IR_RX
+ "Last MQTT command seen: " +
// lastMqttCmd is unescaped untrusted input.
// Avoid any possible HTML/XSS when displaying it.
(hasUnsafeHTMLChars(lastMqttCmd) ?
@@ -308,10 +448,12 @@ void handleRoot() {
""
""
""
- ""
+ ""
""
- ""
""
+ ""
+ ""
+ ""
""
""
""
@@ -319,6 +461,7 @@ void handleRoot() {
"" // Default
""
""
+ ""
""
""
""
@@ -329,6 +472,7 @@ void handleRoot() {
""
""
""
+ ""
""
""
" Code: 0x24"
""
""
+ ""
""
""
""
@@ -400,38 +545,59 @@ void handleRoot() {
""
" State code: 0x"
- ""
" "
""
- "
"
- "Warning:
"
- "Updating your firmware may screw up your access to the device. "
- "If you are going to use this, know what you are doing first "
- "(and you probably do).
"
- "
"
+ "Warning:
";
+ if (!strcmp(kHtmlPassword, kDefaultPassword)) // Deny if password unchanged
+ html += "OTA firmware is disabled until you change the password. "
+ "(See 'kHtmlPassword' in the source code.)
";
+ else // default password has been changed, so allow it.
+ html +=
+ "Updating your firmware may screw up your access to the device. "
+ "If you are going to use this, know what you are doing first "
+ "(and you probably do).
"
+ "