From 2d673d78ef5a2524b8b03d25d1edaae6bf882411 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Fri, 30 Aug 2019 20:41:01 +0200 Subject: [PATCH] Add 'sonoff-ir' pre-packaged IR-dedicated firmware and 'sonoff-ircustom' to customize firmware with IR Full protocol support --- .travis.yml | 1 + .../.github/CONTRIBUTING.md | 0 .../.github/Contributors.md | 0 .../.github/issue_template.md | 0 .../.gitignore | 3 + .../.gitmodules | 0 .../.style.yapf | 0 .../.travis.yml | 1 + .../CPPLINT.cfg | 0 .../LICENSE.txt | 0 .../README.md | 2 +- .../ReleaseNotes.md | 25 ++ .../SupportedProtocols.md | 11 +- .../CommonAcControl/CommonAcControl.ino | 81 ++++ .../examples/CommonAcControl}/platformio.ini | 0 .../ControlSamsungAC/ControlSamsungAC.ino | 0 .../examples/ControlSamsungAC}/platformio.ini | 0 .../DumbIRRepeater/DumbIRRepeater.ino | 0 .../examples/DumbIRRepeater}/platformio.ini | 0 .../examples/IRGCSendDemo/IRGCSendDemo.ino | 0 .../examples/IRGCSendDemo}/platformio.ini | 0 .../examples/IRGCTCPServer/IRGCTCPServer.ino | 0 .../examples/IRGCTCPServer}/platformio.ini | 0 .../examples/IRMQTTServer/IRMQTTServer.h | 26 +- .../examples/IRMQTTServer/IRMQTTServer.ino | 183 ++++----- .../examples/IRMQTTServer/platformio.ini | 0 .../examples/IRServer/IRServer.ino | 0 .../examples/IRServer}/platformio.ini | 0 .../examples/IRrecvDemo/IRrecvDemo.ino | 0 .../examples/IRrecvDemo}/platformio.ini | 0 .../examples/IRrecvDump/IRrecvDump.ino | 0 .../examples/IRrecvDump}/platformio.ini | 0 .../examples/IRrecvDumpV2/IRrecvDumpV2.ino | 0 .../examples/IRrecvDumpV2}/platformio.ini | 0 .../examples/IRsendDemo/IRsendDemo.ino | 0 .../examples/IRsendDemo}/platformio.ini | 0 .../IRsendProntoDemo/IRsendProntoDemo.ino | 0 .../examples/IRsendProntoDemo}/platformio.ini | 0 .../JVCPanasonicSendDemo.ino | 0 .../JVCPanasonicSendDemo}/platformio.ini | 0 .../examples/LGACSend/LGACSend.ino | 0 .../examples/LGACSend}/platformio.ini | 0 .../SmartIRRepeater/SmartIRRepeater.ino | 0 .../examples/SmartIRRepeater}/platformio.ini | 0 .../examples/TurnOnArgoAC/TurnOnArgoAC.ino | 0 .../examples/TurnOnArgoAC}/platformio.ini | 0 .../TurnOnDaikinAC/TurnOnDaikinAC.ino | 0 .../examples/TurnOnDaikinAC}/platformio.ini | 0 .../TurnOnFujitsuAC/TurnOnFujitsuAC.ino | 0 .../examples/TurnOnFujitsuAC}/platformio.ini | 0 .../TurnOnKelvinatorAC/TurnOnKelvinatorAC.ino | 0 .../TurnOnKelvinatorAC}/platformio.ini | 0 .../TurnOnMitsubishiAC/TurnOnMitsubishiAC.ino | 0 .../TurnOnMitsubishiAC}/platformio.ini | 0 .../TurnOnMitsubishiHeavyAc.ino | 0 .../TurnOnMitsubishiHeavyAc}/platformio.ini | 0 .../TurnOnPanasonicAC/TurnOnPanasonicAC.ino | 0 .../TurnOnPanasonicAC}/platformio.ini | 0 .../TurnOnToshibaAC/TurnOnToshibaAC.ino | 0 .../examples/TurnOnToshibaAC}/platformio.ini | 0 .../TurnOnTrotecAC/TurnOnTrotecAC.ino | 0 .../examples/TurnOnTrotecAC/platformio.ini | 18 + .../keywords.txt | 85 +++++ .../library.json | 2 +- .../library.properties | 2 +- .../pylintrc | 0 .../src/CPPLINT.cfg | 0 .../src/IRac.cpp | 72 +++- .../src/IRac.h | 8 +- .../src/IRrecv.cpp | 49 ++- .../src/IRrecv.h | 67 ++-- .../src/IRremoteESP8266.h | 29 +- .../src/IRsend.cpp | 16 +- .../src/IRsend.h | 19 + .../src/IRtimer.cpp | 0 .../src/IRtimer.h | 0 .../src/IRutils.cpp | 12 + .../src/IRutils.h | 0 .../src/ir_Aiwa.cpp | 0 lib/IRremoteESP8266-2.6.5/src/ir_Amcor.cpp | 326 ++++++++++++++++ lib/IRremoteESP8266-2.6.5/src/ir_Amcor.h | 118 ++++++ .../src/ir_Argo.cpp | 2 +- .../src/ir_Argo.h | 0 .../src/ir_Carrier.cpp | 0 .../src/ir_Coolix.cpp | 0 .../src/ir_Coolix.h | 0 .../src/ir_Daikin.cpp | 160 +++++++- .../src/ir_Daikin.h | 45 ++- .../src/ir_Denon.cpp | 0 .../src/ir_Dish.cpp | 0 .../src/ir_Electra.cpp | 2 +- .../src/ir_Electra.h | 0 .../src/ir_Fujitsu.cpp | 18 +- .../src/ir_Fujitsu.h | 4 +- .../src/ir_GICable.cpp | 0 .../src/ir_GlobalCache.cpp | 0 .../src/ir_Goodweather.cpp | 4 +- .../src/ir_Goodweather.h | 0 .../src/ir_Gree.cpp | 55 ++- .../src/ir_Gree.h | 66 ++-- .../src/ir_Haier.cpp | 2 +- .../src/ir_Haier.h | 0 .../src/ir_Hitachi.cpp | 4 +- .../src/ir_Hitachi.h | 0 .../src/ir_Inax.cpp | 0 .../src/ir_JVC.cpp | 0 .../src/ir_Kelvinator.cpp | 16 +- .../src/ir_Kelvinator.h | 0 .../src/ir_LG.cpp | 2 +- .../src/ir_LG.h | 0 .../src/ir_Lasertag.cpp | 0 .../src/ir_Lego.cpp | 0 .../src/ir_Lutron.cpp | 0 .../src/ir_MWM.cpp | 0 .../src/ir_Magiquest.cpp | 0 .../src/ir_Magiquest.h | 0 .../src/ir_Midea.cpp | 0 .../src/ir_Midea.h | 0 .../src/ir_Mitsubishi.cpp | 7 +- .../src/ir_Mitsubishi.h | 0 .../src/ir_MitsubishiHeavy.cpp | 2 +- .../src/ir_MitsubishiHeavy.h | 0 .../src/ir_NEC.cpp | 0 .../src/ir_NEC.h | 4 + .../src/ir_Neoclima.cpp | 2 +- .../src/ir_Neoclima.h | 0 .../src/ir_Nikai.cpp | 0 .../src/ir_Panasonic.cpp | 0 .../src/ir_Panasonic.h | 0 .../src/ir_Pioneer.cpp | 0 .../src/ir_Pronto.cpp | 0 .../src/ir_RC5_RC6.cpp | 0 .../src/ir_RCMM.cpp | 6 +- .../src/ir_Samsung.cpp | 2 +- .../src/ir_Samsung.h | 0 .../src/ir_Sanyo.cpp | 0 .../src/ir_Sharp.cpp | 2 +- .../src/ir_Sharp.h | 0 .../src/ir_Sherwood.cpp | 0 .../src/ir_Sony.cpp | 0 .../src/ir_Tcl.cpp | 2 +- .../src/ir_Tcl.h | 2 +- .../src/ir_Teco.cpp | 48 ++- .../src/ir_Teco.h | 26 +- .../src/ir_Toshiba.cpp | 2 +- .../src/ir_Toshiba.h | 0 .../src/ir_Trotec.cpp | 2 +- .../src/ir_Trotec.h | 0 .../src/ir_Vestel.cpp | 0 .../src/ir_Vestel.h | 0 .../src/ir_Whirlpool.cpp | 2 +- .../src/ir_Whirlpool.h | 0 .../src/ir_Whynter.cpp | 0 .../test/IRac_test.cpp | 28 +- .../test/IRrecv_test.cpp | 37 ++ .../test/IRrecv_test.h | 0 .../test/IRsend_test.cpp | 0 .../test/IRsend_test.h | 0 .../test/IRutils_test.cpp | 0 .../test/Makefile | 17 +- .../test/ir_Aiwa_test.cpp | 0 .../test/ir_Amcor_test.cpp | 351 ++++++++++++++++++ .../test/ir_Argo_test.cpp | 0 .../test/ir_Carrier_test.cpp | 0 .../test/ir_Coolix_test.cpp | 0 .../test/ir_Daikin_test.cpp | 67 ++++ .../test/ir_Denon_test.cpp | 0 .../test/ir_Dish_test.cpp | 0 .../test/ir_Electra_test.cpp | 0 .../test/ir_Fujitsu_test.cpp | 0 .../test/ir_GICable_test.cpp | 0 .../test/ir_GlobalCache_test.cpp | 0 .../test/ir_Goodweather_test.cpp | 0 .../test/ir_Gree_test.cpp | 51 ++- .../test/ir_Haier_test.cpp | 0 .../test/ir_Hitachi_test.cpp | 0 .../test/ir_Inax_test.cpp | 0 .../test/ir_JVC_test.cpp | 0 .../test/ir_Kelvinator_test.cpp | 0 .../test/ir_LG_test.cpp | 0 .../test/ir_Lasertag_test.cpp | 0 .../test/ir_Lego_test.cpp | 0 .../test/ir_Lutron_test.cpp | 0 .../test/ir_MWM_test.cpp | 0 .../test/ir_Magiquest_test.cpp | 0 .../test/ir_Midea_test.cpp | 0 .../test/ir_MitsubishiHeavy_test.cpp | 0 .../test/ir_Mitsubishi_test.cpp | 0 .../test/ir_NEC_test.cpp | 0 .../test/ir_Neoclima_test.cpp | 0 .../test/ir_Nikai_test.cpp | 0 .../test/ir_Panasonic_test.cpp | 0 .../test/ir_Pioneer_test.cpp | 0 .../test/ir_Pronto_test.cpp | 0 .../test/ir_RC5_RC6_test.cpp | 0 .../test/ir_RCMM_test.cpp | 0 .../test/ir_Samsung_test.cpp | 0 .../test/ir_Sanyo_test.cpp | 0 .../test/ir_Sharp_test.cpp | 0 .../test/ir_Sherwood_test.cpp | 0 .../test/ir_Sony_test.cpp | 0 .../test/ir_Tcl_test.cpp | 0 .../test/ir_Teco_test.cpp | 69 +++- .../test/ir_Toshiba_test.cpp | 0 .../test/ir_Trotec_test.cpp | 0 .../test/ir_Vestel_test.cpp | 0 .../test/ir_Whirlpool_test.cpp | 0 .../test/ir_Whynter_test.cpp | 0 .../tools/Makefile | 5 +- .../tools/RawToGlobalCache.sh | 0 .../tools/auto_analyse_raw_data.py | 0 .../tools/auto_analyse_raw_data_test.py | 0 .../tools/gc_decode.cpp | 0 .../tools/mkkeywords | 0 .../tools/mode2_decode.cpp | 0 .../tools/scrape_supported_devices.py | 0 platformio.ini | 32 ++ sonoff/_changelog.ino | 1 + sonoff/i18n.h | 2 +- sonoff/my_user_config.h | 16 +- sonoff/sonoff_post.h | 75 ++++ 221 files changed, 2117 insertions(+), 279 deletions(-) rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/.github/CONTRIBUTING.md (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/.github/Contributors.md (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/.github/issue_template.md (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/.gitignore (94%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/.gitmodules (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/.style.yapf (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/.travis.yml (97%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/CPPLINT.cfg (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/LICENSE.txt (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/README.md (99%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/ReleaseNotes.md (94%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/SupportedProtocols.md (92%) mode change 100644 => 100755 create mode 100755 lib/IRremoteESP8266-2.6.5/examples/CommonAcControl/CommonAcControl.ino rename lib/{IRremoteESP8266-2.6.4/examples/ControlSamsungAC => IRremoteESP8266-2.6.5/examples/CommonAcControl}/platformio.ini (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/ControlSamsungAC/ControlSamsungAC.ino (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4/examples/DumbIRRepeater => IRremoteESP8266-2.6.5/examples/ControlSamsungAC}/platformio.ini (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/DumbIRRepeater/DumbIRRepeater.ino (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4/examples/IRGCSendDemo => IRremoteESP8266-2.6.5/examples/DumbIRRepeater}/platformio.ini (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/IRGCSendDemo/IRGCSendDemo.ino (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4/examples/IRGCTCPServer => IRremoteESP8266-2.6.5/examples/IRGCSendDemo}/platformio.ini (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/IRGCTCPServer/IRGCTCPServer.ino (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4/examples/IRServer => IRremoteESP8266-2.6.5/examples/IRGCTCPServer}/platformio.ini (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/IRMQTTServer/IRMQTTServer.h (93%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/IRMQTTServer/IRMQTTServer.ino (95%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/IRMQTTServer/platformio.ini (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/IRServer/IRServer.ino (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4/examples/IRrecvDemo => IRremoteESP8266-2.6.5/examples/IRServer}/platformio.ini (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/IRrecvDemo/IRrecvDemo.ino (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4/examples/IRrecvDump => IRremoteESP8266-2.6.5/examples/IRrecvDemo}/platformio.ini (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/IRrecvDump/IRrecvDump.ino (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4/examples/IRrecvDumpV2 => IRremoteESP8266-2.6.5/examples/IRrecvDump}/platformio.ini (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/IRrecvDumpV2/IRrecvDumpV2.ino (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4/examples/IRsendDemo => IRremoteESP8266-2.6.5/examples/IRrecvDumpV2}/platformio.ini (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/IRsendDemo/IRsendDemo.ino (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4/examples/IRsendProntoDemo => IRremoteESP8266-2.6.5/examples/IRsendDemo}/platformio.ini (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/IRsendProntoDemo/IRsendProntoDemo.ino (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4/examples/JVCPanasonicSendDemo => IRremoteESP8266-2.6.5/examples/IRsendProntoDemo}/platformio.ini (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/JVCPanasonicSendDemo/JVCPanasonicSendDemo.ino (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4/examples/LGACSend => IRremoteESP8266-2.6.5/examples/JVCPanasonicSendDemo}/platformio.ini (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/LGACSend/LGACSend.ino (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4/examples/SmartIRRepeater => IRremoteESP8266-2.6.5/examples/LGACSend}/platformio.ini (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/SmartIRRepeater/SmartIRRepeater.ino (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4/examples/TurnOnArgoAC => IRremoteESP8266-2.6.5/examples/SmartIRRepeater}/platformio.ini (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/TurnOnArgoAC/TurnOnArgoAC.ino (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4/examples/TurnOnDaikinAC => IRremoteESP8266-2.6.5/examples/TurnOnArgoAC}/platformio.ini (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/TurnOnDaikinAC/TurnOnDaikinAC.ino (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4/examples/TurnOnFujitsuAC => IRremoteESP8266-2.6.5/examples/TurnOnDaikinAC}/platformio.ini (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/TurnOnFujitsuAC/TurnOnFujitsuAC.ino (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4/examples/TurnOnKelvinatorAC => IRremoteESP8266-2.6.5/examples/TurnOnFujitsuAC}/platformio.ini (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/TurnOnKelvinatorAC/TurnOnKelvinatorAC.ino (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4/examples/TurnOnMitsubishiAC => IRremoteESP8266-2.6.5/examples/TurnOnKelvinatorAC}/platformio.ini (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/TurnOnMitsubishiAC/TurnOnMitsubishiAC.ino (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4/examples/TurnOnMitsubishiHeavyAc => IRremoteESP8266-2.6.5/examples/TurnOnMitsubishiAC}/platformio.ini (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/TurnOnMitsubishiHeavyAc/TurnOnMitsubishiHeavyAc.ino (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4/examples/TurnOnPanasonicAC => IRremoteESP8266-2.6.5/examples/TurnOnMitsubishiHeavyAc}/platformio.ini (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/TurnOnPanasonicAC/TurnOnPanasonicAC.ino (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4/examples/TurnOnToshibaAC => IRremoteESP8266-2.6.5/examples/TurnOnPanasonicAC}/platformio.ini (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/TurnOnToshibaAC/TurnOnToshibaAC.ino (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4/examples/TurnOnTrotecAC => IRremoteESP8266-2.6.5/examples/TurnOnToshibaAC}/platformio.ini (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/examples/TurnOnTrotecAC/TurnOnTrotecAC.ino (100%) mode change 100644 => 100755 create mode 100755 lib/IRremoteESP8266-2.6.5/examples/TurnOnTrotecAC/platformio.ini rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/keywords.txt (97%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/library.json (97%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/library.properties (97%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/pylintrc (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/CPPLINT.cfg (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/IRac.cpp (97%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/IRac.h (98%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/IRrecv.cpp (96%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/IRrecv.h (89%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/IRremoteESP8266.h (96%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/IRsend.cpp (99%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/IRsend.h (95%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/IRtimer.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/IRtimer.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/IRutils.cpp (98%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/IRutils.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Aiwa.cpp (100%) mode change 100644 => 100755 create mode 100755 lib/IRremoteESP8266-2.6.5/src/ir_Amcor.cpp create mode 100755 lib/IRremoteESP8266-2.6.5/src/ir_Amcor.h rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Argo.cpp (99%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Argo.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Carrier.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Coolix.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Coolix.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Daikin.cpp (94%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Daikin.h (94%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Denon.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Dish.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Electra.cpp (99%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Electra.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Fujitsu.cpp (98%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Fujitsu.h (99%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_GICable.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_GlobalCache.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Goodweather.cpp (99%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Goodweather.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Gree.cpp (90%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Gree.h (72%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Haier.cpp (99%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Haier.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Hitachi.cpp (99%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Hitachi.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Inax.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_JVC.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Kelvinator.cpp (97%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Kelvinator.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_LG.cpp (99%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_LG.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Lasertag.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Lego.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Lutron.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_MWM.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Magiquest.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Magiquest.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Midea.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Midea.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Mitsubishi.cpp (99%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Mitsubishi.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_MitsubishiHeavy.cpp (99%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_MitsubishiHeavy.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_NEC.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_NEC.h (93%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Neoclima.cpp (99%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Neoclima.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Nikai.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Panasonic.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Panasonic.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Pioneer.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Pronto.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_RC5_RC6.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_RCMM.cpp (98%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Samsung.cpp (99%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Samsung.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Sanyo.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Sharp.cpp (99%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Sharp.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Sherwood.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Sony.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Tcl.cpp (99%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Tcl.h (98%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Teco.cpp (87%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Teco.h (84%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Toshiba.cpp (99%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Toshiba.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Trotec.cpp (99%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Trotec.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Vestel.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Vestel.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Whirlpool.cpp (99%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Whirlpool.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/src/ir_Whynter.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/IRac_test.cpp (98%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/IRrecv_test.cpp (96%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/IRrecv_test.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/IRsend_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/IRsend_test.h (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/IRutils_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/Makefile (97%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Aiwa_test.cpp (100%) mode change 100644 => 100755 create mode 100755 lib/IRremoteESP8266-2.6.5/test/ir_Amcor_test.cpp rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Argo_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Carrier_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Coolix_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Daikin_test.cpp (96%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Denon_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Dish_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Electra_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Fujitsu_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_GICable_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_GlobalCache_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Goodweather_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Gree_test.cpp (94%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Haier_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Hitachi_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Inax_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_JVC_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Kelvinator_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_LG_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Lasertag_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Lego_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Lutron_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_MWM_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Magiquest_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Midea_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_MitsubishiHeavy_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Mitsubishi_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_NEC_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Neoclima_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Nikai_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Panasonic_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Pioneer_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Pronto_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_RC5_RC6_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_RCMM_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Samsung_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Sanyo_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Sharp_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Sherwood_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Sony_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Tcl_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Teco_test.cpp (86%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Toshiba_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Trotec_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Vestel_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Whirlpool_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/test/ir_Whynter_test.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/tools/Makefile (98%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/tools/RawToGlobalCache.sh (100%) rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/tools/auto_analyse_raw_data.py (100%) rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/tools/auto_analyse_raw_data_test.py (100%) rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/tools/gc_decode.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/tools/mkkeywords (100%) rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/tools/mode2_decode.cpp (100%) mode change 100644 => 100755 rename lib/{IRremoteESP8266-2.6.4 => IRremoteESP8266-2.6.5}/tools/scrape_supported_devices.py (100%) diff --git a/.travis.yml b/.travis.yml index 3e2ea2435..4fb1c1538 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ env: - ENV=sonoff-knx - ENV=sonoff-sensors - ENV=sonoff-display + - ENV=sonoff-ir - ENV=sonoff-BG - ENV=sonoff-BR - ENV=sonoff-CN diff --git a/lib/IRremoteESP8266-2.6.4/.github/CONTRIBUTING.md b/lib/IRremoteESP8266-2.6.5/.github/CONTRIBUTING.md old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/.github/CONTRIBUTING.md rename to lib/IRremoteESP8266-2.6.5/.github/CONTRIBUTING.md diff --git a/lib/IRremoteESP8266-2.6.4/.github/Contributors.md b/lib/IRremoteESP8266-2.6.5/.github/Contributors.md old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/.github/Contributors.md rename to lib/IRremoteESP8266-2.6.5/.github/Contributors.md diff --git a/lib/IRremoteESP8266-2.6.4/.github/issue_template.md b/lib/IRremoteESP8266-2.6.5/.github/issue_template.md old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/.github/issue_template.md rename to lib/IRremoteESP8266-2.6.5/.github/issue_template.md diff --git a/lib/IRremoteESP8266-2.6.4/.gitignore b/lib/IRremoteESP8266-2.6.5/.gitignore old mode 100644 new mode 100755 similarity index 94% rename from lib/IRremoteESP8266-2.6.4/.gitignore rename to lib/IRremoteESP8266-2.6.5/.gitignore index 4441365bc..c02171953 --- a/lib/IRremoteESP8266-2.6.4/.gitignore +++ b/lib/IRremoteESP8266-2.6.5/.gitignore @@ -48,3 +48,6 @@ tools/mode2_decode #Cygwin builds *.exe + +# Mac extended attributes +.DS_Store diff --git a/lib/IRremoteESP8266-2.6.4/.gitmodules b/lib/IRremoteESP8266-2.6.5/.gitmodules old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/.gitmodules rename to lib/IRremoteESP8266-2.6.5/.gitmodules diff --git a/lib/IRremoteESP8266-2.6.4/.style.yapf b/lib/IRremoteESP8266-2.6.5/.style.yapf old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/.style.yapf rename to lib/IRremoteESP8266-2.6.5/.style.yapf diff --git a/lib/IRremoteESP8266-2.6.4/.travis.yml b/lib/IRremoteESP8266-2.6.5/.travis.yml old mode 100644 new mode 100755 similarity index 97% rename from lib/IRremoteESP8266-2.6.4/.travis.yml rename to lib/IRremoteESP8266-2.6.5/.travis.yml index b873bff6e..e8bf3d832 --- a/lib/IRremoteESP8266-2.6.4/.travis.yml +++ b/lib/IRremoteESP8266-2.6.5/.travis.yml @@ -56,6 +56,7 @@ jobs: - arduino --verify --board $BD $PWD/examples/TurnOnMitsubishiHeavyAc/TurnOnMitsubishiHeavyAc.ino 2> /dev/null - arduino --verify --board $BD $PWD/examples/DumbIRRepeater/DumbIRRepeater.ino 2> /dev/null - arduino --verify --board $BD $PWD/examples/SmartIRRepeater/SmartIRRepeater.ino 2> /dev/null + - arduino --verify --board $BD $PWD/examples/CommonAcControl/CommonAcControl.ino 2> /dev/null - script: # Check the version numbers match. - LIB_VERSION=$(egrep "^#define\s+_IRREMOTEESP8266_VERSION_\s+" src/IRremoteESP8266.h | cut -d\" -f2) diff --git a/lib/IRremoteESP8266-2.6.4/CPPLINT.cfg b/lib/IRremoteESP8266-2.6.5/CPPLINT.cfg old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/CPPLINT.cfg rename to lib/IRremoteESP8266-2.6.5/CPPLINT.cfg diff --git a/lib/IRremoteESP8266-2.6.4/LICENSE.txt b/lib/IRremoteESP8266-2.6.5/LICENSE.txt old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/LICENSE.txt rename to lib/IRremoteESP8266-2.6.5/LICENSE.txt diff --git a/lib/IRremoteESP8266-2.6.4/README.md b/lib/IRremoteESP8266-2.6.5/README.md old mode 100644 new mode 100755 similarity index 99% rename from lib/IRremoteESP8266-2.6.4/README.md rename to lib/IRremoteESP8266-2.6.5/README.md index 4aa0093c6..c4cb31515 --- a/lib/IRremoteESP8266-2.6.4/README.md +++ b/lib/IRremoteESP8266-2.6.5/README.md @@ -9,7 +9,7 @@ This library enables you to **send _and_ receive** infra-red signals on an [ESP8266](https://github.com/esp8266/Arduino) or an [ESP32](https://github.com/espressif/arduino-esp32) using the [Arduino framework](https://www.arduino.cc/) using common 940nm IR LEDs and common IR receiver modules. e.g. TSOP{17,22,24,36,38,44,48}* demodulators etc. -## v2.6.4 Now Available +## v2.6.5 Now Available Version 2.6.4 of the library is now [available](https://github.com/crankyoldgit/IRremoteESP8266/releases/latest). You can view the [Release Notes](ReleaseNotes.md) for all the significant changes. #### Upgrading from pre-v2.0 diff --git a/lib/IRremoteESP8266-2.6.4/ReleaseNotes.md b/lib/IRremoteESP8266-2.6.5/ReleaseNotes.md old mode 100644 new mode 100755 similarity index 94% rename from lib/IRremoteESP8266-2.6.4/ReleaseNotes.md rename to lib/IRremoteESP8266-2.6.5/ReleaseNotes.md index 1526303a2..5672d2483 --- a/lib/IRremoteESP8266-2.6.4/ReleaseNotes.md +++ b/lib/IRremoteESP8266-2.6.5/ReleaseNotes.md @@ -1,5 +1,30 @@ # Release Notes +## _v2.6.5 (20190828)_ + +**[Bug Fixes]** +- IRMQTTServer: Remove duplicate MQTT_CLIMATE from HA discovery (#869) +- Fujitsu: Ensure `on()` is called in common a/c framework. (#862) +- Update `strToModel()` (#861) +- IRMQTTServer: Add missing header file. (#858) +- IRMQTTServer: Fix a compile error when HTML_PASSWORD_ENABLE is enabled. (#856) + +**[Features]** +- IRrecv: Allow tolerance percentage to be set at run-time. (#865) +- Basic support for Daikin152 A/C protocol. (#874) +- Teco: Add light, humid, & save support. (#871) +- Detailed support for Amcor A/C protocol. (#836, #854) +- IRMQTTServer: Add ability to report Vcc at the ESP chip. (#845) +- Gree: Add timer support. (#849) +- IRac/Mitsubishi A/C: Support wide `swingh_t` mode (#844) +- IRMQTTServer: Generate protocol and bit size html selects (#838) + +**[Misc]** +- New example code to show how to use the `IRac` class to control A/Cs (#839) +- Improve/fix `swingh_t::kWide` support (#846) +- Kelvinator: Optimise code a little to save space. (#843) + + ## _v2.6.4 (20190726)_ **[Bug Fixes]** diff --git a/lib/IRremoteESP8266-2.6.4/SupportedProtocols.md b/lib/IRremoteESP8266-2.6.5/SupportedProtocols.md old mode 100644 new mode 100755 similarity index 92% rename from lib/IRremoteESP8266-2.6.4/SupportedProtocols.md rename to lib/IRremoteESP8266-2.6.5/SupportedProtocols.md index 9d297d523..c9d286973 --- a/lib/IRremoteESP8266-2.6.4/SupportedProtocols.md +++ b/lib/IRremoteESP8266-2.6.5/SupportedProtocols.md @@ -1,16 +1,17 @@ + Last generated: Wed Aug 28 12:37:20 2019 ---> # IR Protocols supported by this library | Protocol | Brand | Model | A/C Model | Detailed A/C Support | | --- | --- | --- | --- | --- | | [Aiwa](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Aiwa.cpp) | **Aiwa** | RC-T501 RCU | | - | +| [Amcor](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Amcor.cpp) | **[Amcor](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Amcor.h)** | ADR-853H A/C
ADR-853H A/C
TAC-444 remote
TAC-444 remote
TAC-495 remote
TAC-495 remote | | Yes | | [Argo](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Argo.cpp) | **[Argo](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Argo.h)** | Ulisse 13 DCI Mobile Split A/C | | Yes | | [Carrier](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Carrier.cpp) | **Carrier/Surrey** | 42QG5A55970 remote
53NGK009/012 Inverter
619EGX0090E0 A/C
619EGX0120E0 A/C
619EGX0180E0 A/C
619EGX0220E0 A/C | | - | | [Coolix](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Coolix.cpp) | **[Beko](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Coolix.h)** | BINR 070/071 split-type A/C
BINR 070/071 split-type A/C
RG57K7(B)/BGEF Remote
RG57K7(B)/BGEF Remote | | Yes | | [Coolix](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Coolix.cpp) | **[Midea](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Coolix.h)** | MS12FU-10HRDN1-QRD0GW(B) A/C
MS12FU-10HRDN1-QRD0GW(B) A/C
MSABAU-07HRFN1-QRD0GW A/C (circa 2016)
MSABAU-07HRFN1-QRD0GW A/C (circa 2016)
RG52D/BGE Remote
RG52D/BGE Remote | | Yes | -| [Daikin](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Daikin.cpp) | **[Daikin](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Daikin.h)** | 17 Series A/C (DAIKIN128)
ARC423A5 remote
ARC433** remote
ARC433B69 remote
ARC477A1 remote
BRC4C153 remote
BRC52B63 remote (DAIKIN128)
FTE12HV2S A/C
FTXB09AXVJU A/C (DAIKIN128)
FTXB12AXVJU A/C (DAIKIN128)
FTXZ25NV1B A/C
FTXZ35NV1B A/C
FTXZ50NV1B A/C | | Yes | +| [Daikin](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Daikin.cpp) | **[Daikin](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Daikin.h)** | 17 Series A/C (DAIKIN128)
ARC423A5 remote
ARC433** remote
ARC433B69 remote
ARC477A1 remote
ARC480A5 remote (DAIKIN152)
BRC4C153 remote
BRC52B63 remote (DAIKIN128)
FTE12HV2S A/C
FTXB09AXVJU A/C (DAIKIN128)
FTXB12AXVJU A/C (DAIKIN128)
FTXZ25NV1B A/C
FTXZ35NV1B A/C
FTXZ50NV1B A/C | | Yes | | [Denon](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Denon.cpp) | **Unknown** | | | - | | [Dish](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Dish.cpp) | **DISH NETWORK** | echostar 301 | | - | | [Electra](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Electra.cpp) | **[AUX](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Electra.h)** | KFR-35GW/BpNFW=3 A/C
YKR-T/011 remote | | Yes | @@ -40,7 +41,7 @@ | [Midea](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Midea.cpp) | **[Pioneer System](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Midea.h)** | RUBO18GMFILCAD A/C (18K BTU)
RYBO12GMFILCAD A/C (12K BTU) | | Yes | | [Mitsubishi](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Mitsubishi.cpp) | **[Mitsubishi](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Mitsubishi.h)** | HC3000 Projector
TV | | Yes | | [MitsubishiHeavy](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_MitsubishiHeavy.cpp) | **[Mitsubishi Heavy Industries](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_MitsubishiHeavy.h)** | RKX502A001C remote
RLA502A700B remote
SRKxxZJ-S A/C
SRKxxZM-S A/C
SRKxxZMXA-S A/C | | Yes | -| [NEC](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_NEC.cpp) | **[Unknown](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_NEC.h)** | | | Yes | +| [NEC](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_NEC.cpp) | **[Yamaha](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_NEC.h)** | RAV561 remote
RXV585B A/V Receiver | | Yes | | [Neoclima](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Neoclima.cpp) | **[Neoclima](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Neoclima.h)** | NS-09AHTI A/C
NS-09AHTI A/C
ZH/TY-01 remote
ZH/TY-01 remote | | Yes | | [Nikai](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Nikai.cpp) | **Unknown** | | | - | | [Panasonic](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Panasonic.cpp) | **[Panasonic](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Panasonic.h)** | A75C2311 remote (CKP)
A75C3704 remote
A75C3747 remote
A75C3747 remote
A75C3747 remote
A75C3747 remote
CKP series A/C
CS-ME10CKPG A/C
CS-ME12CKPG A/C
CS-ME14CKPG A/C
CS-YW9MKD A/C
CS-Z9RKR A/C
DKE series A/C
JKE series A/C
NKE series A/C
RKR series A/C
TV | CKP
DKE
JKE
LKE
NKE
RKR | Yes | @@ -54,7 +55,7 @@ | [Sherwood](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Sherwood.cpp) | **Sherwood** | RC-138 remote
RD6505(B) Receiver | | - | | [Sony](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Sony.cpp) | **Unknown** | | | - | | [Tcl](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Tcl.cpp) | **[Leberg](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Tcl.h)** | LBS-TOR07 A/C | | Yes | -| [Teco](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Teco.cpp) | **[Unknown](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Teco.h)** | | | Yes | +| [Teco](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Teco.cpp) | **[Alaska](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Teco.h)** | SAC9010QC A/C
SAC9010QC remote | | Yes | | [Toshiba](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Toshiba.cpp) | **[Toshiba](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Toshiba.h)** | Akita EVO II
RAS 18SKP-ES
RAS-B13N3KV2
RAS-B13N3KVP-E
WC-L03SE
WH-TA04NE | | Yes | | [Trotec](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Trotec.cpp) | **[Unknown](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Trotec.h)** | | | Yes | | [Vestel](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Vestel.cpp) | **[Vestel](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Vestel.h)** | BIOX CXP-9 A/C (9K BTU) | | Yes | @@ -73,11 +74,13 @@ ## Send & decodable protocols: - AIWA_RC_T501 +- AMCOR - ARGO - CARRIER_AC - COOLIX - DAIKIN - DAIKIN128 +- DAIKIN152 - DAIKIN160 - DAIKIN176 - DAIKIN2 diff --git a/lib/IRremoteESP8266-2.6.5/examples/CommonAcControl/CommonAcControl.ino b/lib/IRremoteESP8266-2.6.5/examples/CommonAcControl/CommonAcControl.ino new file mode 100755 index 000000000..6f0416b51 --- /dev/null +++ b/lib/IRremoteESP8266-2.6.5/examples/CommonAcControl/CommonAcControl.ino @@ -0,0 +1,81 @@ +/* Copyright 2019 David Conran +* +* This example code demonstrates how to use the "Common" IRac class to control +* various air conditions. The IRac class does not support all the features +* for every protocol. Some have more detailed support that what the "Common" +* interface offers, and some only have a limited subset of the "Common" options. +* +* This example code will: +* o Try to turn on, then off every fully supported A/C protocol we know of. +* o It will try to put the A/C unit into Cooling mode at 25C, with a medium +* fan speed, and no fan swinging. +* Note: Some protocols support multiple models, only the first model is tried. +* +*/ +#include +#include +#include +#include + +const uint16_t kIrLed = 4; // The ESP GPIO pin to use that controls the IR LED. +IRac ac(kIrLed); // Create a A/C object using GPIO to sending messages with. +stdAc::state_t state; // Where we will store the desired state of the A/C. +stdAc::state_t prev; // Where we will store the previous state of the A/C. + +void setup() { + Serial.begin(115200); + delay(200); + + // Set up what we want to send. + // See state_t, opmode_t, fanspeed_t, swingv_t, & swingh_t in IRsend.h for + // all the various options. + state.protocol = decode_type_t::DAIKIN; // Set a protocol to use. + state.model = 1; // Some A/C's have different models. Let's try using just 1. + state.mode = stdAc::opmode_t::kCool; // Run in cool mode initially. + state.celsius = true; // Use Celsius for units of temp. False = Fahrenheit + state.degrees = 25; // 25 degrees. + state.fanspeed = stdAc::fanspeed_t::kMedium; // Start with the fan at medium. + state.swingv = stdAc::swingv_t::kOff; // Don't swing the fan up or down. + state.swingh = stdAc::swingh_t::kOff; // Don't swing the fan left or right. + state.light = false; // Turn off any LED/Lights/Display that we can. + state.beep = false; // Turn off any beep from the A/C if we can. + state.econo = false; // Turn off any economy modes if we can. + state.filter = false; // Turn off any Ion/Mold/Health filters if we can. + state.turbo = false; // Don't use any turbo/powerful/etc modes. + state.quiet = false; // Don't use any quiet/silent/etc modes. + state.sleep = -1; // Don't set any sleep time or modes. + state.clean = false; // Turn off any Cleaning options if we can. + state.clock = -1; // Don't set any current time if we can avoid it. + state.power = false; // Initially start with the unit off. + + prev = state; // Make sure we have a valid previous state. +} + +void loop() { + // For every protocol the library has ... + for (int i = 1; i < kLastDecodeType; i++) { + decode_type_t protocol = (decode_type_t)i; + // If the protocol is supported by the IRac class ... + if (ac.isProtocolSupported(protocol)) { + state.protocol = protocol; // Change the protocol used. + + Serial.println("Protocol " + String(protocol) + " / " + + typeToString(protocol)); + state.power = true; // We want to turn on the A/C unit. + // Have the IRac class create and send a message. + // We need a `prev` state as some A/Cs use toggle messages. + // e.g. On & Off are the same message. When given the previous state, + // it will try to do the correct thing for you. + ac.sendAc(state, &prev); // Construct and send the message. + Serial.println("Sent a message to turn ON the A/C unit."); + prev = state; // Copy new state over the previous one. + delay(5000); // Wait 5 seconds. + state.power = false; // Now we want to turn the A/C off. + ac.sendAc(state, &prev); // Construct and send the message. + Serial.println("Sent a message to turn OFF the A/C unit."); + prev = state; // Copy new state over the previous one. + delay(1000); // Wait 1 second. + } + } + Serial.println("Starting from the begining again ..."); +} diff --git a/lib/IRremoteESP8266-2.6.4/examples/ControlSamsungAC/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/CommonAcControl/platformio.ini old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/ControlSamsungAC/platformio.ini rename to lib/IRremoteESP8266-2.6.5/examples/CommonAcControl/platformio.ini diff --git a/lib/IRremoteESP8266-2.6.4/examples/ControlSamsungAC/ControlSamsungAC.ino b/lib/IRremoteESP8266-2.6.5/examples/ControlSamsungAC/ControlSamsungAC.ino old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/ControlSamsungAC/ControlSamsungAC.ino rename to lib/IRremoteESP8266-2.6.5/examples/ControlSamsungAC/ControlSamsungAC.ino diff --git a/lib/IRremoteESP8266-2.6.4/examples/DumbIRRepeater/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/ControlSamsungAC/platformio.ini old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/DumbIRRepeater/platformio.ini rename to lib/IRremoteESP8266-2.6.5/examples/ControlSamsungAC/platformio.ini diff --git a/lib/IRremoteESP8266-2.6.4/examples/DumbIRRepeater/DumbIRRepeater.ino b/lib/IRremoteESP8266-2.6.5/examples/DumbIRRepeater/DumbIRRepeater.ino old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/DumbIRRepeater/DumbIRRepeater.ino rename to lib/IRremoteESP8266-2.6.5/examples/DumbIRRepeater/DumbIRRepeater.ino diff --git a/lib/IRremoteESP8266-2.6.4/examples/IRGCSendDemo/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/DumbIRRepeater/platformio.ini old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/IRGCSendDemo/platformio.ini rename to lib/IRremoteESP8266-2.6.5/examples/DumbIRRepeater/platformio.ini diff --git a/lib/IRremoteESP8266-2.6.4/examples/IRGCSendDemo/IRGCSendDemo.ino b/lib/IRremoteESP8266-2.6.5/examples/IRGCSendDemo/IRGCSendDemo.ino old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/IRGCSendDemo/IRGCSendDemo.ino rename to lib/IRremoteESP8266-2.6.5/examples/IRGCSendDemo/IRGCSendDemo.ino diff --git a/lib/IRremoteESP8266-2.6.4/examples/IRGCTCPServer/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/IRGCSendDemo/platformio.ini old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/IRGCTCPServer/platformio.ini rename to lib/IRremoteESP8266-2.6.5/examples/IRGCSendDemo/platformio.ini diff --git a/lib/IRremoteESP8266-2.6.4/examples/IRGCTCPServer/IRGCTCPServer.ino b/lib/IRremoteESP8266-2.6.5/examples/IRGCTCPServer/IRGCTCPServer.ino old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/IRGCTCPServer/IRGCTCPServer.ino rename to lib/IRremoteESP8266-2.6.5/examples/IRGCTCPServer/IRGCTCPServer.ino diff --git a/lib/IRremoteESP8266-2.6.4/examples/IRServer/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/IRGCTCPServer/platformio.ini old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/IRServer/platformio.ini rename to lib/IRremoteESP8266-2.6.5/examples/IRGCTCPServer/platformio.ini diff --git a/lib/IRremoteESP8266-2.6.4/examples/IRMQTTServer/IRMQTTServer.h b/lib/IRremoteESP8266-2.6.5/examples/IRMQTTServer/IRMQTTServer.h old mode 100644 new mode 100755 similarity index 93% rename from lib/IRremoteESP8266-2.6.4/examples/IRMQTTServer/IRMQTTServer.h rename to lib/IRremoteESP8266-2.6.5/examples/IRMQTTServer/IRMQTTServer.h index de3158a4b..73821dc05 --- a/lib/IRremoteESP8266-2.6.4/examples/IRMQTTServer/IRMQTTServer.h +++ b/lib/IRremoteESP8266-2.6.5/examples/IRMQTTServer/IRMQTTServer.h @@ -5,6 +5,9 @@ #ifndef EXAMPLES_IRMQTTSERVER_IRMQTTSERVER_H_ #define EXAMPLES_IRMQTTSERVER_IRMQTTSERVER_H_ +#if defined(ESP8266) +#include +#endif // ESP8266 #include #include #include @@ -156,6 +159,16 @@ const uint16_t kMinUnknownSize = 2 * 10; // ------------------------ Advanced Usage Only -------------------------------- +// Reports the input voltage to the ESP chip. **NOT** the input voltage +// to the development board (e.g. NodeMCU, D1 Mini etc) which are typically +// powered by USB (5V) which is then lowered to 3V via a Low Drop Out (LDO) +// Voltage regulator. Hence, this feature is turned off by default as it +// make little sense for most users as it really isn't the actual input voltage. +// E.g. For purposes of monitoring a battery etc. +// Note: Turning on the feature costs ~250 bytes of prog space. +#define REPORT_VCC false // Do we report Vcc via html info page & MQTT? + +// Keywords for MQTT topics, html arguments, or config file. #define KEY_PROTOCOL "protocol" #define KEY_MODEL "model" #define KEY_POWER "power" @@ -175,6 +188,7 @@ const uint16_t kMinUnknownSize = 2 * 10; #define KEY_CELSIUS "use_celsius" #define KEY_JSON "json" #define KEY_RESEND "resend" +#define KEY_VCC "vcc" // HTML arguments we will parse for IR code information. #define KEY_TYPE "type" // KEY_PROTOCOL is also checked too. @@ -206,11 +220,14 @@ const uint8_t kPasswordLength = 20; // ----------------- End of User Configuration Section ------------------------- // Constants -#define _MY_VERSION_ "v1.3.3" +#define _MY_VERSION_ "v1.3.4" const uint8_t kRebootTime = 15; // Seconds const uint8_t kQuickDisplayTime = 2; // Seconds +// Common bit sizes for the simple protocols. +const uint8_t kCommonBitSizes[] = { + 12, 13, 15, 16, 20, 24, 28, 32, 35, 36, 42, 48, 56, 64}; // Gpio related #if defined(ESP8266) const int8_t kTxGpios[] = {-1, 0, 1, 2, 3, 4, 5, 12, 13, 14, 15, 16}; @@ -294,6 +311,9 @@ void sendJsonState(const stdAc::state_t state, const String topic, const bool retain = false, const bool ha_mode = true); #endif // MQTT_CLIMATE_JSON #endif // MQTT_ENABLE +#if REPORT_VCC +String vccToString(void); +#endif // REPORT_VCC bool isSerialGpioUsedByIr(void); void debug(const char *str); void saveWifiConfigCallback(void); @@ -319,7 +339,9 @@ String addJsReloadUrl(const String url, const uint16_t timeout_s, const bool notify); void handleExamples(void); String htmlSelectBool(const String name, const bool def); -String htmlSelectProtocol(const String name, const decode_type_t def); +String htmlSelectClimateProtocol(const String name, const decode_type_t def); +String htmlSelectAcStateProtocol(const String name, const decode_type_t def, + const bool simple); String htmlSelectModel(const String name, const int16_t def); String htmlSelectMode(const String name, const stdAc::opmode_t def); String htmlSelectFanspeed(const String name, const stdAc::fanspeed_t def); diff --git a/lib/IRremoteESP8266-2.6.4/examples/IRMQTTServer/IRMQTTServer.ino b/lib/IRremoteESP8266-2.6.5/examples/IRMQTTServer/IRMQTTServer.ino old mode 100644 new mode 100755 similarity index 95% rename from lib/IRremoteESP8266-2.6.4/examples/IRMQTTServer/IRMQTTServer.ino rename to lib/IRremoteESP8266-2.6.5/examples/IRMQTTServer/IRMQTTServer.ino index c4208af45..730a8965f --- a/lib/IRremoteESP8266-2.6.4/examples/IRMQTTServer/IRMQTTServer.ino +++ b/lib/IRremoteESP8266-2.6.5/examples/IRMQTTServer/IRMQTTServer.ino @@ -347,6 +347,10 @@ using irutils::msToString; +#if REPORT_VCC + ADC_MODE(ADC_VCC); +#endif // REPORT_VCC + // Globals #if defined(ESP8266) ESP8266WebServer server(kHttpPort); @@ -650,6 +654,26 @@ String htmlMenu(void) { return html; } +String htmlSelectAcStateProtocol(const String name, const decode_type_t def, + const bool simple) { + String html = ""); + return html; +} + // Root web page with example usage etc. void handleRoot(void) { #if HTML_PASSWORD_ENABLE @@ -664,65 +688,23 @@ void handleRoot(void) { html += F( "

Send a simple IR message

" "

" - "Type: " - "" + "Type: "); + html += htmlSelectAcStateProtocol(KEY_TYPE, decode_type_t::NEC, true); + html += F( " Code: 0x" " Bit size: " "" " Repeats: " @@ -731,36 +713,9 @@ void handleRoot(void) { "

" "

Send a complex (Air Conditioner) IR message

" "" - "Type: " - "" + "Type: "); + html += htmlSelectAcStateProtocol(KEY_TYPE, decode_type_t::KELVINATOR, false); + html += F( " State code: 0x" ""; for (uint8_t i = 1; i <= decode_type_t::kLastDecodeType; i++) { if (IRac::isProtocolSupported((decode_type_t)i)) { @@ -962,7 +917,7 @@ String htmlSelectGpio(const String name, const int16_t def, String htmlSelectMode(const String name, const stdAc::opmode_t def) { String html = ""; - for (int8_t i = 0; i <= 5; i++) { + for (int8_t i = 0; i <= (int8_t)stdAc::fanspeed_t::kLastFanspeedEnum; i++) { String speed = IRac::fanspeedToString((stdAc::fanspeed_t)i); html += htmlOptionItem(speed, speed, (stdAc::fanspeed_t)i == def); } @@ -982,7 +937,7 @@ String htmlSelectFanspeed(const String name, const stdAc::fanspeed_t def) { String htmlSelectSwingv(const String name, const stdAc::swingv_t def) { String html = ""; - for (int8_t i = -1; i <= 5; i++) { + for (int8_t i = -1; i <= (int8_t)stdAc::swingh_t::kLastSwinghEnum; i++) { String swing = IRac::swinghToString((stdAc::swingh_t)i); html += htmlOptionItem(swing, swing, (stdAc::swingh_t)i == def); } @@ -1034,7 +989,8 @@ void handleAirCon(void) { "" "" "" + htmlSelectClimateProtocol(KEY_PROTOCOL, climate.protocol) + + "" "" "
Protocol" + - htmlSelectProtocol(KEY_PROTOCOL, climate.protocol) + "
Model" + htmlSelectModel(KEY_MODEL, climate.model) + "
Power" + htmlSelectBool(KEY_POWER, climate.power) + @@ -1169,6 +1125,10 @@ uint32_t maxSketchSpace(void) { #endif // defined(ESP8266) } +#if REPORT_VCC +String vccToString(void) { return String(ESP.getVcc() / 1000.0); } +#endif // REPORT_VCC + // Info web page void handleInfo(void) { String html = htmlHeader(F("IR MQTT server info")); @@ -1223,6 +1183,11 @@ void handleInfo(void) { "Off" #endif // DEBUG "
" +#if REPORT_VCC + "Vcc: "; + html += vccToString(); + html += "V
" +#endif // REPORT_VCC "

" #if MQTT_ENABLE "

MQTT Information

" @@ -1300,7 +1265,8 @@ void doRestart(const char* str, const bool serial_only) { void handleReset(void) { #if HTML_PASSWORD_ENABLE if (!server.authenticate(HttpUsername, HttpPassword)) { - debug("Basic HTTP authentication failure for " + kUrlWipe); + debug(("Basic HTTP authentication failure for " + + String(kUrlWipe)).c_str()); return server.requestAuthentication(); } #endif @@ -1329,7 +1295,8 @@ void handleReset(void) { void handleReboot() { #if HTML_PASSWORD_ENABLE if (!server.authenticate(HttpUsername, HttpPassword)) { - debug("Basic HTTP authentication failure for " + kUrlReboot); + debug(("Basic HTTP authentication failure for " + + String(kUrlReboot)).c_str()); return server.requestAuthentication(); } #endif @@ -2215,6 +2182,9 @@ void doBroadcast(TimerMs *timer, const uint32_t interval, debug("Sending MQTT stat update broadcast."); sendClimate(state, state, MqttClimateStat, retain, true, false); +#if REPORT_VCC + sendString(MqttClimateStat + KEY_VCC, vccToString(), false); +#endif // REPORT_VCC #if MQTT_CLIMATE_JSON sendJsonState(state, MqttClimateStat + KEY_JSON); #endif // MQTT_CLIMATE_JSON @@ -2370,29 +2340,22 @@ void sendMQTTDiscovery(const char *topic) { "{" "\"~\":\"" + MqttClimate + "\"," "\"name\":\"" + MqttHAName + "\"," - "\"pow_cmd_t\":\"~" MQTT_CLIMATE "/" MQTT_CLIMATE_CMND "/" KEY_POWER "\"," - "\"mode_cmd_t\":\"~" MQTT_CLIMATE "/" MQTT_CLIMATE_CMND "/" KEY_MODE "\"," - "\"mode_stat_t\":\"~" MQTT_CLIMATE "/" MQTT_CLIMATE_STAT "/" KEY_MODE - "\"," + "\"pow_cmd_t\":\"~/" MQTT_CLIMATE_CMND "/" KEY_POWER "\"," + "\"mode_cmd_t\":\"~/" MQTT_CLIMATE_CMND "/" KEY_MODE "\"," + "\"mode_stat_t\":\"~/" MQTT_CLIMATE_STAT "/" KEY_MODE "\"," "\"modes\":[\"off\",\"auto\",\"cool\",\"heat\",\"dry\",\"fan_only\"]," - "\"temp_cmd_t\":\"~" MQTT_CLIMATE "/" MQTT_CLIMATE_CMND "/" KEY_TEMP "\"," - "\"temp_stat_t\":\"~" MQTT_CLIMATE "/" MQTT_CLIMATE_STAT "/" KEY_TEMP - "\"," + "\"temp_cmd_t\":\"~/" MQTT_CLIMATE_CMND "/" KEY_TEMP "\"," + "\"temp_stat_t\":\"~/" MQTT_CLIMATE_STAT "/" KEY_TEMP "\"," "\"min_temp\":\"16\"," "\"max_temp\":\"30\"," "\"temp_step\":\"1\"," - "\"fan_mode_cmd_t\":\"~" MQTT_CLIMATE "/" MQTT_CLIMATE_CMND "/" - KEY_FANSPEED "\"," - "\"fan_mode_stat_t\":\"~" MQTT_CLIMATE "/" MQTT_CLIMATE_STAT "/" - KEY_FANSPEED "\"," + "\"fan_mode_cmd_t\":\"~/" MQTT_CLIMATE_CMND "/" KEY_FANSPEED "\"," + "\"fan_mode_stat_t\":\"~/" MQTT_CLIMATE_STAT "/" KEY_FANSPEED "\"," "\"fan_modes\":[\"auto\",\"min\",\"low\",\"medium\",\"high\",\"max\"]," - "\"swing_mode_cmd_t\":\"~" MQTT_CLIMATE "/" MQTT_CLIMATE_CMND "/" - KEY_SWINGV "\"," - "\"swing_mode_stat_t\":\"~" MQTT_CLIMATE "/" MQTT_CLIMATE_STAT "/" - KEY_SWINGV "\"," + "\"swing_mode_cmd_t\":\"~/" MQTT_CLIMATE_CMND "/" KEY_SWINGV "\"," + "\"swing_mode_stat_t\":\"~/" MQTT_CLIMATE_STAT "/" KEY_SWINGV "\"," "\"swing_modes\":[" - "\"off\",\"auto\",\"highest\",\"high\",\"middle\",\"low\",\"lowest\"" - "]" + "\"off\",\"auto\",\"highest\",\"high\",\"middle\",\"low\",\"lowest\"]" "}").c_str())) { mqttLog("MQTT climate discovery successful sent."); hasDiscoveryBeenSent = true; diff --git a/lib/IRremoteESP8266-2.6.4/examples/IRMQTTServer/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/IRMQTTServer/platformio.ini old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/IRMQTTServer/platformio.ini rename to lib/IRremoteESP8266-2.6.5/examples/IRMQTTServer/platformio.ini diff --git a/lib/IRremoteESP8266-2.6.4/examples/IRServer/IRServer.ino b/lib/IRremoteESP8266-2.6.5/examples/IRServer/IRServer.ino old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/IRServer/IRServer.ino rename to lib/IRremoteESP8266-2.6.5/examples/IRServer/IRServer.ino diff --git a/lib/IRremoteESP8266-2.6.4/examples/IRrecvDemo/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/IRServer/platformio.ini old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/IRrecvDemo/platformio.ini rename to lib/IRremoteESP8266-2.6.5/examples/IRServer/platformio.ini diff --git a/lib/IRremoteESP8266-2.6.4/examples/IRrecvDemo/IRrecvDemo.ino b/lib/IRremoteESP8266-2.6.5/examples/IRrecvDemo/IRrecvDemo.ino old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/IRrecvDemo/IRrecvDemo.ino rename to lib/IRremoteESP8266-2.6.5/examples/IRrecvDemo/IRrecvDemo.ino diff --git a/lib/IRremoteESP8266-2.6.4/examples/IRrecvDump/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/IRrecvDemo/platformio.ini old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/IRrecvDump/platformio.ini rename to lib/IRremoteESP8266-2.6.5/examples/IRrecvDemo/platformio.ini diff --git a/lib/IRremoteESP8266-2.6.4/examples/IRrecvDump/IRrecvDump.ino b/lib/IRremoteESP8266-2.6.5/examples/IRrecvDump/IRrecvDump.ino old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/IRrecvDump/IRrecvDump.ino rename to lib/IRremoteESP8266-2.6.5/examples/IRrecvDump/IRrecvDump.ino diff --git a/lib/IRremoteESP8266-2.6.4/examples/IRrecvDumpV2/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/IRrecvDump/platformio.ini old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/IRrecvDumpV2/platformio.ini rename to lib/IRremoteESP8266-2.6.5/examples/IRrecvDump/platformio.ini diff --git a/lib/IRremoteESP8266-2.6.4/examples/IRrecvDumpV2/IRrecvDumpV2.ino b/lib/IRremoteESP8266-2.6.5/examples/IRrecvDumpV2/IRrecvDumpV2.ino old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/IRrecvDumpV2/IRrecvDumpV2.ino rename to lib/IRremoteESP8266-2.6.5/examples/IRrecvDumpV2/IRrecvDumpV2.ino diff --git a/lib/IRremoteESP8266-2.6.4/examples/IRsendDemo/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/IRrecvDumpV2/platformio.ini old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/IRsendDemo/platformio.ini rename to lib/IRremoteESP8266-2.6.5/examples/IRrecvDumpV2/platformio.ini diff --git a/lib/IRremoteESP8266-2.6.4/examples/IRsendDemo/IRsendDemo.ino b/lib/IRremoteESP8266-2.6.5/examples/IRsendDemo/IRsendDemo.ino old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/IRsendDemo/IRsendDemo.ino rename to lib/IRremoteESP8266-2.6.5/examples/IRsendDemo/IRsendDemo.ino diff --git a/lib/IRremoteESP8266-2.6.4/examples/IRsendProntoDemo/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/IRsendDemo/platformio.ini old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/IRsendProntoDemo/platformio.ini rename to lib/IRremoteESP8266-2.6.5/examples/IRsendDemo/platformio.ini diff --git a/lib/IRremoteESP8266-2.6.4/examples/IRsendProntoDemo/IRsendProntoDemo.ino b/lib/IRremoteESP8266-2.6.5/examples/IRsendProntoDemo/IRsendProntoDemo.ino old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/IRsendProntoDemo/IRsendProntoDemo.ino rename to lib/IRremoteESP8266-2.6.5/examples/IRsendProntoDemo/IRsendProntoDemo.ino diff --git a/lib/IRremoteESP8266-2.6.4/examples/JVCPanasonicSendDemo/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/IRsendProntoDemo/platformio.ini old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/JVCPanasonicSendDemo/platformio.ini rename to lib/IRremoteESP8266-2.6.5/examples/IRsendProntoDemo/platformio.ini diff --git a/lib/IRremoteESP8266-2.6.4/examples/JVCPanasonicSendDemo/JVCPanasonicSendDemo.ino b/lib/IRremoteESP8266-2.6.5/examples/JVCPanasonicSendDemo/JVCPanasonicSendDemo.ino old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/JVCPanasonicSendDemo/JVCPanasonicSendDemo.ino rename to lib/IRremoteESP8266-2.6.5/examples/JVCPanasonicSendDemo/JVCPanasonicSendDemo.ino diff --git a/lib/IRremoteESP8266-2.6.4/examples/LGACSend/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/JVCPanasonicSendDemo/platformio.ini old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/LGACSend/platformio.ini rename to lib/IRremoteESP8266-2.6.5/examples/JVCPanasonicSendDemo/platformio.ini diff --git a/lib/IRremoteESP8266-2.6.4/examples/LGACSend/LGACSend.ino b/lib/IRremoteESP8266-2.6.5/examples/LGACSend/LGACSend.ino old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/LGACSend/LGACSend.ino rename to lib/IRremoteESP8266-2.6.5/examples/LGACSend/LGACSend.ino diff --git a/lib/IRremoteESP8266-2.6.4/examples/SmartIRRepeater/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/LGACSend/platformio.ini old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/SmartIRRepeater/platformio.ini rename to lib/IRremoteESP8266-2.6.5/examples/LGACSend/platformio.ini diff --git a/lib/IRremoteESP8266-2.6.4/examples/SmartIRRepeater/SmartIRRepeater.ino b/lib/IRremoteESP8266-2.6.5/examples/SmartIRRepeater/SmartIRRepeater.ino old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/SmartIRRepeater/SmartIRRepeater.ino rename to lib/IRremoteESP8266-2.6.5/examples/SmartIRRepeater/SmartIRRepeater.ino diff --git a/lib/IRremoteESP8266-2.6.4/examples/TurnOnArgoAC/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/SmartIRRepeater/platformio.ini old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/TurnOnArgoAC/platformio.ini rename to lib/IRremoteESP8266-2.6.5/examples/SmartIRRepeater/platformio.ini diff --git a/lib/IRremoteESP8266-2.6.4/examples/TurnOnArgoAC/TurnOnArgoAC.ino b/lib/IRremoteESP8266-2.6.5/examples/TurnOnArgoAC/TurnOnArgoAC.ino old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/TurnOnArgoAC/TurnOnArgoAC.ino rename to lib/IRremoteESP8266-2.6.5/examples/TurnOnArgoAC/TurnOnArgoAC.ino diff --git a/lib/IRremoteESP8266-2.6.4/examples/TurnOnDaikinAC/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/TurnOnArgoAC/platformio.ini old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/TurnOnDaikinAC/platformio.ini rename to lib/IRremoteESP8266-2.6.5/examples/TurnOnArgoAC/platformio.ini diff --git a/lib/IRremoteESP8266-2.6.4/examples/TurnOnDaikinAC/TurnOnDaikinAC.ino b/lib/IRremoteESP8266-2.6.5/examples/TurnOnDaikinAC/TurnOnDaikinAC.ino old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/TurnOnDaikinAC/TurnOnDaikinAC.ino rename to lib/IRremoteESP8266-2.6.5/examples/TurnOnDaikinAC/TurnOnDaikinAC.ino diff --git a/lib/IRremoteESP8266-2.6.4/examples/TurnOnFujitsuAC/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/TurnOnDaikinAC/platformio.ini old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/TurnOnFujitsuAC/platformio.ini rename to lib/IRremoteESP8266-2.6.5/examples/TurnOnDaikinAC/platformio.ini diff --git a/lib/IRremoteESP8266-2.6.4/examples/TurnOnFujitsuAC/TurnOnFujitsuAC.ino b/lib/IRremoteESP8266-2.6.5/examples/TurnOnFujitsuAC/TurnOnFujitsuAC.ino old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/TurnOnFujitsuAC/TurnOnFujitsuAC.ino rename to lib/IRremoteESP8266-2.6.5/examples/TurnOnFujitsuAC/TurnOnFujitsuAC.ino diff --git a/lib/IRremoteESP8266-2.6.4/examples/TurnOnKelvinatorAC/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/TurnOnFujitsuAC/platformio.ini old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/TurnOnKelvinatorAC/platformio.ini rename to lib/IRremoteESP8266-2.6.5/examples/TurnOnFujitsuAC/platformio.ini diff --git a/lib/IRremoteESP8266-2.6.4/examples/TurnOnKelvinatorAC/TurnOnKelvinatorAC.ino b/lib/IRremoteESP8266-2.6.5/examples/TurnOnKelvinatorAC/TurnOnKelvinatorAC.ino old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/TurnOnKelvinatorAC/TurnOnKelvinatorAC.ino rename to lib/IRremoteESP8266-2.6.5/examples/TurnOnKelvinatorAC/TurnOnKelvinatorAC.ino diff --git a/lib/IRremoteESP8266-2.6.4/examples/TurnOnMitsubishiAC/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/TurnOnKelvinatorAC/platformio.ini old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/TurnOnMitsubishiAC/platformio.ini rename to lib/IRremoteESP8266-2.6.5/examples/TurnOnKelvinatorAC/platformio.ini diff --git a/lib/IRremoteESP8266-2.6.4/examples/TurnOnMitsubishiAC/TurnOnMitsubishiAC.ino b/lib/IRremoteESP8266-2.6.5/examples/TurnOnMitsubishiAC/TurnOnMitsubishiAC.ino old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/TurnOnMitsubishiAC/TurnOnMitsubishiAC.ino rename to lib/IRremoteESP8266-2.6.5/examples/TurnOnMitsubishiAC/TurnOnMitsubishiAC.ino diff --git a/lib/IRremoteESP8266-2.6.4/examples/TurnOnMitsubishiHeavyAc/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/TurnOnMitsubishiAC/platformio.ini old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/TurnOnMitsubishiHeavyAc/platformio.ini rename to lib/IRremoteESP8266-2.6.5/examples/TurnOnMitsubishiAC/platformio.ini diff --git a/lib/IRremoteESP8266-2.6.4/examples/TurnOnMitsubishiHeavyAc/TurnOnMitsubishiHeavyAc.ino b/lib/IRremoteESP8266-2.6.5/examples/TurnOnMitsubishiHeavyAc/TurnOnMitsubishiHeavyAc.ino old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/TurnOnMitsubishiHeavyAc/TurnOnMitsubishiHeavyAc.ino rename to lib/IRremoteESP8266-2.6.5/examples/TurnOnMitsubishiHeavyAc/TurnOnMitsubishiHeavyAc.ino diff --git a/lib/IRremoteESP8266-2.6.4/examples/TurnOnPanasonicAC/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/TurnOnMitsubishiHeavyAc/platformio.ini old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/TurnOnPanasonicAC/platformio.ini rename to lib/IRremoteESP8266-2.6.5/examples/TurnOnMitsubishiHeavyAc/platformio.ini diff --git a/lib/IRremoteESP8266-2.6.4/examples/TurnOnPanasonicAC/TurnOnPanasonicAC.ino b/lib/IRremoteESP8266-2.6.5/examples/TurnOnPanasonicAC/TurnOnPanasonicAC.ino old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/TurnOnPanasonicAC/TurnOnPanasonicAC.ino rename to lib/IRremoteESP8266-2.6.5/examples/TurnOnPanasonicAC/TurnOnPanasonicAC.ino diff --git a/lib/IRremoteESP8266-2.6.4/examples/TurnOnToshibaAC/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/TurnOnPanasonicAC/platformio.ini old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/TurnOnToshibaAC/platformio.ini rename to lib/IRremoteESP8266-2.6.5/examples/TurnOnPanasonicAC/platformio.ini diff --git a/lib/IRremoteESP8266-2.6.4/examples/TurnOnToshibaAC/TurnOnToshibaAC.ino b/lib/IRremoteESP8266-2.6.5/examples/TurnOnToshibaAC/TurnOnToshibaAC.ino old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/TurnOnToshibaAC/TurnOnToshibaAC.ino rename to lib/IRremoteESP8266-2.6.5/examples/TurnOnToshibaAC/TurnOnToshibaAC.ino diff --git a/lib/IRremoteESP8266-2.6.4/examples/TurnOnTrotecAC/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/TurnOnToshibaAC/platformio.ini old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/TurnOnTrotecAC/platformio.ini rename to lib/IRremoteESP8266-2.6.5/examples/TurnOnToshibaAC/platformio.ini diff --git a/lib/IRremoteESP8266-2.6.4/examples/TurnOnTrotecAC/TurnOnTrotecAC.ino b/lib/IRremoteESP8266-2.6.5/examples/TurnOnTrotecAC/TurnOnTrotecAC.ino old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/examples/TurnOnTrotecAC/TurnOnTrotecAC.ino rename to lib/IRremoteESP8266-2.6.5/examples/TurnOnTrotecAC/TurnOnTrotecAC.ino diff --git a/lib/IRremoteESP8266-2.6.5/examples/TurnOnTrotecAC/platformio.ini b/lib/IRremoteESP8266-2.6.5/examples/TurnOnTrotecAC/platformio.ini new file mode 100755 index 000000000..1aba0afcc --- /dev/null +++ b/lib/IRremoteESP8266-2.6.5/examples/TurnOnTrotecAC/platformio.ini @@ -0,0 +1,18 @@ +[platformio] +src_dir = . + +[env] +lib_extra_dirs = ../../ +lib_ldf_mode = deep+ +lib_ignore = examples +build_flags = + +[env:nodemcuv2] +platform = espressif8266 +framework = arduino +board = nodemcuv2 + +[env:esp32dev] +platform = espressif32 +framework = arduino +board = esp32dev diff --git a/lib/IRremoteESP8266-2.6.4/keywords.txt b/lib/IRremoteESP8266-2.6.5/keywords.txt old mode 100644 new mode 100755 similarity index 97% rename from lib/IRremoteESP8266-2.6.4/keywords.txt rename to lib/IRremoteESP8266-2.6.5/keywords.txt index 6edef1937..db2d398a1 --- a/lib/IRremoteESP8266-2.6.4/keywords.txt +++ b/lib/IRremoteESP8266-2.6.5/keywords.txt @@ -20,9 +20,11 @@ # Datatypes & Classes (KEYWORD1) ####################################### +IRAmcorAc KEYWORD1 IRArgoAC KEYWORD1 IRCoolixAC KEYWORD1 IRDaikin128 KEYWORD1 +IRDaikin152 KEYWORD1 IRDaikin160 KEYWORD1 IRDaikin176 KEYWORD1 IRDaikin2 KEYWORD1 @@ -77,6 +79,7 @@ _delayMicroseconds KEYWORD2 _matchGeneric KEYWORD2 _setMode KEYWORD2 _setTemp KEYWORD2 +_validTolerance KEYWORD2 add KEYWORD2 addBoolToString KEYWORD2 addFanToString KEYWORD2 @@ -84,6 +87,7 @@ addIntToString KEYWORD2 addLabeledString KEYWORD2 addModeToString KEYWORD2 addTempToString KEYWORD2 +amcor KEYWORD2 argo KEYWORD2 bcdToUint8 KEYWORD2 begin KEYWORD2 @@ -125,12 +129,14 @@ daikin2 KEYWORD2 daikin216 KEYWORD2 decode KEYWORD2 decodeAiwaRCT501 KEYWORD2 +decodeAmcor KEYWORD2 decodeArgo KEYWORD2 decodeCOOLIX KEYWORD2 decodeCarrierAC KEYWORD2 decodeDISH KEYWORD2 decodeDaikin KEYWORD2 decodeDaikin128 KEYWORD2 +decodeDaikin152 KEYWORD2 decodeDaikin160 KEYWORD2 decodeDaikin176 KEYWORD2 decodeDaikin2 KEYWORD2 @@ -243,6 +249,7 @@ getFreshAir KEYWORD2 getFreshAirHigh KEYWORD2 getHealth KEYWORD2 getHold KEYWORD2 +getHumid KEYWORD2 getIFeel KEYWORD2 getIon KEYWORD2 getIonFilter KEYWORD2 @@ -269,6 +276,7 @@ getQuiet KEYWORD2 getRClevel KEYWORD2 getRaw KEYWORD2 getRoomTemp KEYWORD2 +getSave KEYWORD2 getSensor KEYWORD2 getSensorTemp KEYWORD2 getSilent KEYWORD2 @@ -293,6 +301,8 @@ getTempOffset KEYWORD2 getTempRaw KEYWORD2 getTime KEYWORD2 getTimer KEYWORD2 +getTimerEnabled KEYWORD2 +getTolerance KEYWORD2 getTurbo KEYWORD2 getUseCelsius KEYWORD2 getVane KEYWORD2 @@ -357,12 +367,14 @@ samsung KEYWORD2 send KEYWORD2 sendAc KEYWORD2 sendAiwaRCT501 KEYWORD2 +sendAmcor KEYWORD2 sendArgo KEYWORD2 sendCOOLIX KEYWORD2 sendCarrierAC KEYWORD2 sendDISH KEYWORD2 sendDaikin KEYWORD2 sendDaikin128 KEYWORD2 +sendDaikin152 KEYWORD2 sendDaikin160 KEYWORD2 sendDaikin176 KEYWORD2 sendDaikin2 KEYWORD2 @@ -455,6 +467,7 @@ setFreshAir KEYWORD2 setFreshAirHigh KEYWORD2 setHealth KEYWORD2 setHold KEYWORD2 +setHumid KEYWORD2 setIFeel KEYWORD2 setIon KEYWORD2 setIonFilter KEYWORD2 @@ -480,6 +493,7 @@ setPurify KEYWORD2 setQuiet KEYWORD2 setRaw KEYWORD2 setRoomTemp KEYWORD2 +setSave KEYWORD2 setSensor KEYWORD2 setSensorTemp KEYWORD2 setSensorTempRaw KEYWORD2 @@ -500,6 +514,8 @@ setTempRaw KEYWORD2 setTime KEYWORD2 setTimer KEYWORD2 setTimerActive KEYWORD2 +setTimerEnabled KEYWORD2 +setTolerance KEYWORD2 setTurbo KEYWORD2 setUnknownThreshold KEYWORD2 setUseCelsius KEYWORD2 @@ -550,6 +566,7 @@ xorBytes KEYWORD2 AIWA_RC_T501 LITERAL1 AIWA_RC_T501_BITS LITERAL1 ALLOW_DELAY_CALLS LITERAL1 +AMCOR LITERAL1 ARDB1 LITERAL1 ARGO LITERAL1 ARGO_COMMAND_LENGTH LITERAL1 @@ -583,6 +600,7 @@ COOLIX LITERAL1 COOLIX_BITS LITERAL1 DAIKIN LITERAL1 DAIKIN128 LITERAL1 +DAIKIN152 LITERAL1 DAIKIN160 LITERAL1 DAIKIN176 LITERAL1 DAIKIN2 LITERAL1 @@ -601,11 +619,13 @@ DAIKIN_MAX_TEMP LITERAL1 DAIKIN_MIN_TEMP LITERAL1 DECODE_AC LITERAL1 DECODE_AIWA_RC_T501 LITERAL1 +DECODE_AMCOR LITERAL1 DECODE_ARGO LITERAL1 DECODE_CARRIER_AC LITERAL1 DECODE_COOLIX LITERAL1 DECODE_DAIKIN LITERAL1 DECODE_DAIKIN128 LITERAL1 +DECODE_DAIKIN152 LITERAL1 DECODE_DAIKIN160 LITERAL1 DECODE_DAIKIN176 LITERAL1 DECODE_DAIKIN2 LITERAL1 @@ -889,11 +909,13 @@ SANYO_LC7461 LITERAL1 SANYO_LC7461_BITS LITERAL1 SANYO_SA8650B_BITS LITERAL1 SEND_AIWA_RC_T501 LITERAL1 +SEND_AMCOR LITERAL1 SEND_ARGO LITERAL1 SEND_CARRIER_AC LITERAL1 SEND_COOLIX LITERAL1 SEND_DAIKIN LITERAL1 SEND_DAIKIN128 LITERAL1 +SEND_DAIKIN152 LITERAL1 SEND_DAIKIN160 LITERAL1 SEND_DAIKIN176 LITERAL1 SEND_DAIKIN2 LITERAL1 @@ -1001,6 +1023,42 @@ kAiwaRcT501PostBits LITERAL1 kAiwaRcT501PostData LITERAL1 kAiwaRcT501PreBits LITERAL1 kAiwaRcT501PreData LITERAL1 +kAmcorAuto LITERAL1 +kAmcorBits LITERAL1 +kAmcorChecksumByte LITERAL1 +kAmcorCool LITERAL1 +kAmcorDefaultRepeat LITERAL1 +kAmcorDry LITERAL1 +kAmcorFan LITERAL1 +kAmcorFanAuto LITERAL1 +kAmcorFanMask LITERAL1 +kAmcorFanMax LITERAL1 +kAmcorFanMed LITERAL1 +kAmcorFanMin LITERAL1 +kAmcorFooterMark LITERAL1 +kAmcorGap LITERAL1 +kAmcorHdrMark LITERAL1 +kAmcorHdrSpace LITERAL1 +kAmcorHeat LITERAL1 +kAmcorMaxMask LITERAL1 +kAmcorMaxTemp LITERAL1 +kAmcorMinTemp LITERAL1 +kAmcorModeFanByte LITERAL1 +kAmcorModeMask LITERAL1 +kAmcorOneMark LITERAL1 +kAmcorOneSpace LITERAL1 +kAmcorPowerByte LITERAL1 +kAmcorPowerMask LITERAL1 +kAmcorPowerOff LITERAL1 +kAmcorPowerOn LITERAL1 +kAmcorSpecialByte LITERAL1 +kAmcorStateLength LITERAL1 +kAmcorTempByte LITERAL1 +kAmcorTempMask LITERAL1 +kAmcorTolerance LITERAL1 +kAmcorVentMask LITERAL1 +kAmcorZeroMark LITERAL1 +kAmcorZeroSpace LITERAL1 kArgoAuto LITERAL1 kArgoBitMark LITERAL1 kArgoBits LITERAL1 @@ -1151,6 +1209,17 @@ kDaikin128SectionLength LITERAL1 kDaikin128Sections LITERAL1 kDaikin128StateLength LITERAL1 kDaikin128ZeroSpace LITERAL1 +kDaikin152BitMark LITERAL1 +kDaikin152Bits LITERAL1 +kDaikin152DefaultRepeat LITERAL1 +kDaikin152Freq LITERAL1 +kDaikin152Gap LITERAL1 +kDaikin152HdrMark LITERAL1 +kDaikin152HdrSpace LITERAL1 +kDaikin152LeaderBits LITERAL1 +kDaikin152OneSpace LITERAL1 +kDaikin152StateLength LITERAL1 +kDaikin152ZeroSpace LITERAL1 kDaikin160BitMark LITERAL1 kDaikin160Bits LITERAL1 kDaikin160ByteFan LITERAL1 @@ -1555,6 +1624,13 @@ kGreeSwingMiddleUp LITERAL1 kGreeSwingPosMask LITERAL1 kGreeSwingUp LITERAL1 kGreeSwingUpAuto LITERAL1 +kGreeTempMask LITERAL1 +kGreeTimer1Mask LITERAL1 +kGreeTimerEnabledBit LITERAL1 +kGreeTimerHalfHrBit LITERAL1 +kGreeTimerHoursMask LITERAL1 +kGreeTimerMax LITERAL1 +kGreeTimerTensHrMask LITERAL1 kGreeTurboMask LITERAL1 kGreeWiFiMask LITERAL1 kGreeXfanMask LITERAL1 @@ -1749,6 +1825,10 @@ kLasertagMinSamples LITERAL1 kLasertagTick LITERAL1 kLasertagTolerance LITERAL1 kLastDecodeType LITERAL1 +kLastFanspeedEnum LITERAL1 +kLastOpmodeEnum LITERAL1 +kLastSwinghEnum LITERAL1 +kLastSwingvEnum LITERAL1 kLeft LITERAL1 kLeftMax LITERAL1 kLegoPfBitMark LITERAL1 @@ -2420,12 +2500,15 @@ kTecoGap LITERAL1 kTecoHdrMark LITERAL1 kTecoHdrSpace LITERAL1 kTecoHeat LITERAL1 +kTecoHumid LITERAL1 +kTecoLight LITERAL1 kTecoMaxTemp LITERAL1 kTecoMinTemp LITERAL1 kTecoModeMask LITERAL1 kTecoOneSpace LITERAL1 kTecoPower LITERAL1 kTecoReset LITERAL1 +kTecoSave LITERAL1 kTecoSleep LITERAL1 kTecoSwing LITERAL1 kTecoTempMask LITERAL1 @@ -2483,6 +2566,7 @@ kTrotecStateLength LITERAL1 kTrotecTimerBit LITERAL1 kTrotecZeroSpace LITERAL1 kUnknownThreshold LITERAL1 +kUseDefTol LITERAL1 kVestelAcAuto LITERAL1 kVestelAcBitMark LITERAL1 kVestelAcBits LITERAL1 @@ -2604,3 +2688,4 @@ kWhynterOneSpaceTicks LITERAL1 kWhynterTick LITERAL1 kWhynterZeroSpace LITERAL1 kWhynterZeroSpaceTicks LITERAL1 +kWide LITERAL1 diff --git a/lib/IRremoteESP8266-2.6.4/library.json b/lib/IRremoteESP8266-2.6.5/library.json old mode 100644 new mode 100755 similarity index 97% rename from lib/IRremoteESP8266-2.6.4/library.json rename to lib/IRremoteESP8266-2.6.5/library.json index b678372d7..c5136f18e --- a/lib/IRremoteESP8266-2.6.4/library.json +++ b/lib/IRremoteESP8266-2.6.5/library.json @@ -1,6 +1,6 @@ { "name": "IRremoteESP8266", - "version": "2.6.4", + "version": "2.6.5", "keywords": "infrared, ir, remote, esp8266, esp32", "description": "Send and receive infrared signals with multiple protocols (ESP8266/ESP32)", "repository": diff --git a/lib/IRremoteESP8266-2.6.4/library.properties b/lib/IRremoteESP8266-2.6.5/library.properties old mode 100644 new mode 100755 similarity index 97% rename from lib/IRremoteESP8266-2.6.4/library.properties rename to lib/IRremoteESP8266-2.6.5/library.properties index 7ab396d1f..f83a80428 --- a/lib/IRremoteESP8266-2.6.4/library.properties +++ b/lib/IRremoteESP8266-2.6.5/library.properties @@ -1,5 +1,5 @@ name=IRremoteESP8266 -version=2.6.4 +version=2.6.5 author=David Conran, Sebastien Warin, Mark Szabo, Ken Shirriff maintainer=Mark Szabo, David Conran, Sebastien Warin, Roi Dayan, Massimiliano Pinto sentence=Send and receive infrared signals with multiple protocols (ESP8266/ESP32) diff --git a/lib/IRremoteESP8266-2.6.4/pylintrc b/lib/IRremoteESP8266-2.6.5/pylintrc old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/pylintrc rename to lib/IRremoteESP8266-2.6.5/pylintrc diff --git a/lib/IRremoteESP8266-2.6.4/src/CPPLINT.cfg b/lib/IRremoteESP8266-2.6.5/src/CPPLINT.cfg old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/CPPLINT.cfg rename to lib/IRremoteESP8266-2.6.5/src/CPPLINT.cfg diff --git a/lib/IRremoteESP8266-2.6.4/src/IRac.cpp b/lib/IRremoteESP8266-2.6.5/src/IRac.cpp old mode 100644 new mode 100755 similarity index 97% rename from lib/IRremoteESP8266-2.6.4/src/IRac.cpp rename to lib/IRremoteESP8266-2.6.5/src/IRac.cpp index 4483357bc..df668d836 --- a/lib/IRremoteESP8266-2.6.4/src/IRac.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/IRac.cpp @@ -15,6 +15,7 @@ #include "IRsend.h" #include "IRremoteESP8266.h" #include "IRutils.h" +#include "ir_Amcor.h" #include "ir_Argo.h" #include "ir_Coolix.h" #include "ir_Daikin.h" @@ -46,7 +47,10 @@ IRac::IRac(const uint16_t pin, const bool inverted, const bool use_modulation) { // Is the given protocol supported by the IRac class? bool IRac::isProtocolSupported(const decode_type_t protocol) { switch (protocol) { -#if SEND_ARGO +#if SEND_AMCOR + case decode_type_t::AMCOR: +#endif +#if SEND_AMCOR case decode_type_t::ARGO: #endif #if SEND_COOLIX @@ -140,6 +144,27 @@ bool IRac::isProtocolSupported(const decode_type_t protocol) { } } +#if SEND_AMCOR +void IRac::amcor(IRAmcorAc *ac, + const bool on, const stdAc::opmode_t mode, const float degrees, + const stdAc::fanspeed_t fan) { + ac->setPower(on); + ac->setMode(ac->convertMode(mode)); + ac->setTemp(degrees); + ac->setFan(ac->convertFan(fan)); + // No Swing setting available. + // No Quiet setting available. + // No Light setting available. + // No Filter setting available. + // No Turbo setting available. + // No Economy setting available. + // No Clean setting available. + // No Beep setting available. + // No Sleep setting available. + ac->send(); +} +#endif // SEND_AMCOR + #if SEND_ARGO void IRac::argo(IRArgoAC *ac, const bool on, const stdAc::opmode_t mode, const float degrees, @@ -400,6 +425,7 @@ void IRac::fujitsu(IRFujitsuAC *ac, const fujitsu_ac_remote_model_t model, // No Beep setting available. // No Sleep setting available. // No Clock setting available. + ac->on(); // Ref: Issue #860 } else { // Off is special case/message. We don't need to send other messages. ac->off(); @@ -801,7 +827,7 @@ void IRac::tcl112(IRTcl112Ac *ac, void IRac::teco(IRTecoAc *ac, const bool on, const stdAc::opmode_t mode, const float degrees, const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv, - const int16_t sleep) { + const bool light, const int16_t sleep) { ac->setPower(on); ac->setMode(ac->convertMode(mode)); ac->setTemp(degrees); @@ -810,7 +836,7 @@ void IRac::teco(IRTecoAc *ac, // No Horizontal swing setting available. // No Quiet setting available. // No Turbo setting available. - // No Light setting available. + ac->setLight(light); // No Filter setting available. // No Clean setting available. // No Beep setting available. @@ -1014,6 +1040,14 @@ bool IRac::sendAc(const decode_type_t vendor, const int16_t model, if (mode == stdAc::opmode_t::kOff) on = false; // Per vendor settings & setup. switch (vendor) { +#if SEND_AMCOR + case AMCOR: + { + IRAmcorAc ac(_pin, _inverted, _modulation); + amcor(&ac, on, mode, degC, fan); + break; + } +#endif // SEND_AMCOR #if SEND_ARGO case ARGO: { @@ -1247,7 +1281,7 @@ bool IRac::sendAc(const decode_type_t vendor, const int16_t model, { IRTecoAc ac(_pin, _inverted, _modulation); ac.begin(); - teco(&ac, on, mode, degC, fan, swingv, sleep); + teco(&ac, on, mode, degC, fan, swingv, light, sleep); break; } #endif // SEND_TECO @@ -1413,17 +1447,28 @@ stdAc::swingh_t IRac::strToSwingH(const char *str, !strcasecmp(str, "MAXRIGHT") || !strcasecmp(str, "MAX RIGHT") || !strcasecmp(str, "FARRIGHT") || !strcasecmp(str, "FAR RIGHT")) return stdAc::swingh_t::kRightMax; + else if (!strcasecmp(str, "WIDE")) + return stdAc::swingh_t::kWide; else return def; } // Assumes str is the model or an integer >= 1. int16_t IRac::strToModel(const char *str, const int16_t def) { + // Gree + if (!strcasecmp(str, "YAW1F")) { + return gree_ac_remote_model_t::YAW1F; + } else if (!strcasecmp(str, "YBOFB")) { + return gree_ac_remote_model_t::YBOFB; // Fujitsu A/C models - if (!strcasecmp(str, "ARRAH2E")) { + } else if (!strcasecmp(str, "ARRAH2E")) { return fujitsu_ac_remote_model_t::ARRAH2E; } else if (!strcasecmp(str, "ARDB1")) { return fujitsu_ac_remote_model_t::ARDB1; + } else if (!strcasecmp(str, "ARREB1E")) { + return fujitsu_ac_remote_model_t::ARREB1E; + } else if (!strcasecmp(str, "ARJW2")) { + return fujitsu_ac_remote_model_t::ARJW2; // Panasonic A/C families } else if (!strcasecmp(str, "LKE") || !strcasecmp(str, "PANASONICLKE")) { return panasonic_ac_remote_model_t::kPanasonicLke; @@ -1542,6 +1587,8 @@ String IRac::swinghToString(const stdAc::swingh_t swingh) { return F("right"); case stdAc::swingh_t::kRightMax: return F("rightmax"); + case stdAc::swingh_t::kWide: + return F("wide"); default: return F("unknown"); } @@ -1555,6 +1602,13 @@ namespace IRAcUtils { // A string with the human description of the A/C message. "" if we can't. String resultAcToString(const decode_results * const result) { switch (result->decode_type) { +#if DECODE_AMCOR + case decode_type_t::AMCOR: { + IRAmcorAc ac(0); + ac.setRaw(result->state); + return ac.toString(); + } +#endif // DECODE_AMCOR #if DECODE_ARGO case decode_type_t::ARGO: { IRArgoAC ac(0); @@ -1784,6 +1838,14 @@ namespace IRAcUtils { const stdAc::state_t *prev) { if (decode == NULL || result == NULL) return false; // Safety check. switch (decode->decode_type) { +#if DECODE_AMCOR + case decode_type_t::AMCOR: { + IRAmcorAc ac(kGpioUnused); + ac.setRaw(decode->state); + *result = ac.toCommon(); + break; + } +#endif // DECODE_AMCOR #if DECODE_ARGO case decode_type_t::ARGO: { IRArgoAC ac(kGpioUnused); diff --git a/lib/IRremoteESP8266-2.6.4/src/IRac.h b/lib/IRremoteESP8266-2.6.5/src/IRac.h old mode 100644 new mode 100755 similarity index 98% rename from lib/IRremoteESP8266-2.6.4/src/IRac.h rename to lib/IRremoteESP8266-2.6.5/src/IRac.h index d02ce43af..73ee4b2a3 --- a/lib/IRremoteESP8266-2.6.4/src/IRac.h +++ b/lib/IRremoteESP8266-2.6.5/src/IRac.h @@ -7,6 +7,7 @@ #include #endif #include "IRremoteESP8266.h" +#include "ir_Amcor.h" #include "ir_Argo.h" #include "ir_Coolix.h" #include "ir_Daikin.h" @@ -73,6 +74,11 @@ class IRac { uint16_t _pin; bool _inverted; bool _modulation; +#if SEND_AMCOR + void amcor(IRAmcorAc *ac, + const bool on, const stdAc::opmode_t mode, const float degrees, + const stdAc::fanspeed_t fan); +#endif // SEND_AMCOR #if SEND_ARGO void argo(IRArgoAC *ac, const bool on, const stdAc::opmode_t mode, const float degrees, @@ -260,7 +266,7 @@ void electra(IRElectraAc *ac, void teco(IRTecoAc *ac, const bool on, const stdAc::opmode_t mode, const float degrees, const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv, - const int16_t sleep = -1); + const bool light, const int16_t sleep = -1); #endif // SEND_TECO #if SEND_TOSHIBA_AC void toshiba(IRToshibaAC *ac, diff --git a/lib/IRremoteESP8266-2.6.4/src/IRrecv.cpp b/lib/IRremoteESP8266-2.6.5/src/IRrecv.cpp old mode 100644 new mode 100755 similarity index 96% rename from lib/IRremoteESP8266-2.6.4/src/IRrecv.cpp rename to lib/IRremoteESP8266-2.6.5/src/IRrecv.cpp index 70360f0ec..739ced38f --- a/lib/IRremoteESP8266-2.6.4/src/IRrecv.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/IRrecv.cpp @@ -182,6 +182,7 @@ IRrecv::IRrecv(const uint16_t recvpin, const uint16_t bufsize, #if DECODE_HASH _unknown_threshold = kUnknownThreshold; #endif // DECODE_HASH + _tolerance = kTolerance; } // Class destructor @@ -297,6 +298,15 @@ void IRrecv::setUnknownThreshold(const uint16_t length) { } #endif // DECODE_HASH + +// Set the base tolerance percentage for matching incoming IR messages. +void IRrecv::setTolerance(const uint8_t percent) { + _tolerance = std::min(percent, (uint8_t)100); +} + +// Get the base tolerance percentage for matching incoming IR messages. +uint8_t IRrecv::getTolerance(void) { return _tolerance; } + // Decodes the received IR message. // If the interrupt state is saved, we will immediately resume waiting // for the next IR message to avoid missing messages. @@ -651,6 +661,14 @@ bool IRrecv::decode(decode_results *results, irparams_t *save) { DPRINTLN("Attempting Daikin128 decode"); if (decodeDaikin128(results)) return true; #endif // DECODE_DAIKIN128 +#if DECODE_AMCOR + DPRINTLN("Attempting Amcor decode"); + if (decodeAmcor(results)) return true; +#endif // DECODE_AMCOR +#if DECODE_DAIKIN152 + DPRINTLN("Attempting Daikin152 decode"); + if (decodeDaikin152(results)) return true; +#endif // DECODE_DAIKIN152 #if DECODE_HASH // decodeHash returns a hash on any input. // Thus, it needs to be last in the list. @@ -665,6 +683,11 @@ bool IRrecv::decode(decode_results *results, irparams_t *save) { return false; } +// Convert the tolerance percentage into something valid. +uint8_t IRrecv::_validTolerance(const uint8_t percentage) { + return (percentage > 100) ? _tolerance : percentage; +} + // Calculate the lower bound of the nr. of ticks. // // Args: @@ -673,10 +696,12 @@ bool IRrecv::decode(decode_results *results, irparams_t *save) { // delta: A non-scaling amount to reduce usecs by. // Returns: // Nr. of ticks. -uint32_t IRrecv::ticksLow(uint32_t usecs, uint8_t tolerance, uint16_t delta) { +uint32_t IRrecv::ticksLow(const uint32_t usecs, const uint8_t tolerance, + const uint16_t delta) { // max() used to ensure the result can't drop below 0 before the cast. return ((uint32_t)std::max( - (int32_t)(usecs * (1.0 - tolerance / 100.0) - delta), 0)); + (int32_t)(usecs * (1.0 - _validTolerance(tolerance) / 100.0) - delta), + 0)); } // Calculate the upper bound of the nr. of ticks. @@ -687,8 +712,10 @@ uint32_t IRrecv::ticksLow(uint32_t usecs, uint8_t tolerance, uint16_t delta) { // delta: A non-scaling amount to increase usecs by. // Returns: // Nr. of ticks. -uint32_t IRrecv::ticksHigh(uint32_t usecs, uint8_t tolerance, uint16_t delta) { - return ((uint32_t)(usecs * (1.0 + tolerance / 100.0)) + 1 + delta); +uint32_t IRrecv::ticksHigh(const uint32_t usecs, const uint8_t tolerance, + const uint16_t delta) { + return ((uint32_t)(usecs * (1.0 + _validTolerance(tolerance) / 100.0)) + 1 + + delta); } // Check if we match a pulse(measured) with the desired within @@ -836,7 +863,7 @@ bool IRrecv::matchSpace(uint32_t measured, uint32_t desired, uint8_t tolerance, // Compare two tick values, returning 0 if newval is shorter, // 1 if newval is equal, and 2 if newval is longer // Use a tolerance of 20% -int16_t IRrecv::compare(uint16_t oldval, uint16_t newval) { +uint16_t IRrecv::compare(const uint16_t oldval, const uint16_t newval) { if (newval < oldval * 0.8) return 0; else if (oldval < newval * 0.8) @@ -859,7 +886,7 @@ bool IRrecv::decodeHash(decode_results *results) { // however it is left this way for compatibility with previously captured // values. for (uint16_t i = 1; i < results->rawlen - 2; i++) { - int16_t value = compare(results->rawbuf[i], results->rawbuf[i + 2]); + uint16_t value = compare(results->rawbuf[i], results->rawbuf[i + 2]); // Add value into the hash hash = (hash * kFnvPrime32) ^ value; } @@ -883,7 +910,7 @@ bool IRrecv::decodeHash(decode_results *results) { // onespace: Nr. of uSeconds in an expected space signal for a '1' bit. // zeromark: Nr. of uSeconds in an expected mark signal for a '0' bit. // zerospace: Nr. of uSeconds in an expected space signal for a '0' bit. -// tolerance: Percentage error margin to allow. (Def: kTolerance) +// tolerance: Percentage error margin to allow. (Def: kUseDefTol) // excess: Nr. of useconds. (Def: kMarkExcess) // MSBfirst: Bit order to save the data in. (Def: true) // Returns: @@ -928,7 +955,7 @@ match_result_t IRrecv::matchData( // onespace: Nr. of uSeconds in an expected space signal for a '1' bit. // zeromark: Nr. of uSeconds in an expected mark signal for a '0' bit. // zerospace: Nr. of uSeconds in an expected space signal for a '0' bit. -// tolerance: Percentage error margin to allow. (Def: kTolerance) +// tolerance: Percentage error margin to allow. (Def: kUseDefTol) // excess: Nr. of useconds. (Def: kMarkExcess) // MSBfirst: Bit order to save the data in. (Def: true) // Returns: @@ -975,7 +1002,7 @@ uint16_t IRrecv::matchBytes(volatile uint16_t *data_ptr, uint8_t *result_ptr, // footermark: Nr. of uSeconds for the expected footer mark signal. // footerspace: Nr. of uSeconds for the expected footer space/gap signal. // atleast: Is the match on the footerspace a matchAtLeast or matchSpace? -// tolerance: Percentage error margin to allow. (Def: kTolerance) +// tolerance: Percentage error margin to allow. (Def: kUseDefTol) // excess: Nr. of useconds. (Def: kMarkExcess) // MSBfirst: Bit order to save the data in. (Def: true) // Returns: @@ -1074,7 +1101,7 @@ uint16_t IRrecv::_matchGeneric(volatile uint16_t *data_ptr, // footermark: Nr. of uSeconds for the expected footer mark signal. // footerspace: Nr. of uSeconds for the expected footer space/gap signal. // atleast: Is the match on the footerspace a matchAtLeast or matchSpace? -// tolerance: Percentage error margin to allow. (Def: kTolerance) +// tolerance: Percentage error margin to allow. (Def: kUseDefTol) // excess: Nr. of useconds. (Def: kMarkExcess) // MSBfirst: Bit order to save the data in. (Def: true) // Returns: @@ -1121,7 +1148,7 @@ uint16_t IRrecv::matchGeneric(volatile uint16_t *data_ptr, // footermark: Nr. of uSeconds for the expected footer mark signal. // footerspace: Nr. of uSeconds for the expected footer space/gap signal. // atleast: Is the match on the footerspace a matchAtLeast or matchSpace? -// tolerance: Percentage error margin to allow. (Def: kTolerance) +// tolerance: Percentage error margin to allow. (Def: kUseDefTol) // excess: Nr. of useconds. (Def: kMarkExcess) // MSBfirst: Bit order to save the data in. (Def: true) // Returns: diff --git a/lib/IRremoteESP8266-2.6.4/src/IRrecv.h b/lib/IRremoteESP8266-2.6.5/src/IRrecv.h old mode 100644 new mode 100755 similarity index 89% rename from lib/IRremoteESP8266-2.6.4/src/IRrecv.h rename to lib/IRremoteESP8266-2.6.5/src/IRrecv.h index 30fa8b120..72c168269 --- a/lib/IRremoteESP8266-2.6.4/src/IRrecv.h +++ b/lib/IRremoteESP8266-2.6.5/src/IRrecv.h @@ -32,8 +32,9 @@ const uint8_t kIdleState = 2; const uint8_t kMarkState = 3; const uint8_t kSpaceState = 4; const uint8_t kStopState = 5; -const uint8_t kTolerance = 25; // default percent tolerance in measurements. -const uint16_t kRawTick = 2; // Capture tick to uSec factor. +const uint8_t kTolerance = 25; // default percent tolerance in measurements. +const uint8_t kUseDefTol = 255; // Indicate to use the class default tolerance. +const uint16_t kRawTick = 2; // Capture tick to uSec factor. #define RAWTICK kRawTick // Deprecated. For legacy user code support only. // How long (ms) before we give up wait for more data? // Don't exceed kMaxTimeoutMs without a good reason. @@ -122,6 +123,8 @@ class IRrecv { const bool save_buffer = false); // Constructor #endif // ESP32 ~IRrecv(void); // Destructor + void setTolerance(const uint8_t percent = kTolerance); + uint8_t getTolerance(void); bool decode(decode_results *results, irparams_t *save = NULL); void enableIRIn(const bool pullup = false); void disableIRIn(void); @@ -130,32 +133,40 @@ class IRrecv { #if DECODE_HASH void setUnknownThreshold(const uint16_t length); #endif - static bool match(uint32_t measured, uint32_t desired, - uint8_t tolerance = kTolerance, uint16_t delta = 0); - static bool matchMark(uint32_t measured, uint32_t desired, - uint8_t tolerance = kTolerance, - int16_t excess = kMarkExcess); - static bool matchSpace(uint32_t measured, uint32_t desired, - uint8_t tolerance = kTolerance, - int16_t excess = kMarkExcess); + bool match(const uint32_t measured, const uint32_t desired, + const uint8_t tolerance = kUseDefTol, + const uint16_t delta = 0); + bool matchMark(const uint32_t measured, const uint32_t desired, + const uint8_t tolerance = kUseDefTol, + const int16_t excess = kMarkExcess); + bool matchSpace(const uint32_t measured, const uint32_t desired, + const uint8_t tolerance = kUseDefTol, + const int16_t excess = kMarkExcess); #ifndef UNIT_TEST private: #endif irparams_t *irparams_save; + uint8_t _tolerance; +#if defined(ESP32) uint8_t _timer_num; +#endif // defined(ESP32) #if DECODE_HASH uint16_t _unknown_threshold; #endif // These are called by decode + uint8_t _validTolerance(const uint8_t percentage); void copyIrParams(volatile irparams_t *src, irparams_t *dst); - int16_t compare(uint16_t oldval, uint16_t newval); - static uint32_t ticksLow(uint32_t usecs, uint8_t tolerance = kTolerance, - uint16_t delta = 0); - static uint32_t ticksHigh(uint32_t usecs, uint8_t tolerance = kTolerance, - uint16_t delta = 0); - bool matchAtLeast(uint32_t measured, uint32_t desired, - uint8_t tolerance = kTolerance, uint16_t delta = 0); + uint16_t compare(const uint16_t oldval, const uint16_t newval); + uint32_t ticksLow(const uint32_t usecs, + const uint8_t tolerance = kUseDefTol, + const uint16_t delta = 0); + uint32_t ticksHigh(const uint32_t usecs, + const uint8_t tolerance = kUseDefTol, + const uint16_t delta = 0); + bool matchAtLeast(const uint32_t measured, const uint32_t desired, + const uint8_t tolerance = kUseDefTol, + const uint16_t delta = 0); uint16_t _matchGeneric(volatile uint16_t *data_ptr, uint64_t *result_bits_ptr, uint8_t *result_ptr, @@ -171,20 +182,20 @@ class IRrecv { const uint16_t footermark, const uint32_t footerspace, const bool atleast = false, - const uint8_t tolerance = kTolerance, + const uint8_t tolerance = kUseDefTol, const int16_t excess = kMarkExcess, const bool MSBfirst = true); match_result_t matchData(volatile uint16_t *data_ptr, const uint16_t nbits, const uint16_t onemark, const uint32_t onespace, const uint16_t zeromark, const uint32_t zerospace, - const uint8_t tolerance = kTolerance, + const uint8_t tolerance = kUseDefTol, const int16_t excess = kMarkExcess, const bool MSBfirst = true); uint16_t matchBytes(volatile uint16_t *data_ptr, uint8_t *result_ptr, const uint16_t remaining, const uint16_t nbytes, const uint16_t onemark, const uint32_t onespace, const uint16_t zeromark, const uint32_t zerospace, - const uint8_t tolerance = kTolerance, + const uint8_t tolerance = kUseDefTol, const int16_t excess = kMarkExcess, const bool MSBfirst = true); uint16_t matchGeneric(volatile uint16_t *data_ptr, @@ -195,7 +206,7 @@ class IRrecv { const uint16_t zeromark, const uint32_t zerospace, const uint16_t footermark, const uint32_t footerspace, const bool atleast = false, - const uint8_t tolerance = kTolerance, + const uint8_t tolerance = kUseDefTol, const int16_t excess = kMarkExcess, const bool MSBfirst = true); uint16_t matchGeneric(volatile uint16_t *data_ptr, uint8_t *result_ptr, @@ -206,7 +217,7 @@ class IRrecv { const uint16_t footermark, const uint32_t footerspace, const bool atleast = false, - const uint8_t tolerance = kTolerance, + const uint8_t tolerance = kUseDefTol, const int16_t excess = kMarkExcess, const bool MSBfirst = true); bool decodeHash(decode_results *results); @@ -249,7 +260,7 @@ class IRrecv { #endif #if (DECODE_RC5 || DECODE_R6 || DECODE_LASERTAG || DECODE_MWM) int16_t getRClevel(decode_results *results, uint16_t *offset, uint16_t *used, - uint16_t bitTime, uint8_t tolerance = kTolerance, + uint16_t bitTime, uint8_t tolerance = kUseDefTol, int16_t excess = kMarkExcess, uint16_t delta = 0, uint8_t maxwidth = 3); #endif @@ -348,6 +359,11 @@ class IRrecv { const uint16_t nbits = kDaikin128Bits, const bool strict = true); #endif // DECODE_DAIKIN128 +#if DECODE_DAIKIN152 + bool decodeDaikin152(decode_results *results, + const uint16_t nbits = kDaikin152Bits, + const bool strict = true); +#endif // DECODE_DAIKIN152 #if DECODE_DAIKIN160 bool decodeDaikin160(decode_results *results, const uint16_t nbits = kDaikin160Bits, @@ -474,6 +490,11 @@ bool decodeNeoclima(decode_results *results, const uint16_t nbits = kNeoclimaBits, const bool strict = true); #endif // DECODE_NEOCLIMA +#if DECODE_AMCOR +bool decodeAmcor(decode_results *results, + const uint16_t nbits = kAmcorBits, + const bool strict = true); +#endif // DECODE_AMCOR }; #endif // IRRECV_H_ diff --git a/lib/IRremoteESP8266-2.6.4/src/IRremoteESP8266.h b/lib/IRremoteESP8266-2.6.5/src/IRremoteESP8266.h old mode 100644 new mode 100755 similarity index 96% rename from lib/IRremoteESP8266-2.6.4/src/IRremoteESP8266.h rename to lib/IRremoteESP8266-2.6.5/src/IRremoteESP8266.h index 6c982af74..706da40ea --- a/lib/IRremoteESP8266-2.6.4/src/IRremoteESP8266.h +++ b/lib/IRremoteESP8266-2.6.5/src/IRremoteESP8266.h @@ -51,13 +51,14 @@ #endif // UNIT_TEST // Library Version -#define _IRREMOTEESP8266_VERSION_ "2.6.4" +#define _IRREMOTEESP8266_VERSION_ "2.6.5" // Supported IR protocols // Each protocol you include costs memory and, during decode, costs time // Disable (set to false) all the protocols you do not need/want! // The Air Conditioner protocols are the most expensive memory-wise. // -/* + +#if defined(FIRMWARE_IR) || defined(FIRMWARE_IR_CUSTOM) // full IR protocols #define DECODE_HASH true // Semi-unique code for unknown messages #define SEND_RAW true @@ -247,7 +248,14 @@ #define DECODE_DAIKIN128 true #define SEND_DAIKIN128 true -*/ + +#define DECODE_AMCOR true +#define SEND_AMCOR true + +#define DECODE_DAIKIN152 true +#define SEND_DAIKIN152 true + +#else // defined(FIRMWARE_IR) || defined(FIRMWARE_IR_CUSTOM) // full IR protocols // Tasmota supported protocols (less protocols is less code size) #define DECODE_HASH true // Semi-unique code for unknown messages @@ -440,6 +448,8 @@ #define DECODE_DAIKIN128 false #define SEND_DAIKIN128 true +#endif // defined(FIRMWARE_IR) || defined(FIRMWARE_IR_CUSTOM) // full IR protocols + #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 || \ @@ -448,7 +458,8 @@ DECODE_PANASONIC_AC || DECODE_MWM || DECODE_DAIKIN2 || \ DECODE_VESTEL_AC || DECODE_TCL112AC || DECODE_MITSUBISHIHEAVY || \ DECODE_DAIKIN216 || DECODE_SHARP_AC || DECODE_DAIKIN160 || \ - DECODE_NEOCLIMA || DECODE_DAIKIN176 || DECODE_DAIKIN128) + DECODE_NEOCLIMA || DECODE_DAIKIN176 || DECODE_DAIKIN128 || \ + DECODE_AMCOR || DECODE_DAIKIN152) #define DECODE_AC true // We need some common infrastructure for decoding A/Cs. #else #define DECODE_AC false // We don't need that infrastructure. @@ -536,8 +547,10 @@ enum decode_type_t { NEOCLIMA, DAIKIN176, DAIKIN128, + AMCOR, + DAIKIN152, // 70 // Add new entries before this one, and update it to point to the last entry. - kLastDecodeType = DAIKIN128, + kLastDecodeType = DAIKIN152, }; // Message lengths & required repeat values @@ -546,6 +559,9 @@ const uint16_t kSingleRepeat = 1; const uint16_t kAiwaRcT501Bits = 15; const uint16_t kAiwaRcT501MinRepeats = kSingleRepeat; +const uint16_t kAmcorStateLength = 8; +const uint16_t kAmcorBits = kAmcorStateLength * 8; +const uint16_t kAmcorDefaultRepeat = kSingleRepeat; const uint16_t kArgoStateLength = 12; const uint16_t kArgoBits = kArgoStateLength * 8; const uint16_t kArgoDefaultRepeat = kNoRepeat; @@ -567,6 +583,9 @@ const uint16_t kDaikin160DefaultRepeat = kNoRepeat; const uint16_t kDaikin128StateLength = 16; const uint16_t kDaikin128Bits = kDaikin128StateLength * 8; const uint16_t kDaikin128DefaultRepeat = kNoRepeat; +const uint16_t kDaikin152StateLength = 19; +const uint16_t kDaikin152Bits = kDaikin152StateLength * 8; +const uint16_t kDaikin152DefaultRepeat = kNoRepeat; const uint16_t kDaikin176StateLength = 22; const uint16_t kDaikin176Bits = kDaikin176StateLength * 8; const uint16_t kDaikin176DefaultRepeat = kNoRepeat; diff --git a/lib/IRremoteESP8266-2.6.4/src/IRsend.cpp b/lib/IRremoteESP8266-2.6.5/src/IRsend.cpp old mode 100644 new mode 100755 similarity index 99% rename from lib/IRremoteESP8266-2.6.4/src/IRsend.cpp rename to lib/IRremoteESP8266-2.6.5/src/IRsend.cpp index 6e36c7809..b094fdff5 --- a/lib/IRremoteESP8266-2.6.4/src/IRsend.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/IRsend.cpp @@ -500,6 +500,7 @@ uint16_t IRsend::minRepeats(const decode_type_t protocol) { switch (protocol) { // Single repeats case AIWA_RC_T501: + case AMCOR: case COOLIX: case GICABLE: case INAX: @@ -574,6 +575,7 @@ uint16_t IRsend::defaultBits(const decode_type_t protocol) { case MAGIQUEST: case VESTEL_AC: return 56; + case AMCOR: case PIONEER: return 64; case ARGO: @@ -581,7 +583,9 @@ uint16_t IRsend::defaultBits(const decode_type_t protocol) { case DAIKIN: return kDaikinBits; case DAIKIN128: - return kDaikin128Bits; + return kDaikin128Bits; + case DAIKIN152: + return kDaikin152Bits; case DAIKIN160: return kDaikin160Bits; case DAIKIN176: @@ -841,6 +845,11 @@ bool IRsend::send(const decode_type_t type, const uint64_t data, bool IRsend::send(const decode_type_t type, const unsigned char *state, const uint16_t nbytes) { switch (type) { +#if SEND_AMCOR + case AMCOR: + sendAmcor(state, nbytes); + break; +#endif #if SEND_ARGO case ARGO: sendArgo(state, nbytes); @@ -856,6 +865,11 @@ bool IRsend::send(const decode_type_t type, const unsigned char *state, sendDaikin128(state, nbytes); break; #endif // SEND_DAIKIN128 +#if SEND_DAIKIN152 + case DAIKIN152: + sendDaikin152(state, nbytes); + break; +#endif // SEND_DAIKIN152 #if SEND_DAIKIN160 case DAIKIN160: sendDaikin160(state, nbytes); diff --git a/lib/IRremoteESP8266-2.6.4/src/IRsend.h b/lib/IRremoteESP8266-2.6.5/src/IRsend.h old mode 100644 new mode 100755 similarity index 95% rename from lib/IRremoteESP8266-2.6.4/src/IRsend.h rename to lib/IRremoteESP8266-2.6.5/src/IRsend.h index 8984e612a..cbccee479 --- a/lib/IRremoteESP8266-2.6.4/src/IRsend.h +++ b/lib/IRremoteESP8266-2.6.5/src/IRsend.h @@ -49,6 +49,8 @@ namespace stdAc { kHeat = 2, kDry = 3, kFan = 4, + // Add new entries before this one, and update it to point to the last entry + kLastOpmodeEnum = kFan, }; enum class fanspeed_t { @@ -58,6 +60,8 @@ namespace stdAc { kMedium = 3, kHigh = 4, kMax = 5, + // Add new entries before this one, and update it to point to the last entry + kLastFanspeedEnum = kMax, }; enum class swingv_t { @@ -68,6 +72,8 @@ namespace stdAc { kMiddle = 3, kLow = 4, kLowest = 5, + // Add new entries before this one, and update it to point to the last entry + kLastSwingvEnum = kLowest, }; enum class swingh_t { @@ -78,6 +84,9 @@ namespace stdAc { kMiddle = 3, kRight = 4, kRightMax = 5, + kWide = 6, // a.k.a. left & right at the same time. + // Add new entries before this one, and update it to point to the last entry + kLastSwinghEnum = kWide, }; // Structure to hold a common A/C state. @@ -311,6 +320,11 @@ class IRsend { const uint16_t nbytes = kDaikin128StateLength, const uint16_t repeat = kDaikin128DefaultRepeat); #endif // SEND_DAIKIN128 +#if SEND_DAIKIN152 + void sendDaikin152(const unsigned char data[], + const uint16_t nbytes = kDaikin152StateLength, + const uint16_t repeat = kDaikin152DefaultRepeat); +#endif // SEND_DAIKIN152 #if SEND_DAIKIN160 void sendDaikin160(const unsigned char data[], const uint16_t nbytes = kDaikin160StateLength, @@ -464,6 +478,11 @@ class IRsend { const uint16_t nbytes = kNeoclimaStateLength, const uint16_t repeat = kNeoclimaMinRepeat); #endif // SEND_NEOCLIMA +#if SEND_AMCOR + void sendAmcor(const unsigned char data[], + const uint16_t nbytes = kAmcorStateLength, + const uint16_t repeat = kAmcorDefaultRepeat); +#endif // SEND_AMCOR protected: diff --git a/lib/IRremoteESP8266-2.6.4/src/IRtimer.cpp b/lib/IRremoteESP8266-2.6.5/src/IRtimer.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/IRtimer.cpp rename to lib/IRremoteESP8266-2.6.5/src/IRtimer.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/IRtimer.h b/lib/IRremoteESP8266-2.6.5/src/IRtimer.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/IRtimer.h rename to lib/IRremoteESP8266-2.6.5/src/IRtimer.h diff --git a/lib/IRremoteESP8266-2.6.4/src/IRutils.cpp b/lib/IRremoteESP8266-2.6.5/src/IRutils.cpp old mode 100644 new mode 100755 similarity index 98% rename from lib/IRremoteESP8266-2.6.4/src/IRutils.cpp rename to lib/IRremoteESP8266-2.6.5/src/IRutils.cpp index cd7c72307..6f589aa3d --- a/lib/IRremoteESP8266-2.6.4/src/IRutils.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/IRutils.cpp @@ -95,6 +95,8 @@ decode_type_t strToDecodeType(const char * const str) { return decode_type_t::UNUSED; else if (!strcasecmp(str, "AIWA_RC_T501")) return decode_type_t::AIWA_RC_T501; + else if (!strcasecmp(str, "AMCOR")) + return decode_type_t::AMCOR; else if (!strcasecmp(str, "ARGO")) return decode_type_t::ARGO; else if (!strcasecmp(str, "CARRIER_AC")) @@ -105,6 +107,8 @@ decode_type_t strToDecodeType(const char * const str) { return decode_type_t::DAIKIN; else if (!strcasecmp(str, "DAIKIN128")) return decode_type_t::DAIKIN128; + else if (!strcasecmp(str, "DAIKIN152")) + return decode_type_t::DAIKIN152; else if (!strcasecmp(str, "DAIKIN160")) return decode_type_t::DAIKIN160; else if (!strcasecmp(str, "DAIKIN176")) @@ -254,6 +258,9 @@ String typeToString(const decode_type_t protocol, const bool isRepeat) { case AIWA_RC_T501: result = F("AIWA_RC_T501"); break; + case AMCOR: + result = F("AMCOR"); + break; case ARGO: result = F("ARGO"); break; @@ -269,6 +276,9 @@ String typeToString(const decode_type_t protocol, const bool isRepeat) { case DAIKIN128: result = F("DAIKIN128"); break; + case DAIKIN152: + result = F("DAIKIN152"); + break; case DAIKIN160: result = F("DAIKIN160"); break; @@ -467,9 +477,11 @@ String typeToString(const decode_type_t protocol, const bool isRepeat) { // Does the given protocol use a complex state as part of the decode? bool hasACState(const decode_type_t protocol) { switch (protocol) { + case AMCOR: case ARGO: case DAIKIN: case DAIKIN128: + case DAIKIN152: case DAIKIN160: case DAIKIN176: case DAIKIN2: diff --git a/lib/IRremoteESP8266-2.6.4/src/IRutils.h b/lib/IRremoteESP8266-2.6.5/src/IRutils.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/IRutils.h rename to lib/IRremoteESP8266-2.6.5/src/IRutils.h diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Aiwa.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Aiwa.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Aiwa.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Aiwa.cpp diff --git a/lib/IRremoteESP8266-2.6.5/src/ir_Amcor.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Amcor.cpp new file mode 100755 index 000000000..8c0b73c8c --- /dev/null +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Amcor.cpp @@ -0,0 +1,326 @@ +// Copyright 2019 David Conran + +// Supports: +// Brand: Amcor, Model: ADR-853H A/C +// Brand: Amcor, Model: TAC-495 remote +// Brand: Amcor, Model: TAC-444 remote + +#include "ir_Amcor.h" +#include +#include "IRrecv.h" +#include "IRsend.h" +#include "IRutils.h" + +// Constants +// Ref: +// https://github.com/crankyoldgit/IRremoteESP8266/issues/385 +const uint16_t kAmcorHdrMark = 8200; +const uint16_t kAmcorHdrSpace = 4200; +const uint16_t kAmcorOneMark = 1500; +const uint16_t kAmcorZeroMark = 600; +const uint16_t kAmcorOneSpace = kAmcorZeroMark; +const uint16_t kAmcorZeroSpace = kAmcorOneMark; +const uint16_t kAmcorFooterMark = 1900; +const uint16_t kAmcorGap = 34300; +const uint8_t kAmcorTolerance = 40; + +using irutils::addBoolToString; +using irutils::addModeToString; +using irutils::addFanToString; +using irutils::addTempToString; + +#if SEND_AMCOR +// Send a Amcor HVAC formatted message. +// +// Args: +// data: The message to be sent. +// nbytes: The byte size of the array being sent. typically kAmcorStateLength. +// repeat: The number of times the message is to be repeated. +// +// Status: STABLE / Reported as working. +// +void IRsend::sendAmcor(const unsigned char data[], const uint16_t nbytes, + const uint16_t repeat) { + // Check if we have enough bytes to send a proper message. + if (nbytes < kAmcorStateLength) return; + sendGeneric(kAmcorHdrMark, kAmcorHdrSpace, kAmcorOneMark, kAmcorOneSpace, + kAmcorZeroMark, kAmcorZeroSpace, kAmcorFooterMark, kAmcorGap, + data, nbytes, 38, false, repeat, kDutyDefault); +} +#endif + +#if DECODE_AMCOR +// Decode the supplied Amcor HVAC message. +// Args: +// results: Ptr to the data to decode and where to store the decode result. +// nbits: Nr. of bits to expect in the data portion. +// Typically kAmcorBits. +// strict: Flag to indicate if we strictly adhere to the specification. +// Returns: +// boolean: True if it can decode it, false if it can't. +// +// Status: STABLE / Reported as working. +// +bool IRrecv::decodeAmcor(decode_results *results, uint16_t nbits, + bool strict) { + if (results->rawlen < 2 * nbits + kHeader - 1) + return false; // Can't possibly be a valid Amcor message. + if (strict && nbits != kAmcorBits) + return false; // We expect Amcor to be 64 bits of message. + + uint16_t offset = kStartOffset; + + uint16_t used; + // Header + Data Block (64 bits) + Footer + used = matchGeneric(results->rawbuf + offset, results->state, + results->rawlen - offset, 64, + kAmcorHdrMark, kAmcorHdrSpace, + kAmcorOneMark, kAmcorOneSpace, + kAmcorZeroMark, kAmcorZeroSpace, + kAmcorFooterMark, kAmcorGap, true, + kAmcorTolerance, 0, false); + if (!used) return false; + offset += used; + + if (strict) { + if (!IRAmcorAc::validChecksum(results->state)) return false; + } + + // Success + results->bits = nbits; + results->decode_type = AMCOR; + // No need to record the state as we stored it as we decoded it. + // As we use result->state, we don't record value, address, or command as it + // is a union data type. + return true; +} +#endif + +IRAmcorAc::IRAmcorAc(const uint16_t pin, const bool inverted, + const bool use_modulation) + : _irsend(pin, inverted, use_modulation) { this->stateReset(); } + +void IRAmcorAc::begin(void) { _irsend.begin(); } + +#if SEND_AMCOR +void IRAmcorAc::send(const uint16_t repeat) { + this->checksum(); // Create valid checksum before sending + _irsend.sendAmcor(remote_state, kAmcorStateLength, repeat); +} +#endif // SEND_AMCOR + +uint8_t IRAmcorAc::calcChecksum(const uint8_t state[], const uint16_t length) { + return irutils::sumNibbles(state, length - 1); +} + +bool IRAmcorAc::validChecksum(const uint8_t state[], const uint16_t length) { + return (state[length - 1] == IRAmcorAc::calcChecksum(state, length)); +} + +void IRAmcorAc::checksum(void) { + remote_state[kAmcorChecksumByte] = IRAmcorAc::calcChecksum(remote_state, + kAmcorStateLength); +} + +void IRAmcorAc::stateReset(void) { + for (uint8_t i = 1; i < kAmcorStateLength; i++) remote_state[i] = 0x0; + remote_state[0] = 0x01; + setFan(kAmcorFanAuto); + setMode(kAmcorAuto); + setTemp(25); // 25C +} + +uint8_t* IRAmcorAc::getRaw(void) { + this->checksum(); // Ensure correct bit array before returning + return remote_state; +} + +void IRAmcorAc::setRaw(const uint8_t state[]) { + for (uint8_t i = 0; i < kAmcorStateLength; i++) remote_state[i] = state[i]; +} + +void IRAmcorAc::on(void) { setPower(true); } + +void IRAmcorAc::off(void) { setPower(false); } + +void IRAmcorAc::setPower(const bool on) { + remote_state[kAmcorPowerByte] &= ~kAmcorPowerMask; + remote_state[kAmcorPowerByte] |= (on ? kAmcorPowerOn : kAmcorPowerOff); +} + +bool IRAmcorAc::getPower(void) { + return ((remote_state[kAmcorPowerByte] & kAmcorPowerMask) == kAmcorPowerOn); +} + +// Set the temp in deg C +void IRAmcorAc::setTemp(const uint8_t degrees) { + uint8_t temp = std::max(kAmcorMinTemp, degrees); + temp = std::min(kAmcorMaxTemp, temp); + + temp <<= 1; + remote_state[kAmcorTempByte] &= ~kAmcorTempMask; + remote_state[kAmcorTempByte] |= temp; +} + +uint8_t IRAmcorAc::getTemp(void) { + return (remote_state[kAmcorTempByte] & kAmcorTempMask) >> 1; +} + +// Maximum Cooling or Hearing +void IRAmcorAc::setMax(const bool on) { + if (on) { + switch (getMode()) { + case kAmcorCool: + setTemp(kAmcorMinTemp); + break; + case kAmcorHeat: + setTemp(kAmcorMaxTemp); + break; + default: // Not allowed in all other operating modes. + return; + } + remote_state[kAmcorSpecialByte] |= kAmcorMaxMask; + } else { + remote_state[kAmcorSpecialByte] &= ~kAmcorMaxMask; + } +} + +bool IRAmcorAc::getMax(void) { + return ((remote_state[kAmcorSpecialByte] & kAmcorMaxMask) == kAmcorMaxMask); +} + +// Set the speed of the fan +void IRAmcorAc::setFan(const uint8_t speed) { + switch (speed) { + case kAmcorFanAuto: + case kAmcorFanMin: + case kAmcorFanMed: + case kAmcorFanMax: + remote_state[kAmcorModeFanByte] &= ~kAmcorFanMask; + remote_state[kAmcorModeFanByte] |= speed << 4; + break; + default: + setFan(kAmcorFanAuto); + } +} + +uint8_t IRAmcorAc::getFan(void) { + return (remote_state[kAmcorModeFanByte] & kAmcorFanMask) >> 4; +} + +uint8_t IRAmcorAc::getMode(void) { + return remote_state[kAmcorModeFanByte] & kAmcorModeMask; +} + +void IRAmcorAc::setMode(const uint8_t mode) { + remote_state[kAmcorSpecialByte] &= ~kAmcorVentMask; // Clear the vent setting + switch (mode) { + case kAmcorFan: + remote_state[kAmcorSpecialByte] |= kAmcorVentMask; // Set the vent option + // FALL-THRU + case kAmcorCool: + case kAmcorHeat: + case kAmcorDry: + case kAmcorAuto: + // Mask out bits + remote_state[kAmcorModeFanByte] &= ~kAmcorModeMask; + // Set the mode at bit positions + remote_state[kAmcorModeFanByte] |= mode; + return; + default: + this->setMode(kAmcorAuto); + } +} + +// Convert a standard A/C mode into its native mode. +uint8_t IRAmcorAc::convertMode(const stdAc::opmode_t mode) { + switch (mode) { + case stdAc::opmode_t::kCool: + return kAmcorCool; + case stdAc::opmode_t::kHeat: + return kAmcorHeat; + case stdAc::opmode_t::kDry: + return kAmcorDry; + case stdAc::opmode_t::kFan: + return kAmcorFan; + default: + return kAmcorAuto; + } +} + +// Convert a standard A/C Fan speed into its native fan speed. +uint8_t IRAmcorAc::convertFan(const stdAc::fanspeed_t speed) { + switch (speed) { + case stdAc::fanspeed_t::kMin: + case stdAc::fanspeed_t::kLow: + return kAmcorFanMin; + case stdAc::fanspeed_t::kMedium: + return kAmcorFanMed; + case stdAc::fanspeed_t::kHigh: + case stdAc::fanspeed_t::kMax: + return kAmcorFanMax; + default: + return kAmcorFanAuto; + } +} + +// Convert a native mode to it's common equivalent. +stdAc::opmode_t IRAmcorAc::toCommonMode(const uint8_t mode) { + switch (mode) { + case kAmcorCool: return stdAc::opmode_t::kCool; + case kAmcorHeat: return stdAc::opmode_t::kHeat; + case kAmcorDry: return stdAc::opmode_t::kDry; + case kAmcorFan: return stdAc::opmode_t::kFan; + default: return stdAc::opmode_t::kAuto; + } +} + +// Convert a native fan speed to it's common equivalent. +stdAc::fanspeed_t IRAmcorAc::toCommonFanSpeed(const uint8_t speed) { + switch (speed) { + case kAmcorFanMax: return stdAc::fanspeed_t::kMax; + case kAmcorFanMed: return stdAc::fanspeed_t::kMedium; + case kAmcorFanMin: return stdAc::fanspeed_t::kMin; + default: return stdAc::fanspeed_t::kAuto; + } +} + +// Convert the A/C state to it's common equivalent. +stdAc::state_t IRAmcorAc::toCommon(void) { + stdAc::state_t result; + result.protocol = decode_type_t::AMCOR; + result.power = this->getPower(); + result.mode = this->toCommonMode(this->getMode()); + result.celsius = true; + result.degrees = this->getTemp(); + result.fanspeed = this->toCommonFanSpeed(this->getFan()); + // Not supported. + result.model = -1; + result.turbo = false; + result.swingv = stdAc::swingv_t::kOff; + result.swingh = stdAc::swingh_t::kOff; + result.light = false; + result.filter = false; + result.econo = false; + result.quiet = false; + result.clean = false; + result.beep = false; + result.sleep = -1; + result.clock = -1; + return result; +} + +// Convert the internal state into a human readable string. +String IRAmcorAc::toString() { + String result = ""; + result.reserve(70); // Reserve some heap for the string to reduce fragging. + result += addBoolToString(getPower(), F("Power"), false); + result += addModeToString(getMode(), kAmcorAuto, kAmcorCool, + kAmcorHeat, kAmcorDry, kAmcorFan); + result += addFanToString(getFan(), kAmcorFanMax, kAmcorFanMin, + kAmcorFanAuto, kAmcorFanAuto, + kAmcorFanMed); + result += addTempToString(getTemp()); + result += addBoolToString(getMax(), F("Max")); + return result; +} diff --git a/lib/IRremoteESP8266-2.6.5/src/ir_Amcor.h b/lib/IRremoteESP8266-2.6.5/src/ir_Amcor.h new file mode 100755 index 000000000..73beb27a7 --- /dev/null +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Amcor.h @@ -0,0 +1,118 @@ +// Amcor A/C +// +// Copyright 2019 David Conran + +#ifndef IR_AMCOR_H_ +#define IR_AMCOR_H_ + +#define __STDC_LIMIT_MACROS +#include +#ifndef UNIT_TEST +#include +#endif +#include "IRremoteESP8266.h" +#include "IRsend.h" +#ifdef UNIT_TEST +#include "IRsend_test.h" +#endif + +// Supports: +// Brand: Amcor, Model: ADR-853H A/C +// Brand: Amcor, Model: TAC-495 remote +// Brand: Amcor, Model: TAC-444 remote +// Ref: +// https://github.com/crankyoldgit/IRremoteESP8266/issues/834 +// Kudos: +// ldellus: For the breakdown and mapping of the bit values. + +// Constants + + +// state[1] +const uint8_t kAmcorModeFanByte = 1; +// Fan Control +const uint8_t kAmcorFanMin = 0b001; +const uint8_t kAmcorFanMed = 0b010; +const uint8_t kAmcorFanMax = 0b011; +const uint8_t kAmcorFanAuto = 0b100; +const uint8_t kAmcorFanMask = 0b01110000; +// Modes +const uint8_t kAmcorCool = 0b001; +const uint8_t kAmcorHeat = 0b010; +const uint8_t kAmcorFan = 0b011; // Aka "Vent" +const uint8_t kAmcorDry = 0b100; +const uint8_t kAmcorAuto = 0b101; +const uint8_t kAmcorModeMask = 0b00000111; + +// state[2] +const uint8_t kAmcorTempByte = 2; +// Temperature +const uint8_t kAmcorMinTemp = 12; // Celsius +const uint8_t kAmcorMaxTemp = 32; // Celsius +const uint8_t kAmcorTempMask = 0b01111110; + +// state[5] +// Power +const uint8_t kAmcorPowerByte = 5; +const uint8_t kAmcorPowerMask = 0b11110000; +const uint8_t kAmcorPowerOn = 0b00110000; // 0x30 +const uint8_t kAmcorPowerOff = 0b11000000; // 0xC0 + +// state[6] +const uint8_t kAmcorSpecialByte = 6; +// Max Mode (aka "Lo" in Cool and "Hi" in Heat) +const uint8_t kAmcorMaxMask = 0b00000011; // 0x03 +// "Vent" Mode +const uint8_t kAmcorVentMask = 0b11000000; // 0xC0 + +// state[7] +// Checksum byte. +const uint8_t kAmcorChecksumByte = kAmcorStateLength - 1; + +// Classes +class IRAmcorAc { + public: + explicit IRAmcorAc(const uint16_t pin, const bool inverted = false, + const bool use_modulation = true); + + void stateReset(); +#if SEND_AMCOR + void send(const uint16_t repeat = kAmcorDefaultRepeat); + uint8_t calibrate(void) { return _irsend.calibrate(); } +#endif // SEND_AMCOR + void begin(); + static uint8_t calcChecksum(const uint8_t state[], + const uint16_t length = kAmcorStateLength); + static bool validChecksum(const uint8_t state[], + const uint16_t length = kAmcorStateLength); + void setPower(const bool state); + bool getPower(); + void on(); + void off(); + void setTemp(const uint8_t temp); + uint8_t getTemp(); + void setMax(const bool on); + bool getMax(void); + void setFan(const uint8_t speed); + uint8_t getFan(); + void setMode(const uint8_t mode); + uint8_t getMode(); + uint8_t* getRaw(); + void setRaw(const uint8_t state[]); + uint8_t convertMode(const stdAc::opmode_t mode); + uint8_t convertFan(const stdAc::fanspeed_t speed); + static stdAc::opmode_t toCommonMode(const uint8_t mode); + static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed); + stdAc::state_t toCommon(void); + String toString(); +#ifndef UNIT_TEST + + private: + IRsend _irsend; +#else + IRsendTest _irsend; +#endif + uint8_t remote_state[kAmcorStateLength]; // The state of the IR remote. + void checksum(void); +}; +#endif // IR_AMCOR_H_ diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Argo.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Argo.cpp old mode 100644 new mode 100755 similarity index 99% rename from lib/IRremoteESP8266-2.6.4/src/ir_Argo.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Argo.cpp index 7a2ecec19..522ede7e6 --- a/lib/IRremoteESP8266-2.6.4/src/ir_Argo.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Argo.cpp @@ -422,7 +422,7 @@ bool IRrecv::decodeArgo(decode_results *results, const uint16_t nbits, kArgoBitMark, kArgoOneSpace, kArgoBitMark, kArgoZeroSpace, 0, 0, // Footer (None, allegedly. This seems very wrong.) - true, kTolerance, 0, false)) return false; + true, _tolerance, 0, false)) return false; // Compliance // Verify we got a valid checksum. diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Argo.h b/lib/IRremoteESP8266-2.6.5/src/ir_Argo.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Argo.h rename to lib/IRremoteESP8266-2.6.5/src/ir_Argo.h diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Carrier.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Carrier.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Carrier.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Carrier.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Coolix.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Coolix.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Coolix.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Coolix.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Coolix.h b/lib/IRremoteESP8266-2.6.5/src/ir_Coolix.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Coolix.h rename to lib/IRremoteESP8266-2.6.5/src/ir_Coolix.h diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Daikin.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Daikin.cpp old mode 100644 new mode 100755 similarity index 94% rename from lib/IRremoteESP8266-2.6.4/src/ir_Daikin.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Daikin.cpp index bca94841c..317526f5e --- a/lib/IRremoteESP8266-2.6.4/src/ir_Daikin.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Daikin.cpp @@ -1275,9 +1275,9 @@ bool IRrecv::decodeDaikin2(decode_results *results, uint16_t nbits, // Leader if (!matchMark(results->rawbuf[offset++], kDaikin2LeaderMark, - kDaikin2Tolerance)) return false; + _tolerance + kDaikin2Tolerance)) return false; if (!matchSpace(results->rawbuf[offset++], kDaikin2LeaderSpace, - kDaikin2Tolerance)) return false; + _tolerance + kDaikin2Tolerance)) return false; // Sections uint16_t pos = 0; @@ -1291,7 +1291,8 @@ bool IRrecv::decodeDaikin2(decode_results *results, uint16_t nbits, kDaikin2BitMark, kDaikin2ZeroSpace, kDaikin2BitMark, kDaikin2Gap, section >= kDaikin2Sections - 1, - kDaikin2Tolerance, kDaikinMarkExcess, false); + _tolerance + kDaikin2Tolerance, kDaikinMarkExcess, + false); if (used == 0) return false; offset += used; pos += ksectionSize[section]; @@ -2913,3 +2914,156 @@ bool IRrecv::decodeDaikin128(decode_results *results, const uint16_t nbits, return true; } #endif // DECODE_DAIKIN128 + +#if SEND_DAIKIN152 +// Send a Daikin 152 bit A/C message. +// +// Args: +// data: An array of kDaikin152StateLength bytes containing the IR command. +// +// Supported devices: +// - Daikin ARC480A5 remote. +// +// Status: Beta / Probably working. +// +// Ref: https://github.com/crankyoldgit/IRremoteESP8266/issues/873 +void IRsend::sendDaikin152(const unsigned char data[], const uint16_t nbytes, + const uint16_t repeat) { + for (uint16_t r = 0; r <= repeat; r++) { + // Leader + sendGeneric(0, 0, kDaikin152BitMark, kDaikin152OneSpace, + kDaikin152BitMark, kDaikin152ZeroSpace, + kDaikin152BitMark, kDaikin152Gap, + (uint64_t)0, kDaikin152LeaderBits, + kDaikin152Freq, false, 0, kDutyDefault); + // Header + Data + Footer + sendGeneric(kDaikin152HdrMark, kDaikin152HdrSpace, kDaikin152BitMark, + kDaikin152OneSpace, kDaikin152BitMark, kDaikin152ZeroSpace, + kDaikin152BitMark, kDaikin152Gap, data, + nbytes, kDaikin152Freq, false, 0, kDutyDefault); + } +} +#endif // SEND_DAIKIN152 + +#if DECODE_DAIKIN152 +// Decode the supplied Daikin 152 bit A/C message. +// Args: +// results: Ptr to the data to decode and where to store the decode result. +// nbits: Nr. of bits to expect in the data portion. (kDaikin152Bits) +// strict: Flag to indicate if we strictly adhere to the specification. +// Returns: +// boolean: True if it can decode it, false if it can't. +// +// Supported devices: +// - Daikin ARC480A5 remote. +// +// Status: Beta / Probably working. +// +// Ref: https://github.com/crankyoldgit/IRremoteESP8266/issues/873 +bool IRrecv::decodeDaikin152(decode_results *results, const uint16_t nbits, + const bool strict) { + if (results->rawlen < 2 * (5 + nbits + kFooter) + kHeader - 1) + return false; + if (nbits / 8 < kDaikin152StateLength) return false; + + // Compliance + if (strict && nbits != kDaikin152Bits) return false; + + uint16_t offset = kStartOffset; + uint16_t used; + + // Leader + uint64_t leader = 0; + used = matchGeneric(results->rawbuf + offset, &leader, + results->rawlen - offset, kDaikin152LeaderBits, + 0, 0, // No Header + kDaikin152BitMark, kDaikin152OneSpace, + kDaikin152BitMark, kDaikin152ZeroSpace, + kDaikin152BitMark, kDaikin152Gap, // Footer gap + false, _tolerance, kMarkExcess, false); + if (used == 0 || leader != 0) return false; + offset += used; + + // Header + Data + Footer + used = matchGeneric(results->rawbuf + offset, results->state, + results->rawlen - offset, nbits, + kDaikin152HdrMark, kDaikin152HdrSpace, + kDaikin152BitMark, kDaikin152OneSpace, + kDaikin152BitMark, kDaikin152ZeroSpace, + kDaikin152BitMark, kDaikin152Gap, + true, _tolerance, kMarkExcess, false); + if (used == 0) return false; + + // Compliance + if (strict) { + if (!IRDaikin152::validChecksum(results->state)) return false; + } + + // Success + results->decode_type = decode_type_t::DAIKIN152; + results->bits = nbits; + // No need to record the state as we stored it as we decoded it. + // As we use result->state, we don't record value, address, or command as it + // is a union data type. + return true; +} +#endif // DECODE_DAIKIN152 + +// Class for handling Daikin 152 bit / 19 byte A/C messages. +// +// Code by crankyoldgit. +// +// Supported Remotes: Daikin ARC480A5 remote +// +// Ref: +// https://github.com/crankyoldgit/IRremoteESP8266/issues/873 +IRDaikin152::IRDaikin152(const uint16_t pin, const bool inverted, + const bool use_modulation) + : _irsend(pin, inverted, use_modulation) { stateReset(); } + +void IRDaikin152::begin() { _irsend.begin(); } + +#if SEND_DAIKIN152 +void IRDaikin152::send(const uint16_t repeat) { + checksum(); + _irsend.sendDaikin152(remote_state, kDaikin152StateLength, repeat); +} +#endif // SEND_DAIKIN152 + +// Verify the checksum is valid for a given state. +// Args: +// state: The array to verify the checksum of. +// length: The size of the state. +// Returns: +// A boolean. +bool IRDaikin152::validChecksum(uint8_t state[], const uint16_t length) { + // Validate the checksum of the given state. + if (length <= 1 || state[length - 1] != sumBytes(state, length - 1)) + return false; + else + return true; +} + +// Calculate and set the checksum values for the internal state. +void IRDaikin152::checksum() { + remote_state[kDaikin152StateLength - 1] = sumBytes( + remote_state, kDaikin152StateLength - 1); +} + +void IRDaikin152::stateReset() { + for (uint8_t i = 3; i < kDaikin152StateLength; i++) remote_state[i] = 0x00; + remote_state[0] = 0x11; + remote_state[1] = 0xDA; + remote_state[2] = 0x27; + // remote_state[19] is a checksum byte, it will be set by checksum(). +} + +uint8_t *IRDaikin152::getRaw() { + checksum(); // Ensure correct settings before sending. + return remote_state; +} + +void IRDaikin152::setRaw(const uint8_t new_code[]) { + for (uint8_t i = 0; i < kDaikin152StateLength; i++) + remote_state[i] = new_code[i]; +} diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Daikin.h b/lib/IRremoteESP8266-2.6.5/src/ir_Daikin.h old mode 100644 new mode 100755 similarity index 94% rename from lib/IRremoteESP8266-2.6.4/src/ir_Daikin.h rename to lib/IRremoteESP8266-2.6.5/src/ir_Daikin.h index ad9e1c182..98a38c640 --- a/lib/IRremoteESP8266-2.6.4/src/ir_Daikin.h +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Daikin.h @@ -16,7 +16,7 @@ // Brand: Daikin, Model: FTXB12AXVJU A/C (DAIKIN128) // Brand: Daikin, Model: FTXB09AXVJU A/C (DAIKIN128) // Brand: Daikin, Model: BRC52B63 remote (DAIKIN128) - +// Brand: Daikin, Model: ARC480A5 remote (DAIKIN152) #ifndef IR_DAIKIN_H_ #define IR_DAIKIN_H_ @@ -32,7 +32,7 @@ #endif /* - Daikin AC map + Daikin AC map (i.e. DAIKIN, not the other variants) byte 6= b4:Comfort byte 7= checksum of the first part (and last byte before a 29ms pause) @@ -176,7 +176,7 @@ const uint16_t kDaikin2ZeroSpace = 420; const uint16_t kDaikin2Sections = 2; const uint16_t kDaikin2Section1Length = 20; const uint16_t kDaikin2Section2Length = 19; -const uint8_t kDaikin2Tolerance = kTolerance + 5; +const uint8_t kDaikin2Tolerance = 5; // Extra percentage tolerance const uint8_t kDaikin2BitSleepTimer = 0b00100000; const uint8_t kDaikin2BitPurify = 0b00010000; @@ -328,6 +328,17 @@ const uint8_t kDaikin128BitWall = 0b00001000; const uint8_t kDaikin128BitCeiling = 0b00000001; const uint8_t kDaikin128MaskLight = kDaikin128BitWall | kDaikin128BitCeiling; +// Another variant of the protocol for the Daikin ARC480A5 remote. +// Ref: https://github.com/crankyoldgit/IRremoteESP8266/issues/873 +const uint16_t kDaikin152Freq = 38000; // Modulation Frequency in Hz. +const uint8_t kDaikin152LeaderBits = 5; +const uint16_t kDaikin152HdrMark = 3492; +const uint16_t kDaikin152HdrSpace = 1718; +const uint16_t kDaikin152BitMark = 433; +const uint16_t kDaikin152OneSpace = 1529; +const uint16_t kDaikin152ZeroSpace = kDaikin152BitMark; +const uint16_t kDaikin152Gap = 25182; + // Legacy defines. #define DAIKIN_COOL kDaikinCool #define DAIKIN_HEAT kDaikinHeat @@ -603,6 +614,7 @@ class IRDaikin160 { void stateReset(); void checksum(); }; + // Class to emulate a Daikin BRC4C153 remote. class IRDaikin176 { public: @@ -721,4 +733,31 @@ class IRDaikin128 { void clearSleepTimerFlag(void); }; +// Class to emulate a Daikin ARC480A5 remote. +class IRDaikin152 { + public: + explicit IRDaikin152(const uint16_t pin, const bool inverted = false, + const bool use_modulation = true); + +#if SEND_DAIKIN152 + void send(const uint16_t repeat = kDaikin152DefaultRepeat); + uint8_t calibrate(void) { return _irsend.calibrate(); } +#endif + void begin(); + uint8_t* getRaw(); + void setRaw(const uint8_t new_code[]); + static bool validChecksum(uint8_t state[], + const uint16_t length = kDaikin152StateLength); +#ifndef UNIT_TEST + + private: + IRsend _irsend; +#else + IRsendTest _irsend; +#endif + // # of bytes per command + uint8_t remote_state[kDaikin152StateLength]; + void stateReset(); + void checksum(); +}; #endif // IR_DAIKIN_H_ diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Denon.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Denon.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Denon.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Denon.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Dish.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Dish.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Dish.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Dish.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Electra.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Electra.cpp old mode 100644 new mode 100755 similarity index 99% rename from lib/IRremoteESP8266-2.6.4/src/ir_Electra.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Electra.cpp index 4c61da34d..6b945aa3f --- a/lib/IRremoteESP8266-2.6.4/src/ir_Electra.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Electra.cpp @@ -317,7 +317,7 @@ bool IRrecv::decodeElectraAC(decode_results *results, uint16_t nbits, kElectraAcBitMark, kElectraAcOneSpace, kElectraAcBitMark, kElectraAcZeroSpace, kElectraAcBitMark, kElectraAcMessageGap, true, - kTolerance, 0, false)) return false; + _tolerance, 0, false)) return false; // Compliance if (strict) { diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Electra.h b/lib/IRremoteESP8266-2.6.5/src/ir_Electra.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Electra.h rename to lib/IRremoteESP8266-2.6.5/src/ir_Electra.h diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Fujitsu.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Fujitsu.cpp old mode 100644 new mode 100755 similarity index 98% rename from lib/IRremoteESP8266-2.6.4/src/ir_Fujitsu.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Fujitsu.cpp index 43695b932..fa6a0ce8c --- a/lib/IRremoteESP8266-2.6.4/src/ir_Fujitsu.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Fujitsu.cpp @@ -267,9 +267,6 @@ bool IRFujitsuAC::setRaw(const uint8_t newState[], const uint16_t length) { return true; } -// Set the requested power state of the A/C to off. -void IRFujitsuAC::off(void) { this->setCmd(kFujitsuAcCmdTurnOff); } - void IRFujitsuAC::stepHoriz(void) { this->setCmd(kFujitsuAcCmdStepHoriz); } void IRFujitsuAC::toggleSwingHoriz(const bool update) { @@ -336,6 +333,17 @@ uint8_t IRFujitsuAC::getCmd(const bool raw) { return _cmd; } +// Set the requested power state of the A/C. +void IRFujitsuAC::setPower(const bool on) { + this->setCmd(on ? kFujitsuAcCmdTurnOn : kFujitsuAcCmdTurnOff); +} + +// Set the requested power state of the A/C to off. +void IRFujitsuAC::off(void) { this->setPower(false); } + +// Set the requested power state of the A/C to on. +void IRFujitsuAC::on(void) { this->setPower(true); } + bool IRFujitsuAC::getPower(void) { return _cmd != kFujitsuAcCmdTurnOff; } void IRFujitsuAC::setOutsideQuiet(const bool on) { @@ -649,7 +657,7 @@ bool IRrecv::decodeFujitsuAC(decode_results* results, uint16_t nbits, match_result_t data_result = matchData(&(results->rawbuf[offset]), kFujitsuAcMinBits - 8, kFujitsuAcBitMark, kFujitsuAcOneSpace, kFujitsuAcBitMark, - kFujitsuAcZeroSpace, kTolerance, kMarkExcess, false); + kFujitsuAcZeroSpace, _tolerance, kMarkExcess, false); if (data_result.success == false) return false; // Fail if (data_result.data != 0x1010006314) return false; // Signature failed. dataBitsSoFar += kFujitsuAcMinBits - 8; @@ -666,7 +674,7 @@ bool IRrecv::decodeFujitsuAC(decode_results* results, uint16_t nbits, i++, dataBitsSoFar += 8, offset += data_result.used) { data_result = matchData( &(results->rawbuf[offset]), 8, kFujitsuAcBitMark, kFujitsuAcOneSpace, - kFujitsuAcBitMark, kFujitsuAcZeroSpace, kTolerance, kMarkExcess, false); + kFujitsuAcBitMark, kFujitsuAcZeroSpace, _tolerance, kMarkExcess, false); if (data_result.success == false) break; // Fail results->state[i] = data_result.data; } diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Fujitsu.h b/lib/IRremoteESP8266-2.6.5/src/ir_Fujitsu.h old mode 100644 new mode 100755 similarity index 99% rename from lib/IRremoteESP8266-2.6.4/src/ir_Fujitsu.h rename to lib/IRremoteESP8266-2.6.5/src/ir_Fujitsu.h index 469e7ee9c..e953f9058 --- a/lib/IRremoteESP8266-2.6.4/src/ir_Fujitsu.h +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Fujitsu.h @@ -104,7 +104,6 @@ class IRFujitsuAC { uint8_t calibrate(void) { return _irsend.calibrate(); } #endif // SEND_FUJITSU_AC void begin(void); - void off(void); void stepHoriz(void); void toggleSwingHoriz(const bool update = true); void stepVert(void); @@ -123,6 +122,9 @@ class IRFujitsuAC { bool setRaw(const uint8_t newState[], const uint16_t length); uint8_t getStateLength(void); static bool validChecksum(uint8_t* state, const uint16_t length); + void setPower(const bool on); + void off(void); + void on(void); bool getPower(void); void setOutsideQuiet(const bool on); diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_GICable.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_GICable.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_GICable.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_GICable.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_GlobalCache.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_GlobalCache.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_GlobalCache.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_GlobalCache.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Goodweather.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Goodweather.cpp old mode 100644 new mode 100755 similarity index 99% rename from lib/IRremoteESP8266-2.6.4/src/ir_Goodweather.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Goodweather.cpp index a196cb7ef..d8ac45f1b --- a/lib/IRremoteESP8266-2.6.4/src/ir_Goodweather.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Goodweather.cpp @@ -419,7 +419,7 @@ bool IRrecv::decodeGoodweather(decode_results* results, data_result = matchData(&(results->rawbuf[offset]), 8, kGoodweatherBitMark, kGoodweatherOneSpace, kGoodweatherBitMark, kGoodweatherZeroSpace, - kTolerance, kMarkExcess, false); + _tolerance, kMarkExcess, false); if (data_result.success == false) return false; DPRINTLN("DEBUG: Normal byte read okay."); offset += data_result.used; @@ -428,7 +428,7 @@ bool IRrecv::decodeGoodweather(decode_results* results, data_result = matchData(&(results->rawbuf[offset]), 8, kGoodweatherBitMark, kGoodweatherOneSpace, kGoodweatherBitMark, kGoodweatherZeroSpace, - kTolerance, kMarkExcess, false); + _tolerance, kMarkExcess, false); if (data_result.success == false) return false; DPRINTLN("DEBUG: Inverted byte read okay."); offset += data_result.used; diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Goodweather.h b/lib/IRremoteESP8266-2.6.5/src/ir_Goodweather.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Goodweather.h rename to lib/IRremoteESP8266-2.6.5/src/ir_Goodweather.h diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Gree.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Gree.cpp old mode 100644 new mode 100755 similarity index 90% rename from lib/IRremoteESP8266-2.6.4/src/ir_Gree.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Gree.cpp index 2bfb8e8b5..a4d906424 --- a/lib/IRremoteESP8266-2.6.4/src/ir_Gree.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Gree.cpp @@ -35,6 +35,7 @@ using irutils::addLabeledString; using irutils::addModeToString; using irutils::addFanToString; using irutils::addTempToString; +using irutils::minsToString; #if SEND_GREE // Send a Gree Heat Pump message. @@ -222,12 +223,13 @@ void IRGreeAC::setTemp(const uint8_t temp) { uint8_t new_temp = std::max((uint8_t)kGreeMinTemp, temp); new_temp = std::min((uint8_t)kGreeMaxTemp, new_temp); if (getMode() == kGreeAuto) new_temp = 25; - remote_state[1] = (remote_state[1] & 0xF0U) | (new_temp - kGreeMinTemp); + remote_state[1] = (remote_state[1] & ~kGreeTempMask) | + (new_temp - kGreeMinTemp); } // Return the set temp. in deg C uint8_t IRGreeAC::getTemp(void) { - return ((remote_state[1] & 0xFU) + kGreeMinTemp); + return ((remote_state[1] & kGreeTempMask) + kGreeMinTemp); } // Set the speed of the fan, 0-3, 0 is auto, 1-3 is the speed @@ -359,6 +361,44 @@ uint8_t IRGreeAC::getSwingVerticalPosition(void) { return remote_state[4] & kGreeSwingPosMask; } +void IRGreeAC::setTimerEnabled(const bool on) { + if (on) + remote_state[1] |= kGreeTimerEnabledBit; + else + remote_state[1] &= ~kGreeTimerEnabledBit; +} + +bool IRGreeAC::getTimerEnabled(void) { + return remote_state[1] & kGreeTimerEnabledBit; +} + +// Returns the number of minutes the timer is set for. +uint16_t IRGreeAC::getTimer(void) { + uint16_t hrs = irutils::bcdToUint8( + (remote_state[2] & kGreeTimerHoursMask) | + ((remote_state[1] & kGreeTimerTensHrMask) >> 1)); + return hrs * 60 + ((remote_state[1] & kGreeTimerHalfHrBit) ? 30 : 0); +} + +// Set the A/C's timer to turn off in X many minutes. +// Stores time internally in 30 min units. +// e.g. 5 mins means 0 (& Off), 95 mins is 90 mins (& On). Max is 24 hours. +// +// Args: +// minutes: The number of minutes the timer should be set for. +void IRGreeAC::setTimer(const uint16_t minutes) { + // Clear the previous settings. + remote_state[1] &= ~kGreeTimer1Mask; + remote_state[2] &= ~kGreeTimerHoursMask; + uint16_t mins = std::min(kGreeTimerMax, minutes); // Bounds check. + setTimerEnabled(mins >= 30); // Timer is enabled when >= 30 mins. + uint8_t hours = mins / 60; + uint8_t halfhour = (mins % 60) < 30 ? 0 : 1; + // Set the "tens" digit of hours & the half hour. + remote_state[1] |= (((hours / 10) << 1) | halfhour) << 4; + // Set the "units" digit of hours. + remote_state[2] |= (hours % 10); +} // Convert a standard A/C mode into its native mode. uint8_t IRGreeAC::convertMode(const stdAc::opmode_t mode) { @@ -504,6 +544,11 @@ String IRGreeAC::toString(void) { result += F(" (Auto)"); break; } + result += F(", Timer: "); + if (getTimerEnabled()) + result += minsToString(getTimer()); + else + result += F("Off"); return result; } @@ -538,7 +583,7 @@ bool IRrecv::decodeGree(decode_results* results, uint16_t nbits, bool strict) { kGreeBitMark, kGreeOneSpace, kGreeBitMark, kGreeZeroSpace, 0, 0, false, - kTolerance, kMarkExcess, false); + _tolerance, kMarkExcess, false); if (used == 0) return false; offset += used; @@ -546,7 +591,7 @@ bool IRrecv::decodeGree(decode_results* results, uint16_t nbits, bool strict) { match_result_t data_result; data_result = matchData(&(results->rawbuf[offset]), kGreeBlockFooterBits, kGreeBitMark, kGreeOneSpace, kGreeBitMark, - kGreeZeroSpace, kTolerance, kMarkExcess, false); + kGreeZeroSpace, _tolerance, kMarkExcess, false); if (data_result.success == false) return false; if (data_result.data != kGreeBlockFooter) return false; offset += data_result.used; @@ -558,7 +603,7 @@ bool IRrecv::decodeGree(decode_results* results, uint16_t nbits, bool strict) { kGreeBitMark, kGreeOneSpace, kGreeBitMark, kGreeZeroSpace, kGreeBitMark, kGreeMsgSpace, true, - kTolerance, kMarkExcess, false)) return false; + _tolerance, kMarkExcess, false)) return false; // Compliance if (strict) { diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Gree.h b/lib/IRremoteESP8266-2.6.5/src/ir_Gree.h old mode 100644 new mode 100755 similarity index 72% rename from lib/IRremoteESP8266-2.6.4/src/ir_Gree.h rename to lib/IRremoteESP8266-2.6.5/src/ir_Gree.h index 9619c68e3..a399d50d5 --- a/lib/IRremoteESP8266-2.6.4/src/ir_Gree.h +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Gree.h @@ -36,40 +36,48 @@ const uint8_t kGreeFan = 3; const uint8_t kGreeHeat = 4; // Byte 0 -const uint8_t kGreeModeMask = 0b00000111; -const uint8_t kGreePower1Mask = 0b00001000; -const uint8_t kGreeFanMask = 0b00110000; -const uint8_t kGreeSwingAutoMask = 0b01000000; -const uint8_t kGreeSleepMask = 0b10000000; -// Byte 2 -const uint8_t kGreeTurboMask = 0b00010000; -const uint8_t kGreeLightMask = 0b00100000; -const uint8_t kGreePower2Mask = 0b01000000; // This might not be used. See #814 -const uint8_t kGreeXfanMask = 0b10000000; -// Byte 4 -const uint8_t kGreeSwingPosMask = 0b00001111; -// byte 5 -const uint8_t kGreeIFeelMask = 0b00000100; -const uint8_t kGreeWiFiMask = 0b01000000; - - -const uint8_t kGreeMinTemp = 16; // Celsius -const uint8_t kGreeMaxTemp = 30; // Celsius +const uint8_t kGreeModeMask = 0b00000111; +const uint8_t kGreePower1Mask = 0b00001000; +const uint8_t kGreeFanMask = 0b00110000; const uint8_t kGreeFanAuto = 0; const uint8_t kGreeFanMin = 1; const uint8_t kGreeFanMed = 2; const uint8_t kGreeFanMax = 3; +const uint8_t kGreeSwingAutoMask = 0b01000000; +const uint8_t kGreeSleepMask = 0b10000000; +// Byte 1 +const uint8_t kGreeTempMask = 0b00001111; +const uint8_t kGreeMinTemp = 16; // Celsius +const uint8_t kGreeMaxTemp = 30; // Celsius +const uint8_t kGreeTimerEnabledBit = 0b10000000; +const uint8_t kGreeTimerHalfHrBit = 0b00010000; +const uint8_t kGreeTimerTensHrMask = 0b01100000; +const uint8_t kGreeTimer1Mask = kGreeTimerTensHrMask | kGreeTimerHalfHrBit; +const uint16_t kGreeTimerMax = 24 * 60; -const uint8_t kGreeSwingLastPos = 0b00000000; -const uint8_t kGreeSwingAuto = 0b00000001; -const uint8_t kGreeSwingUp = 0b00000010; -const uint8_t kGreeSwingMiddleUp = 0b00000011; -const uint8_t kGreeSwingMiddle = 0b00000100; +// Byte 2 +const uint8_t kGreeTimerHoursMask = 0b00001111; +const uint8_t kGreeTurboMask = 0b00010000; +const uint8_t kGreeLightMask = 0b00100000; +// This might not be used. See #814 +const uint8_t kGreePower2Mask = 0b01000000; +const uint8_t kGreeXfanMask = 0b10000000; +// Byte 4 +const uint8_t kGreeSwingPosMask = 0b00001111; +// byte 5 +const uint8_t kGreeIFeelMask = 0b00000100; +const uint8_t kGreeWiFiMask = 0b01000000; + +const uint8_t kGreeSwingLastPos = 0b00000000; +const uint8_t kGreeSwingAuto = 0b00000001; +const uint8_t kGreeSwingUp = 0b00000010; +const uint8_t kGreeSwingMiddleUp = 0b00000011; +const uint8_t kGreeSwingMiddle = 0b00000100; const uint8_t kGreeSwingMiddleDown = 0b00000101; -const uint8_t kGreeSwingDown = 0b00000110; -const uint8_t kGreeSwingDownAuto = 0b00000111; +const uint8_t kGreeSwingDown = 0b00000110; +const uint8_t kGreeSwingDownAuto = 0b00000111; const uint8_t kGreeSwingMiddleAuto = 0b00001001; -const uint8_t kGreeSwingUpAuto = 0b00001011; +const uint8_t kGreeSwingUpAuto = 0b00001011; // Legacy defines. #define GREE_AUTO kGreeAuto @@ -132,6 +140,8 @@ class IRGreeAC { void setSwingVertical(const bool automatic, const uint8_t position); bool getSwingVerticalAuto(void); uint8_t getSwingVerticalPosition(void); + uint16_t getTimer(void); + void setTimer(const uint16_t minutes); uint8_t convertMode(const stdAc::opmode_t mode); uint8_t convertFan(const stdAc::fanspeed_t speed); uint8_t convertSwingV(const stdAc::swingv_t swingv); @@ -156,6 +166,8 @@ class IRGreeAC { gree_ac_remote_model_t _model; void checksum(const uint16_t length = kGreeStateLength); void fixup(void); + void setTimerEnabled(const bool on); + bool getTimerEnabled(void); }; #endif // IR_GREE_H_ diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Haier.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Haier.cpp old mode 100644 new mode 100755 similarity index 99% rename from lib/IRremoteESP8266-2.6.4/src/ir_Haier.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Haier.cpp index 8cb24334c..d2b947f9e --- a/lib/IRremoteESP8266-2.6.4/src/ir_Haier.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Haier.cpp @@ -933,7 +933,7 @@ bool IRrecv::decodeHaierAC(decode_results* results, uint16_t nbits, kHaierAcBitMark, kHaierAcOneSpace, kHaierAcBitMark, kHaierAcZeroSpace, kHaierAcBitMark, kHaierAcMinGap, true, - kTolerance, kMarkExcess)) return false; + _tolerance, kMarkExcess)) return false; // Compliance if (strict) { diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Haier.h b/lib/IRremoteESP8266-2.6.5/src/ir_Haier.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Haier.h rename to lib/IRremoteESP8266-2.6.5/src/ir_Haier.h diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Hitachi.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Hitachi.cpp old mode 100644 new mode 100755 similarity index 99% rename from lib/IRremoteESP8266-2.6.4/src/ir_Hitachi.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Hitachi.cpp index dedaa5696..0550816a9 --- a/lib/IRremoteESP8266-2.6.4/src/ir_Hitachi.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Hitachi.cpp @@ -382,7 +382,7 @@ String IRHitachiAc::toString(void) { // https://github.com/crankyoldgit/IRremoteESP8266/issues/453 bool IRrecv::decodeHitachiAC(decode_results *results, const uint16_t nbits, const bool strict) { - const uint8_t kTolerance = 30; + const uint8_t k_tolerance = _tolerance + 5; if (results->rawlen < 2 * nbits + kHeader + kFooter - 1) return false; // Can't possibly be a valid HitachiAC message. if (strict) { @@ -412,7 +412,7 @@ bool IRrecv::decodeHitachiAC(decode_results *results, const uint16_t nbits, kHitachiAcBitMark, kHitachiAcOneSpace, kHitachiAcBitMark, kHitachiAcZeroSpace, kHitachiAcBitMark, kHitachiAcMinGap, true, - kTolerance)) return false; + k_tolerance)) return false; // Compliance if (strict) { diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Hitachi.h b/lib/IRremoteESP8266-2.6.5/src/ir_Hitachi.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Hitachi.h rename to lib/IRremoteESP8266-2.6.5/src/ir_Hitachi.h diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Inax.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Inax.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Inax.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Inax.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_JVC.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_JVC.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_JVC.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_JVC.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Kelvinator.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Kelvinator.cpp old mode 100644 new mode 100755 similarity index 97% rename from lib/IRremoteESP8266-2.6.4/src/ir_Kelvinator.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Kelvinator.cpp index f280d0161..0af521b15 --- a/lib/IRremoteESP8266-2.6.4/src/ir_Kelvinator.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Kelvinator.cpp @@ -475,7 +475,7 @@ bool IRrecv::decodeKelvinator(decode_results *results, uint16_t nbits, kKelvinatorBitMark, kKelvinatorOneSpace, kKelvinatorBitMark, kKelvinatorZeroSpace, 0, 0, false, - kTolerance, kMarkExcess, false); + _tolerance, kMarkExcess, false); if (used == 0) return false; offset += used; pos += 4; @@ -485,26 +485,20 @@ bool IRrecv::decodeKelvinator(decode_results *results, uint16_t nbits, &(results->rawbuf[offset]), kKelvinatorCmdFooterBits, kKelvinatorBitMark, kKelvinatorOneSpace, kKelvinatorBitMark, kKelvinatorZeroSpace, - kTolerance, kMarkExcess, false); + _tolerance, kMarkExcess, false); if (data_result.success == false) return false; if (data_result.data != kKelvinatorCmdFooter) return false; offset += data_result.used; - // Interdata gap. - if (!matchMark(results->rawbuf[offset++], kKelvinatorBitMark)) - return false; - if (!matchSpace(results->rawbuf[offset++], kKelvinatorGapSpace)) - return false; - - // Data (Options) (32 bits) + // Gap + Data (Options) (32 bits) used = matchGeneric(results->rawbuf + offset, results->state + pos, results->rawlen - offset, 32, - 0, 0, + kKelvinatorBitMark, kKelvinatorGapSpace, kKelvinatorBitMark, kKelvinatorOneSpace, kKelvinatorBitMark, kKelvinatorZeroSpace, kKelvinatorBitMark, kKelvinatorGapSpace * 2, s > 0, - kTolerance, kMarkExcess, false); + _tolerance, kMarkExcess, false); if (used == 0) return false; offset += used; pos += 4; diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Kelvinator.h b/lib/IRremoteESP8266-2.6.5/src/ir_Kelvinator.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Kelvinator.h rename to lib/IRremoteESP8266-2.6.5/src/ir_Kelvinator.h diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_LG.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_LG.cpp old mode 100644 new mode 100755 similarity index 99% rename from lib/IRremoteESP8266-2.6.4/src/ir_LG.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_LG.cpp index ded6fefad..124256e9f --- a/lib/IRremoteESP8266-2.6.4/src/ir_LG.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/ir_LG.cpp @@ -237,7 +237,7 @@ bool IRrecv::decodeLG(decode_results *results, uint16_t nbits, bool strict) { match_result_t data_result = matchData(&(results->rawbuf[offset]), nbits, bitmarkticks * m_tick, kLgOneSpaceTicks * s_tick, bitmarkticks * m_tick, - kLgZeroSpaceTicks * s_tick, kTolerance, 0); + kLgZeroSpaceTicks * s_tick, _tolerance, 0); if (data_result.success == false) return false; data = data_result.data; offset += data_result.used; diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_LG.h b/lib/IRremoteESP8266-2.6.5/src/ir_LG.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_LG.h rename to lib/IRremoteESP8266-2.6.5/src/ir_LG.h diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Lasertag.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Lasertag.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Lasertag.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Lasertag.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Lego.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Lego.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Lego.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Lego.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Lutron.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Lutron.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Lutron.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Lutron.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_MWM.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_MWM.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_MWM.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_MWM.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Magiquest.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Magiquest.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Magiquest.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Magiquest.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Magiquest.h b/lib/IRremoteESP8266-2.6.5/src/ir_Magiquest.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Magiquest.h rename to lib/IRremoteESP8266-2.6.5/src/ir_Magiquest.h diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Midea.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Midea.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Midea.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Midea.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Midea.h b/lib/IRremoteESP8266-2.6.5/src/ir_Midea.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Midea.h rename to lib/IRremoteESP8266-2.6.5/src/ir_Midea.h diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Mitsubishi.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Mitsubishi.cpp old mode 100644 new mode 100755 similarity index 99% rename from lib/IRremoteESP8266-2.6.4/src/ir_Mitsubishi.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Mitsubishi.cpp index 14a0676fd..c78b1d21a --- a/lib/IRremoteESP8266-2.6.4/src/ir_Mitsubishi.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Mitsubishi.cpp @@ -302,7 +302,7 @@ bool IRrecv::decodeMitsubishiAC(decode_results *results, uint16_t nbits, data_result = matchData(&(results->rawbuf[offset]), 8, kMitsubishiAcBitMark, kMitsubishiAcOneSpace, kMitsubishiAcBitMark, - kMitsubishiAcZeroSpace, kTolerance, kMarkExcess, false); + kMitsubishiAcZeroSpace, _tolerance, kMarkExcess, false); if (data_result.success == false) { failure = true; DPRINT("Byte decode failed at #"); @@ -365,7 +365,7 @@ bool IRrecv::decodeMitsubishiAC(decode_results *results, uint16_t nbits, data_result = matchData(&(results->rawbuf[offset]), 8, kMitsubishiAcBitMark, kMitsubishiAcOneSpace, kMitsubishiAcBitMark, - kMitsubishiAcZeroSpace, kTolerance, kMarkExcess, false); + kMitsubishiAcZeroSpace, _tolerance, kMarkExcess, false); if (data_result.success == false || data_result.data != results->state[i]) { DPRINTLN("Repeat payload error."); @@ -672,6 +672,8 @@ uint8_t IRMitsubishiAC::convertSwingH(const stdAc::swingh_t position) { return kMitsubishiAcWideVaneAuto - 4; case stdAc::swingh_t::kRightMax: return kMitsubishiAcWideVaneAuto - 3; + case stdAc::swingh_t::kWide: + return kMitsubishiAcWideVaneAuto - 2; case stdAc::swingh_t::kAuto: return kMitsubishiAcWideVaneAuto; default: @@ -721,6 +723,7 @@ stdAc::swingh_t IRMitsubishiAC::toCommonSwingH(const uint8_t pos) { case 3: return stdAc::swingh_t::kMiddle; case 4: return stdAc::swingh_t::kRight; case 5: return stdAc::swingh_t::kRightMax; + case 6: return stdAc::swingh_t::kWide; default: return stdAc::swingh_t::kAuto; } } diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Mitsubishi.h b/lib/IRremoteESP8266-2.6.5/src/ir_Mitsubishi.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Mitsubishi.h rename to lib/IRremoteESP8266-2.6.5/src/ir_Mitsubishi.h diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_MitsubishiHeavy.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_MitsubishiHeavy.cpp old mode 100644 new mode 100755 similarity index 99% rename from lib/IRremoteESP8266-2.6.4/src/ir_MitsubishiHeavy.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_MitsubishiHeavy.cpp index 98a681e05..6b4295991 --- a/lib/IRremoteESP8266-2.6.4/src/ir_MitsubishiHeavy.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/ir_MitsubishiHeavy.cpp @@ -1045,7 +1045,7 @@ bool IRrecv::decodeMitsubishiHeavy(decode_results* results, kMitsubishiHeavyBitMark, kMitsubishiHeavyOneSpace, kMitsubishiHeavyBitMark, kMitsubishiHeavyZeroSpace, kMitsubishiHeavyBitMark, kMitsubishiHeavyGap, true, - kTolerance, 0, false); + _tolerance, 0, false); if (used == 0) return false; offset += used; // Compliance diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_MitsubishiHeavy.h b/lib/IRremoteESP8266-2.6.5/src/ir_MitsubishiHeavy.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_MitsubishiHeavy.h rename to lib/IRremoteESP8266-2.6.5/src/ir_MitsubishiHeavy.h diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_NEC.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_NEC.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_NEC.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_NEC.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_NEC.h b/lib/IRremoteESP8266-2.6.5/src/ir_NEC.h old mode 100644 new mode 100755 similarity index 93% rename from lib/IRremoteESP8266-2.6.4/src/ir_NEC.h rename to lib/IRremoteESP8266-2.6.5/src/ir_NEC.h index fef1a65fd..e45ff702c --- a/lib/IRremoteESP8266-2.6.4/src/ir_NEC.h +++ b/lib/IRremoteESP8266-2.6.5/src/ir_NEC.h @@ -9,6 +9,10 @@ #include #include "IRremoteESP8266.h" +// Supports: +// Brand: Yamaha, Model: RAV561 remote +// Brand: Yamaha, Model: RXV585B A/V Receiver + // Constants // Ref: // http://www.sbprojects.com/knowledge/ir/nec.php diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Neoclima.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Neoclima.cpp old mode 100644 new mode 100755 similarity index 99% rename from lib/IRremoteESP8266-2.6.4/src/ir_Neoclima.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Neoclima.cpp index bd2a3d1b5..353d43b14 --- a/lib/IRremoteESP8266-2.6.4/src/ir_Neoclima.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Neoclima.cpp @@ -528,7 +528,7 @@ bool IRrecv::decodeNeoclima(decode_results *results, const uint16_t nbits, kNeoclimaBitMark, kNeoclimaOneSpace, kNeoclimaBitMark, kNeoclimaZeroSpace, kNeoclimaBitMark, kNeoclimaHdrSpace, false, - kTolerance, 0, false); + _tolerance, 0, false); if (!used) return false; offset += used; // Extra footer. diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Neoclima.h b/lib/IRremoteESP8266-2.6.5/src/ir_Neoclima.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Neoclima.h rename to lib/IRremoteESP8266-2.6.5/src/ir_Neoclima.h diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Nikai.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Nikai.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Nikai.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Nikai.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Panasonic.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Panasonic.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Panasonic.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Panasonic.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Panasonic.h b/lib/IRremoteESP8266-2.6.5/src/ir_Panasonic.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Panasonic.h rename to lib/IRremoteESP8266-2.6.5/src/ir_Panasonic.h diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Pioneer.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Pioneer.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Pioneer.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Pioneer.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Pronto.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Pronto.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Pronto.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Pronto.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_RC5_RC6.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_RC5_RC6.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_RC5_RC6.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_RC5_RC6.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_RCMM.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_RCMM.cpp old mode 100644 new mode 100755 similarity index 98% rename from lib/IRremoteESP8266-2.6.4/src/ir_RCMM.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_RCMM.cpp index cbc5e40b3..4e8f43891 --- a/lib/IRremoteESP8266-2.6.4/src/ir_RCMM.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/ir_RCMM.cpp @@ -141,11 +141,9 @@ bool IRrecv::decodeRCMM(decode_results *results, uint16_t nbits, bool strict) { data <<= 2; // Use non-default tolerance & excess for matching some of the spaces as the // defaults are too generous and causes mis-matches in some cases. - if (match(results->rawbuf[offset], kRcmmBitSpace0Ticks * s_tick, - kTolerance)) + if (match(results->rawbuf[offset], kRcmmBitSpace0Ticks * s_tick)) data += 0; - else if (match(results->rawbuf[offset], kRcmmBitSpace1Ticks * s_tick, - kTolerance)) + else if (match(results->rawbuf[offset], kRcmmBitSpace1Ticks * s_tick)) data += 1; else if (match(results->rawbuf[offset], kRcmmBitSpace2Ticks * s_tick, kRcmmTolerance)) diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Samsung.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Samsung.cpp old mode 100644 new mode 100755 similarity index 99% rename from lib/IRremoteESP8266-2.6.4/src/ir_Samsung.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Samsung.cpp index 09ba3e199..77985b1c4 --- a/lib/IRremoteESP8266-2.6.4/src/ir_Samsung.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Samsung.cpp @@ -742,7 +742,7 @@ bool IRrecv::decodeSamsungAC(decode_results *results, const uint16_t nbits, kSamsungAcBitMark, kSamsungAcZeroSpace, kSamsungAcBitMark, kSamsungAcSectionGap, pos + kSamsungACSectionLength >= nbits / 8, - kTolerance, 0, false); + _tolerance, 0, false); if (used == 0) return false; offset += used; } diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Samsung.h b/lib/IRremoteESP8266-2.6.5/src/ir_Samsung.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Samsung.h rename to lib/IRremoteESP8266-2.6.5/src/ir_Samsung.h diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Sanyo.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Sanyo.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Sanyo.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Sanyo.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Sharp.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Sharp.cpp old mode 100644 new mode 100755 similarity index 99% rename from lib/IRremoteESP8266-2.6.4/src/ir_Sharp.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Sharp.cpp index b27c319e0..250248554 --- a/lib/IRremoteESP8266-2.6.4/src/ir_Sharp.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Sharp.cpp @@ -538,7 +538,7 @@ bool IRrecv::decodeSharpAc(decode_results *results, const uint16_t nbits, kSharpAcBitMark, kSharpAcOneSpace, kSharpAcBitMark, kSharpAcZeroSpace, kSharpAcBitMark, kSharpAcGap, true, - kTolerance, kMarkExcess, false); + _tolerance, kMarkExcess, false); if (used == 0) return false; offset += used; // Compliance diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Sharp.h b/lib/IRremoteESP8266-2.6.5/src/ir_Sharp.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Sharp.h rename to lib/IRremoteESP8266-2.6.5/src/ir_Sharp.h diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Sherwood.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Sherwood.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Sherwood.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Sherwood.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Sony.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Sony.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Sony.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Sony.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Tcl.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Tcl.cpp old mode 100644 new mode 100755 similarity index 99% rename from lib/IRremoteESP8266-2.6.4/src/ir_Tcl.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Tcl.cpp index 80cefdeb1..0186f43e5 --- a/lib/IRremoteESP8266-2.6.4/src/ir_Tcl.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Tcl.cpp @@ -396,7 +396,7 @@ bool IRrecv::decodeTcl112Ac(decode_results *results, const uint16_t nbits, kTcl112AcBitMark, kTcl112AcOneSpace, kTcl112AcBitMark, kTcl112AcZeroSpace, kTcl112AcBitMark, kTcl112AcGap, true, - kTcl112AcTolerance, 0, false)) return false; + _tolerance + kTcl112AcTolerance, 0, false)) return false; // Compliance // Verify we got a valid checksum. if (strict && !IRTcl112Ac::validChecksum(results->state)) return false; diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Tcl.h b/lib/IRremoteESP8266-2.6.5/src/ir_Tcl.h old mode 100644 new mode 100755 similarity index 98% rename from lib/IRremoteESP8266-2.6.4/src/ir_Tcl.h rename to lib/IRremoteESP8266-2.6.5/src/ir_Tcl.h index dce81c4ec..1a1bc1d6b --- a/lib/IRremoteESP8266-2.6.4/src/ir_Tcl.h +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Tcl.h @@ -23,7 +23,7 @@ const uint16_t kTcl112AcBitMark = 500; const uint16_t kTcl112AcOneSpace = 1050; const uint16_t kTcl112AcZeroSpace = 325; const uint32_t kTcl112AcGap = kDefaultMessageGap; // Just a guess. -const uint8_t kTcl112AcTolerance = kTolerance + 5; // Percent +const uint8_t kTcl112AcTolerance = 5; // Extra Percent const uint8_t kTcl112AcHeat = 1; const uint8_t kTcl112AcDry = 2; diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Teco.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Teco.cpp old mode 100644 new mode 100755 similarity index 87% rename from lib/IRremoteESP8266-2.6.4/src/ir_Teco.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Teco.cpp index 9cc47a37d..9967ccee1 --- a/lib/IRremoteESP8266-2.6.4/src/ir_Teco.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Teco.cpp @@ -64,19 +64,18 @@ uint64_t IRTecoAc::getRaw(void) { return remote_state; } void IRTecoAc::setRaw(const uint64_t new_code) { remote_state = new_code; } -void IRTecoAc::on(void) { remote_state |= kTecoPower; } +void IRTecoAc::on(void) { setPower(true); } -void IRTecoAc::off(void) { remote_state &= ~kTecoPower; } +void IRTecoAc::off(void) { setPower(false); } void IRTecoAc::setPower(const bool on) { if (on) - this->on(); + remote_state |= kTecoPower; else - this->off(); + remote_state &= ~kTecoPower; } -bool IRTecoAc::getPower(void) { - return (remote_state & kTecoPower) == kTecoPower; } +bool IRTecoAc::getPower(void) { return remote_state & kTecoPower; } void IRTecoAc::setTemp(const uint8_t temp) { uint8_t newtemp = temp; @@ -146,6 +145,33 @@ void IRTecoAc::setSleep(const bool on) { bool IRTecoAc::getSleep(void) { return remote_state & kTecoSleep; } +bool IRTecoAc::getLight(void) { return remote_state & kTecoLight; } + +void IRTecoAc::setLight(const bool on) { + if (on) + remote_state |= kTecoLight; + else + remote_state &= ~kTecoLight; +} + +bool IRTecoAc::getHumid(void) { return remote_state & kTecoHumid; } + +void IRTecoAc::setHumid(const bool on) { + if (on) + remote_state |= kTecoHumid; + else + remote_state &= ~kTecoHumid; +} + +bool IRTecoAc::getSave(void) { return remote_state & kTecoSave; } + +void IRTecoAc::setSave(const bool on) { + if (on) + remote_state |= kTecoSave; + else + remote_state &= ~kTecoSave; +} + // Convert a standard A/C mode into its native mode. uint8_t IRTecoAc::convertMode(const stdAc::opmode_t mode) { switch (mode) { @@ -212,10 +238,10 @@ stdAc::state_t IRTecoAc::toCommon(void) { result.swingv = this->getSwing() ? stdAc::swingv_t::kAuto : stdAc::swingv_t::kOff; result.sleep = this->getSleep() ? 0 : -1; + result.light = this->getLight(); // Not supported. result.swingh = stdAc::swingh_t::kOff; result.turbo = false; - result.light = false; result.filter = false; result.econo = false; result.quiet = false; @@ -228,7 +254,7 @@ stdAc::state_t IRTecoAc::toCommon(void) { // Convert the internal state into a human readable string. String IRTecoAc::toString(void) { String result = ""; - result.reserve(80); // Reserve some heap for the string to reduce fragging. + result.reserve(100); // Reserve some heap for the string to reduce fragging. result += addBoolToString(getPower(), F("Power"), false); result += addModeToString(getMode(), kTecoAuto, kTecoCool, kTecoHeat, kTecoDry, kTecoFan); @@ -237,6 +263,10 @@ String IRTecoAc::toString(void) { kTecoFanAuto, kTecoFanAuto, kTecoFanMed); result += addBoolToString(getSleep(), F("Sleep")); result += addBoolToString(getSwing(), F("Swing")); + result += addBoolToString(getLight(), F("Light")); + result += addBoolToString(getHumid(), F("Humid")); + result += addBoolToString(getSave(), F("Save")); + return result; } @@ -264,7 +294,7 @@ bool IRrecv::decodeTeco(decode_results* results, kTecoBitMark, kTecoOneSpace, kTecoBitMark, kTecoZeroSpace, kTecoBitMark, kTecoGap, true, - kTolerance, kMarkExcess, false)) return false; + _tolerance, kMarkExcess, false)) return false; // Success results->decode_type = TECO; diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Teco.h b/lib/IRremoteESP8266-2.6.5/src/ir_Teco.h old mode 100644 new mode 100755 similarity index 84% rename from lib/IRremoteESP8266-2.6.4/src/ir_Teco.h rename to lib/IRremoteESP8266-2.6.5/src/ir_Teco.h index d594aca32..616fc5dfb --- a/lib/IRremoteESP8266-2.6.4/src/ir_Teco.h +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Teco.h @@ -12,6 +12,10 @@ #include "IRsend_test.h" #endif +// Supports: +// Brand: Alaska, Model: SAC9010QC A/C +// Brand: Alaska, Model: SAC9010QC remote + // Constants. Using LSB to be able to send only 35bits. const uint8_t kTecoAuto = 0; // 0b000 const uint8_t kTecoCool = 1; // 0b001 @@ -35,6 +39,9 @@ const uint64_t kTecoTimerHalfH = 0b00000000000000000000001000000000000; const uint64_t kTecoTimerTenHr = 0b00000000000000000000110000000000000; const uint64_t kTecoTimerOn = 0b00000000000000000001000000000000000; const uint64_t kTecoTimerUniHr = 0b00000000000000011110000000000000000; +const uint64_t kTecoHumid = 0b00000000000000100000000000000000000; +const uint64_t kTecoLight = 0b00000000000001000000000000000000000; +const uint64_t kTecoSave = 0b00000000000100000000000000000000000; const uint64_t kTecoReset = 0b01001010000000000000010000000000000; /* (header mark and space) @@ -42,8 +49,12 @@ const uint64_t kTecoReset = 0b01001010000000000000010000000000000; byte 0 = Cst 0x02 byte 1 = Cst 0x50 + b6-7 = "AIR" 0, 1, 2 (Not Implemented) byte 2: - b0-3 = 0b0000 + b0 = Save + b1 = "Tree with bubbles" / Filter?? (Not Implemented) + b2 = Light/LED. + b3 = Humid b4-7 = Timer hours (unit, not thenth) hours: 0000 (0) = +0 hour @@ -110,12 +121,21 @@ class IRTecoAc { void setMode(const uint8_t mode); uint8_t getMode(void); - void setSwing(const bool state); + void setSwing(const bool on); bool getSwing(void); - void setSleep(const bool state); + void setSleep(const bool on); bool getSleep(void); + void setLight(const bool on); + bool getLight(void); + + void setHumid(const bool on); + bool getHumid(void); + + void setSave(const bool on); + bool getSave(void); + // void setTimer(uint8_t time); // To check unit // uint8_t getTimer(uint8_t); diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Toshiba.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Toshiba.cpp old mode 100644 new mode 100755 similarity index 99% rename from lib/IRremoteESP8266-2.6.4/src/ir_Toshiba.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Toshiba.cpp index 00a0f4d5c..4fa4c1075 --- a/lib/IRremoteESP8266-2.6.4/src/ir_Toshiba.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Toshiba.cpp @@ -362,7 +362,7 @@ bool IRrecv::decodeToshibaAC(decode_results* results, const uint16_t nbits, kToshibaAcBitMark, kToshibaAcOneSpace, kToshibaAcBitMark, kToshibaAcZeroSpace, kToshibaAcBitMark, kToshibaAcMinGap, true, - kTolerance, kMarkExcess)) return false; + _tolerance, kMarkExcess)) return false; // Compliance if (strict) { // Check that the checksum of the message is correct. diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Toshiba.h b/lib/IRremoteESP8266-2.6.5/src/ir_Toshiba.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Toshiba.h rename to lib/IRremoteESP8266-2.6.5/src/ir_Toshiba.h diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Trotec.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Trotec.cpp old mode 100644 new mode 100755 similarity index 99% rename from lib/IRremoteESP8266-2.6.4/src/ir_Trotec.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Trotec.cpp index b0ddda62d..281779f62 --- a/lib/IRremoteESP8266-2.6.4/src/ir_Trotec.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Trotec.cpp @@ -274,7 +274,7 @@ bool IRrecv::decodeTrotec(decode_results *results, const uint16_t nbits, kTrotecBitMark, kTrotecOneSpace, kTrotecBitMark, kTrotecZeroSpace, kTrotecBitMark, kTrotecGap, true, - kTolerance, 0, false); + _tolerance, 0, false); if (used == 0) return false; offset += used; diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Trotec.h b/lib/IRremoteESP8266-2.6.5/src/ir_Trotec.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Trotec.h rename to lib/IRremoteESP8266-2.6.5/src/ir_Trotec.h diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Vestel.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Vestel.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Vestel.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Vestel.cpp diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Vestel.h b/lib/IRremoteESP8266-2.6.5/src/ir_Vestel.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Vestel.h rename to lib/IRremoteESP8266-2.6.5/src/ir_Vestel.h diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Whirlpool.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Whirlpool.cpp old mode 100644 new mode 100755 similarity index 99% rename from lib/IRremoteESP8266-2.6.4/src/ir_Whirlpool.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Whirlpool.cpp index 91fb58f91..92a9b2bb3 --- a/lib/IRremoteESP8266-2.6.4/src/ir_Whirlpool.cpp +++ b/lib/IRremoteESP8266-2.6.5/src/ir_Whirlpool.cpp @@ -607,7 +607,7 @@ bool IRrecv::decodeWhirlpoolAC(decode_results *results, const uint16_t nbits, kWhirlpoolAcBitMark, kWhirlpoolAcZeroSpace, kWhirlpoolAcBitMark, kWhirlpoolAcGap, section >= kWhirlpoolAcSections - 1, - kTolerance, kMarkExcess, false); + _tolerance, kMarkExcess, false); if (used == 0) return false; offset += used; pos += sectionSize[section]; diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Whirlpool.h b/lib/IRremoteESP8266-2.6.5/src/ir_Whirlpool.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Whirlpool.h rename to lib/IRremoteESP8266-2.6.5/src/ir_Whirlpool.h diff --git a/lib/IRremoteESP8266-2.6.4/src/ir_Whynter.cpp b/lib/IRremoteESP8266-2.6.5/src/ir_Whynter.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/src/ir_Whynter.cpp rename to lib/IRremoteESP8266-2.6.5/src/ir_Whynter.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/IRac_test.cpp b/lib/IRremoteESP8266-2.6.5/test/IRac_test.cpp old mode 100644 new mode 100755 similarity index 98% rename from lib/IRremoteESP8266-2.6.4/test/IRac_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/IRac_test.cpp index 2b3129978..3afc89c6e --- a/lib/IRremoteESP8266-2.6.4/test/IRac_test.cpp +++ b/lib/IRremoteESP8266-2.6.5/test/IRac_test.cpp @@ -1,6 +1,7 @@ // Copyright 2019 David Conran #include +#include "ir_Amcor.h" #include "ir_Argo.h" #include "ir_Daikin.h" #include "ir_Electra.h" @@ -33,6 +34,27 @@ // Tests for IRac class. +TEST(TestIRac, Amcor) { + IRAmcorAc ac(0); + IRac irac(0); + IRrecv capture(0); + char expected[] = + "Power: On, Mode: 5 (AUTO), Fan: 3 (High), Temp: 19C, Max: Off"; + + ac.begin(); + irac.amcor(&ac, + true, // Power + stdAc::opmode_t::kAuto, // Mode + 19, // Celsius + stdAc::fanspeed_t::kHigh); // Fan speed + ASSERT_EQ(expected, ac.toString()); + ac._irsend.makeDecodeResult(); + EXPECT_TRUE(capture.decode(&ac._irsend.capture)); + ASSERT_EQ(AMCOR, ac._irsend.capture.decode_type); + ASSERT_EQ(kAmcorBits, ac._irsend.capture.bits); + ASSERT_EQ(expected, IRAcUtils::resultAcToString(&ac._irsend.capture)); +} + TEST(TestIRac, Argo) { IRArgoAC ac(0); IRac irac(0); @@ -390,7 +412,7 @@ TEST(TestIRac, Gree) { "Model: 1 (YAW1F), Power: On, Mode: 1 (COOL), Temp: 22C, " "Fan: 2 (Medium), Turbo: Off, IFeel: Off, WiFi: Off, XFan: On, " "Light: On, Sleep: On, Swing Vertical Mode: Manual, " - "Swing Vertical Pos: 3"; + "Swing Vertical Pos: 3, Timer: Off"; ac.begin(); irac.gree(&ac, @@ -822,7 +844,7 @@ TEST(TestIRac, Teco) { IRrecv capture(0); char expected[] = "Power: On, Mode: 0 (AUTO), Temp: 21C, Fan: 2 (Medium), Sleep: On, " - "Swing: On"; + "Swing: On, Light: On, Humid: Off, Save: Off"; ac.begin(); irac.teco(&ac, @@ -831,6 +853,7 @@ TEST(TestIRac, Teco) { 21, // Celsius stdAc::fanspeed_t::kMedium, // Fan speed stdAc::swingv_t::kAuto, // Veritcal swing + true, // Light 8 * 60 + 30); // Sleep ASSERT_EQ(expected, ac.toString()); ac._irsend.makeDecodeResult(); @@ -1220,6 +1243,7 @@ TEST(TestIRac, swinghToString) { EXPECT_EQ("off", IRac::swinghToString(stdAc::swingh_t::kOff)); EXPECT_EQ("left", IRac::swinghToString(stdAc::swingh_t::kLeft)); EXPECT_EQ("auto", IRac::swinghToString(stdAc::swingh_t::kAuto)); + EXPECT_EQ("wide", IRac::swinghToString(stdAc::swingh_t::kWide)); EXPECT_EQ("unknown", IRac::swinghToString((stdAc::swingh_t)500)); } diff --git a/lib/IRremoteESP8266-2.6.4/test/IRrecv_test.cpp b/lib/IRremoteESP8266-2.6.5/test/IRrecv_test.cpp old mode 100644 new mode 100755 similarity index 96% rename from lib/IRremoteESP8266-2.6.4/test/IRrecv_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/IRrecv_test.cpp index 899841de5..cda7b747f --- a/lib/IRremoteESP8266-2.6.4/test/IRrecv_test.cpp +++ b/lib/IRremoteESP8266-2.6.5/test/IRrecv_test.cpp @@ -1207,3 +1207,40 @@ TEST(TestMatchGeneric, UsingBytes) { true); // MSB first. ASSERT_EQ(0, entries_used); } + +TEST(TestIRrecv, Tolerance) { + IRsendTest irsend(0); + IRrecv irrecv(1); + irsend.begin(); + + uint16_t equal_encoded_raw[11] = {500, 1500, 1500, 500, 499, 1499, + 1501, 501, 1499, 490, 500}; + match_result_t result; + + ASSERT_EQ(kTolerance, irrecv.getTolerance()); + irrecv.setTolerance(); + ASSERT_EQ(kTolerance, irrecv.getTolerance()); + irrecv.setTolerance(kTolerance + 1); + ASSERT_EQ(kTolerance + 1, irrecv.getTolerance()); + irrecv.setTolerance(kTolerance - 1); + ASSERT_EQ(kTolerance - 1, irrecv.getTolerance()); + + irrecv.setTolerance(); + ASSERT_EQ(kTolerance, irrecv.getTolerance()); + + irsend.reset(); + irsend.sendRaw(equal_encoded_raw, 11, 38000); + irsend.makeDecodeResult(); + result = irrecv.matchData(irsend.capture.rawbuf + 1, 5, 1500, 500, 500, 1500); + ASSERT_TRUE(result.success); + EXPECT_EQ(0b01011, result.data); + EXPECT_EQ(10, result.used); + + irrecv.setTolerance(0); + ASSERT_EQ(0, irrecv.getTolerance()); + irsend.reset(); + irsend.sendRaw(equal_encoded_raw, 11, 38000); + irsend.makeDecodeResult(); + result = irrecv.matchData(irsend.capture.rawbuf + 1, 5, 1500, 500, 500, 1500); + ASSERT_FALSE(result.success); +} diff --git a/lib/IRremoteESP8266-2.6.4/test/IRrecv_test.h b/lib/IRremoteESP8266-2.6.5/test/IRrecv_test.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/IRrecv_test.h rename to lib/IRremoteESP8266-2.6.5/test/IRrecv_test.h diff --git a/lib/IRremoteESP8266-2.6.4/test/IRsend_test.cpp b/lib/IRremoteESP8266-2.6.5/test/IRsend_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/IRsend_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/IRsend_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/IRsend_test.h b/lib/IRremoteESP8266-2.6.5/test/IRsend_test.h old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/IRsend_test.h rename to lib/IRremoteESP8266-2.6.5/test/IRsend_test.h diff --git a/lib/IRremoteESP8266-2.6.4/test/IRutils_test.cpp b/lib/IRremoteESP8266-2.6.5/test/IRutils_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/IRutils_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/IRutils_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/Makefile b/lib/IRremoteESP8266-2.6.5/test/Makefile old mode 100644 new mode 100755 similarity index 97% rename from lib/IRremoteESP8266-2.6.4/test/Makefile rename to lib/IRremoteESP8266-2.6.5/test/Makefile index 1de3aa220..0e721d58c --- a/lib/IRremoteESP8266-2.6.4/test/Makefile +++ b/lib/IRremoteESP8266-2.6.5/test/Makefile @@ -39,7 +39,7 @@ TESTS = IRutils_test IRsend_test ir_NEC_test ir_GlobalCache_test \ ir_Whirlpool_test ir_Lutron_test ir_Electra_test ir_Pioneer_test \ ir_MWM_test ir_Vestel_test ir_Teco_test ir_Tcl_test ir_Lego_test IRac_test \ ir_MitsubishiHeavy_test ir_Trotec_test ir_Argo_test ir_Goodweather_test \ - ir_Inax_test ir_Neoclima_test + ir_Inax_test ir_Neoclima_test ir_Amcor_test # All Google Test headers. Usually you shouldn't change this # definition. @@ -84,10 +84,12 @@ PROTOCOLS = ir_NEC.o ir_Sony.o ir_Samsung.o ir_JVC.o ir_RCMM.o ir_RC5_RC6.o \ ir_Midea.o ir_Magiquest.o ir_Lasertag.o ir_Carrier.o ir_Haier.o \ ir_Hitachi.o ir_GICable.o ir_Whirlpool.o ir_Lutron.o ir_Electra.o \ ir_Pioneer.o ir_MWM.o ir_Vestel.o ir_Teco.o ir_Tcl.o ir_Lego.o ir_Argo.o \ - ir_Trotec.o ir_MitsubishiHeavy.o ir_Goodweather.o ir_Inax.o ir_Neoclima.o + ir_Trotec.o ir_MitsubishiHeavy.o ir_Goodweather.o ir_Inax.o ir_Neoclima.o \ + ir_Amcor.o # All the IR Protocol header files. -PROTOCOLS_H = $(USER_DIR)/ir_Argo.h \ +PROTOCOLS_H = $(USER_DIR)/ir_Amcor.h \ + $(USER_DIR)/ir_Argo.h \ $(USER_DIR)/ir_Gree.h \ $(USER_DIR)/ir_Magiquest.h \ $(USER_DIR)/ir_Coolix.h \ @@ -607,3 +609,12 @@ ir_Neoclima_test.o : ir_Neoclima_test.cpp $(COMMON_TEST_DEPS) $(GTEST_HEADERS) ir_Neoclima_test : $(COMMON_OBJ) ir_Neoclima_test.o $(CXX) $(CPPFLAGS) $(CXXFLAGS) -lpthread $^ -o $@ + +ir_Amcor.o : $(USER_DIR)/ir_Amcor.h $(USER_DIR)/ir_Amcor.cpp $(COMMON_DEPS) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) -c $(USER_DIR)/ir_Amcor.cpp + +ir_Amcor_test.o : ir_Amcor_test.cpp $(COMMON_TEST_DEPS) $(GTEST_HEADERS) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) -c ir_Amcor_test.cpp + +ir_Amcor_test : $(COMMON_OBJ) ir_Amcor_test.o + $(CXX) $(CPPFLAGS) $(CXXFLAGS) -lpthread $^ -o $@ diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Aiwa_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Aiwa_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Aiwa_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Aiwa_test.cpp diff --git a/lib/IRremoteESP8266-2.6.5/test/ir_Amcor_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Amcor_test.cpp new file mode 100755 index 000000000..265c61500 --- /dev/null +++ b/lib/IRremoteESP8266-2.6.5/test/ir_Amcor_test.cpp @@ -0,0 +1,351 @@ +// Copyright 2019 David Conran + +#include "IRac.h" +#include "ir_Amcor.h" +#include "IRrecv.h" +#include "IRrecv_test.h" +#include "IRsend.h" +#include "IRsend_test.h" +#include "IRutils.h" +#include "gtest/gtest.h" + +TEST(TestUtils, Housekeeping) { + ASSERT_EQ("AMCOR", typeToString(decode_type_t::AMCOR)); + ASSERT_EQ(decode_type_t::AMCOR, strToDecodeType("AMCOR")); + ASSERT_TRUE(hasACState(decode_type_t::AMCOR)); + ASSERT_TRUE(IRac::isProtocolSupported(decode_type_t::AMCOR)); +} + +// Test sending typical data only. +TEST(TestSendAmcor, SendDataOnly) { + IRsendTest irsend(0); + irsend.begin(); + + uint8_t expectedState[kAmcorStateLength] = { + 0x01, 0x41, 0x36, 0x00, 0x00, 0x30, 0x00, 0x12}; + + irsend.reset(); + irsend.sendAmcor(expectedState); + EXPECT_EQ( + "f38000d50" + "m8200s4200" + "m1500s600m600s1500m600s1500m600s1500m600s1500m600s1500m600s1500m600s1500" + "m1500s600m600s1500m600s1500m600s1500m600s1500m600s1500m1500s600m600s1500" + "m600s1500m1500s600m1500s600m600s1500m1500s600m1500s600m600s1500m600s1500" + "m600s1500m600s1500m600s1500m600s1500m600s1500m600s1500m600s1500m600s1500" + "m600s1500m600s1500m600s1500m600s1500m600s1500m600s1500m600s1500m600s1500" + "m600s1500m600s1500m600s1500m600s1500m1500s600m1500s600m600s1500m600s1500" + "m600s1500m600s1500m600s1500m600s1500m600s1500m600s1500m600s1500m600s1500" + "m600s1500m1500s600m600s1500m600s1500m1500s600m600s1500m600s1500m600s1500" + "m1900s34300" + "m8200s4200" + "m1500s600m600s1500m600s1500m600s1500m600s1500m600s1500m600s1500m600s1500" + "m1500s600m600s1500m600s1500m600s1500m600s1500m600s1500m1500s600m600s1500" + "m600s1500m1500s600m1500s600m600s1500m1500s600m1500s600m600s1500m600s1500" + "m600s1500m600s1500m600s1500m600s1500m600s1500m600s1500m600s1500m600s1500" + "m600s1500m600s1500m600s1500m600s1500m600s1500m600s1500m600s1500m600s1500" + "m600s1500m600s1500m600s1500m600s1500m1500s600m1500s600m600s1500m600s1500" + "m600s1500m600s1500m600s1500m600s1500m600s1500m600s1500m600s1500m600s1500" + "m600s1500m1500s600m600s1500m600s1500m1500s600m600s1500m600s1500m600s1500" + "m1900s34300", + irsend.outputStr()); +} + +TEST(TestDecodeAmcor, SyntheticSelfDecode) { + IRsendTest irsend(0); + IRrecv irrecv(0); + IRAmcorAc ac(0); + + uint8_t expectedState[kAmcorStateLength] = { + 0x01, 0x41, 0x30, 0x00, 0x00, 0x30, 0x00, 0x0C}; + + irsend.begin(); + irsend.reset(); + irsend.sendAmcor(expectedState); + irsend.makeDecodeResult(); + ASSERT_TRUE(irrecv.decode(&irsend.capture)); + EXPECT_EQ(AMCOR, irsend.capture.decode_type); + EXPECT_EQ(kAmcorBits, irsend.capture.bits); + EXPECT_STATE_EQ(expectedState, irsend.capture.state, irsend.capture.bits); + ac.setRaw(irsend.capture.state); + EXPECT_EQ( + "Power: On, Mode: 1 (COOL), Fan: 4 (Auto), Temp: 24C, Max: Off", + ac.toString()); +} + +TEST(TestDecodeAmcor, RealExample) { + IRsendTest irsend(0); + IRrecv irrecv(0); + irsend.begin(); + + // Data from Issue #834 captured by ldellus + // Turn on, cooling, 27 deg C. + uint16_t rawData[263] = { + 8210, 4276, 1544, 480, 596, 1510, 596, 1510, 596, 1692, 388, 1534, 596, + 1510, 596, 1510, 596, 1684, 1450, 480, 596, 1510, 570, 1534, 570, 1718, 386, + 1536, 594, 1500, 1632, 482, 596, 1694, 362, 1550, 1632, 472, 1658, 456, 596, + 1684, 1474, 446, 1634, 480, 572, 1534, 572, 1718, 362, 1558, 572, 1534, 570, + 1534, 570, 1720, 360, 1558, 572, 1534, 570, 1534, 570, 1718, 360, 1560, 572, + 1534, 570, 1534, 570, 1718, 362, 1560, 572, 1532, 572, 1534, 570, 1718, 362, + 1558, 572, 1532, 572, 1534, 570, 1710, 1448, 472, 1634, 480, 572, 1534, 570, + 1718, 362, 1558, 572, 1534, 570, 1534, 572, 1716, 362, 1560, 572, 1534, 572, + 1534, 570, 1718, 362, 1550, 1634, 480, 570, 1536, 570, 1710, 1448, 482, 570, + 1534, 570, 1536, 570, 1508, 1856, 34298, + // rawData[132] is here. (8218) + 8218, 4314, 1502, 522, 530, 1576, 504, 1602, 504, 1786, 392, 1528, 504, + 1600, 504, 1600, 504, 1770, 1414, 522, 528, 1578, 502, 1602, 504, 1784, 394, + 1528, 504, 1584, 1574, 548, 528, 1762, 392, 1512, 1572, 530, 1600, 524, 528, + 1744, 1390, 530, 1574, 546, 506, 1600, 504, 1784, 394, 1528, 504, 1600, 578, + 1528, 504, 1784, 394, 1526, 504, 1600, 504, 1600, 506, 1784, 394, 1528, 504, + 1602, 504, 1602, 504, 1784, 394, 1526, 506, 1600, 504, 1600, 506, 1784, 392, + 1526, 506, 1600, 504, 1602, 502, 1768, 1390, 530, 1574, 548, 504, 1600, 504, + 1786, 392, 1530, 504, 1600, 504, 1600, 504, 1786, 392, 1528, 504, 1600, 504, + 1600, 506, 1784, 394, 1512, 1574, 548, 504, 1602, 504, 1768, 1388, 548, 504, + 1602, 504, 1602, 502, 1574, 1792}; // UNKNOWN D510A6EF + + uint8_t expectedState[kAmcorStateLength] = { + 0x01, 0x41, 0x36, 0x00, 0x00, 0x30, 0x00, 0x12}; + + irsend.reset(); + irsend.sendRaw(rawData, 263, 38000); + irsend.makeDecodeResult(); + ASSERT_TRUE(irrecv.decode(&irsend.capture)); + EXPECT_EQ(AMCOR, irsend.capture.decode_type); + EXPECT_EQ(kAmcorBits, irsend.capture.bits); + EXPECT_STATE_EQ(expectedState, irsend.capture.state, irsend.capture.bits); + + // Verify the repeat is the same decode. + irsend.reset(); + irsend.sendRaw(rawData + 132, 131, 38000); + irsend.makeDecodeResult(); + ASSERT_TRUE(irrecv.decode(&irsend.capture)); + EXPECT_EQ(AMCOR, irsend.capture.decode_type); + EXPECT_EQ(kAmcorBits, irsend.capture.bits); + EXPECT_STATE_EQ(expectedState, irsend.capture.state, irsend.capture.bits); + + // https://github.com/crankyoldgit/IRremoteESP8266/issues/834#issuecomment-515700254 + uint16_t rawData2[263] = {8252, 4294, 1518, 508, 544, 1560, 546, 1560, 570, + 1718, 416, 1504, 546, 1560, 570, 1532, 572, 1718, 1414, 506, 544, 1560, 570, + 1534, 570, 1718, 416, 1506, 544, 1558, 1598, 508, 544, 1746, 416, 1504, 546, + 1560, 570, 1534, 1598, 690, 1414, 508, 544, 1560, 546, 1560, 544, 1746, 416, + 1504, 546, 1560, 546, 1560, 570, 1718, 416, 1504, 544, 1560, 570, 1536, 544, + 1744, 416, 1506, 570, 1534, 546, 1558, 546, 1744, 418, 1502, 572, 1534, 544, + 1560, 570, 1720, 416, 1506, 544, 1560, 546, 1560, 544, 1744, 1414, 506, + 1572, 534, 544, 1560, 570, 1720, 416, 1504, 570, 1536, 544, 1560, 572, 1718, + 416, 1504, 570, 1542, 592, 1504, 570, 1720, 416, 1502, 1572, 534, 544, 1560, + 572, 1718, 1414, 508, 544, 1560, 570, 1534, 570, 1508, 1840, 34174, 8230, + 4292, 1546, 480, 546, 1560, 572, 1534, 570, 1718, 416, 1502, 572, 1532, 572, + 1532, 572, 1718, 1440, 480, 570, 1534, 572, 1534, 572, 1716, 418, 1504, 572, + 1532, 1626, 480, 572, 1718, 418, 1502, 574, 1534, 572, 1530, 1626, 662, + 1442, 480, 572, 1534, 572, 1534, 572, 1716, 418, 1502, 574, 1542, 592, 1504, + 598, 1692, 418, 1504, 572, 1532, 574, 1530, 574, 1716, 418, 1502, 598, 1508, + 572, 1532, 598, 1692, 418, 1502, 598, 1508, 572, 1532, 574, 1716, 418, 1504, + 598, 1508, 572, 1532, 574, 1716, 1442, 478, 1626, 480, 572, 1534, 572, 1718, + 392, 1526, 574, 1532, 572, 1532, 572, 1716, 418, 1502, 598, 1508, 574, 1532, + 598, 1700, 408, 1504, 1624, 480, 572, 1532, 574, 1716, 1440, 480, 572, 1532, + 572, 1532, 572, 1506, 1814}; // UNKNOWN ADA838FB + + uint8_t expectedState2[kAmcorStateLength] = { + 0x01, 0x41, 0x18, 0x00, 0x00, 0x30, 0x00, 0x12}; + + irsend.reset(); + irsend.sendRaw(rawData2, 263, 38000); + irsend.makeDecodeResult(); + ASSERT_TRUE(irrecv.decode(&irsend.capture)); + EXPECT_EQ(AMCOR, irsend.capture.decode_type); + EXPECT_EQ(kAmcorBits, irsend.capture.bits); + EXPECT_STATE_EQ(expectedState2, irsend.capture.state, irsend.capture.bits); +} + +// Tests for IRAmcorAc class. + +TEST(TestAmcorAcClass, Power) { + IRAmcorAc ac(0); + ac.begin(); + + ac.on(); + EXPECT_TRUE(ac.getPower()); + + ac.off(); + EXPECT_FALSE(ac.getPower()); + + ac.setPower(true); + EXPECT_TRUE(ac.getPower()); + + ac.setPower(false); + EXPECT_FALSE(ac.getPower()); +} + +TEST(TestAmcorAcClass, Temperature) { + IRAmcorAc ac(0); + ac.begin(); + + ac.setTemp(0); + EXPECT_EQ(kAmcorMinTemp, ac.getTemp()); + + ac.setTemp(255); + EXPECT_EQ(kAmcorMaxTemp, ac.getTemp()); + + ac.setTemp(kAmcorMinTemp); + EXPECT_EQ(kAmcorMinTemp, ac.getTemp()); + + ac.setTemp(kAmcorMaxTemp); + EXPECT_EQ(kAmcorMaxTemp, ac.getTemp()); + + ac.setTemp(kAmcorMinTemp - 1); + EXPECT_EQ(kAmcorMinTemp, ac.getTemp()); + + ac.setTemp(kAmcorMaxTemp + 1); + EXPECT_EQ(kAmcorMaxTemp, ac.getTemp()); + + ac.setTemp(17); + EXPECT_EQ(17, ac.getTemp()); + + ac.setTemp(21); + EXPECT_EQ(21, ac.getTemp()); + + ac.setTemp(25); + EXPECT_EQ(25, ac.getTemp()); + + ac.setTemp(29); + EXPECT_EQ(29, ac.getTemp()); +} + +TEST(TestAmcorAcClass, OperatingMode) { + IRAmcorAc ac(0); + ac.begin(); + + ac.setMode(kAmcorAuto); + EXPECT_EQ(kAmcorAuto, ac.getMode()); + + ac.setMode(kAmcorCool); + EXPECT_EQ(kAmcorCool, ac.getMode()); + + ac.setMode(kAmcorHeat); + EXPECT_EQ(kAmcorHeat, ac.getMode()); + + ac.setMode(kAmcorDry); + EXPECT_EQ(kAmcorDry, ac.getMode()); + + ac.setMode(kAmcorFan); + EXPECT_EQ(kAmcorFan, ac.getMode()); + + ac.setMode(kAmcorAuto + 1); + EXPECT_EQ(kAmcorAuto, ac.getMode()); + + ac.setMode(255); + EXPECT_EQ(kAmcorAuto, ac.getMode()); +} + +TEST(TestAmcorAcClass, FanSpeed) { + IRAmcorAc ac(0); + ac.begin(); + + ac.setFan(0); + EXPECT_EQ(kAmcorFanAuto, ac.getFan()); + + ac.setFan(255); + EXPECT_EQ(kAmcorFanAuto, ac.getFan()); + + ac.setFan(kAmcorFanMax); + EXPECT_EQ(kAmcorFanMax, ac.getFan()); + + ac.setFan(kAmcorFanMax + 1); + EXPECT_EQ(kAmcorFanAuto, ac.getFan()); + + ac.setFan(kAmcorFanMax - 1); + EXPECT_EQ(kAmcorFanMax - 1, ac.getFan()); + + ac.setFan(1); + EXPECT_EQ(1, ac.getFan()); + + ac.setFan(1); + EXPECT_EQ(1, ac.getFan()); + + ac.setFan(3); + EXPECT_EQ(3, ac.getFan()); +} + +TEST(TestAmcorAcClass, Checksums) { + uint8_t state[kAmcorStateLength] = { + 0x01, 0x41, 0x30, 0x00, 0x00, 0x30, 0x00, 0x0C}; + + ASSERT_EQ(0x0C, IRAmcorAc::calcChecksum(state)); + EXPECT_TRUE(IRAmcorAc::validChecksum(state)); + // Change the array so the checksum is invalid. + state[0] ^= 0xFF; + EXPECT_FALSE(IRAmcorAc::validChecksum(state)); + // Restore the previous change, and change another byte. + state[0] ^= 0xFF; + state[4] ^= 0xFF; + EXPECT_FALSE(IRAmcorAc::validChecksum(state)); + state[4] ^= 0xFF; + EXPECT_TRUE(IRAmcorAc::validChecksum(state)); + + // Additional known good states. + uint8_t knownGood1[kAmcorStateLength] = { + 0x01, 0x11, 0x3E, 0x00, 0x00, 0x30, 0x00, 0x17}; + EXPECT_TRUE(IRAmcorAc::validChecksum(knownGood1)); + ASSERT_EQ(0x17, IRAmcorAc::calcChecksum(knownGood1)); + uint8_t knownGood2[kAmcorStateLength] = { + 0x01, 0x22, 0x26, 0x00, 0x00, 0x30, 0x00, 0x10}; + EXPECT_TRUE(IRAmcorAc::validChecksum(knownGood2)); + ASSERT_EQ(0x10, IRAmcorAc::calcChecksum(knownGood2)); + uint8_t knownGood3[kAmcorStateLength] = { + 0x01, 0x41, 0x24, 0x00, 0x00, 0xC0, 0x00, 0x18}; + EXPECT_TRUE(IRAmcorAc::validChecksum(knownGood3)); + ASSERT_EQ(0x18, IRAmcorAc::calcChecksum(knownGood3)); + + // For a recalculation. + uint8_t knownBad[kAmcorStateLength] = { + // Same as knownGood3 except for the checksum. + 0x01, 0x41, 0x24, 0x00, 0x00, 0xC0, 0x00, 0x00}; + EXPECT_FALSE(IRAmcorAc::validChecksum(knownBad)); + IRAmcorAc ac(0); + ac.setRaw(knownBad); + EXPECT_STATE_EQ(knownGood3, ac.getRaw(), kAmcorBits); +} + +TEST(TestAmcorAcClass, Max) { + IRAmcorAc ac(0); + ac.begin(); + + ac.setMode(kAmcorCool); + ac.setMax(true); + EXPECT_EQ(kAmcorCool, ac.getMode()); + EXPECT_EQ(kAmcorMinTemp, ac.getTemp()); + EXPECT_TRUE(ac.getMax()); + ac.setMax(false); + EXPECT_EQ(kAmcorCool, ac.getMode()); + EXPECT_EQ(kAmcorMinTemp, ac.getTemp()); + EXPECT_FALSE(ac.getMax()); + + ac.setMode(kAmcorHeat); + ac.setMax(true); + EXPECT_EQ(kAmcorHeat, ac.getMode()); + EXPECT_EQ(kAmcorMaxTemp, ac.getTemp()); + EXPECT_TRUE(ac.getMax()); + ac.setMax(false); + EXPECT_EQ(kAmcorHeat, ac.getMode()); + EXPECT_EQ(kAmcorMaxTemp, ac.getTemp()); + EXPECT_FALSE(ac.getMax()); + + ac.setMode(kAmcorAuto); + ac.setTemp(25); + ac.setMax(true); + EXPECT_EQ(kAmcorAuto, ac.getMode()); + EXPECT_EQ(25, ac.getTemp()); + EXPECT_FALSE(ac.getMax()); + + // Test known real data. + uint8_t lo[kAmcorStateLength] = { + 0x01, 0x41, 0x18, 0x00, 0x00, 0x30, 0x03, 0x15}; + uint8_t hi[kAmcorStateLength] = { + 0x01, 0x12, 0x40, 0x00, 0x00, 0x30, 0x03, 0x0E}; + ac.setRaw(lo); + EXPECT_EQ("Power: On, Mode: 1 (COOL), Fan: 4 (Auto), Temp: 12C, Max: On", + ac.toString()); + ac.setRaw(hi); + EXPECT_EQ("Power: On, Mode: 2 (HEAT), Fan: 1 (Low), Temp: 32C, Max: On", + ac.toString()); +} diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Argo_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Argo_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Argo_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Argo_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Carrier_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Carrier_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Carrier_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Carrier_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Coolix_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Coolix_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Coolix_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Coolix_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Daikin_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Daikin_test.cpp old mode 100644 new mode 100755 similarity index 96% rename from lib/IRremoteESP8266-2.6.4/test/ir_Daikin_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Daikin_test.cpp index d762656e3..774109c3a --- a/lib/IRremoteESP8266-2.6.4/test/ir_Daikin_test.cpp +++ b/lib/IRremoteESP8266-2.6.5/test/ir_Daikin_test.cpp @@ -1519,6 +1519,11 @@ TEST(TestUtils, Housekeeping) { ASSERT_TRUE(hasACState(decode_type_t::DAIKIN128)); ASSERT_TRUE(IRac::isProtocolSupported(decode_type_t::DAIKIN128)); + ASSERT_EQ("DAIKIN152", typeToString(decode_type_t::DAIKIN152)); + ASSERT_EQ(decode_type_t::DAIKIN152, strToDecodeType("DAIKIN152")); + ASSERT_TRUE(hasACState(decode_type_t::DAIKIN152)); + ASSERT_FALSE(IRac::isProtocolSupported(decode_type_t::DAIKIN152)); + ASSERT_EQ("DAIKIN160", typeToString(decode_type_t::DAIKIN160)); ASSERT_EQ(decode_type_t::DAIKIN160, strToDecodeType("DAIKIN160")); ASSERT_TRUE(hasACState(decode_type_t::DAIKIN160)); @@ -2917,3 +2922,65 @@ TEST(TestDaikin128Class, ReconstructKnownState) { EXPECT_STATE_EQ(expectedState, ac.getRaw(), kDaikin128Bits); } + +// Ref: https://github.com/crankyoldgit/IRremoteESP8266/issues/873 +// Data from: +// https://github.com/crankyoldgit/IRremoteESP8266/issues/873#issue-485088080 +TEST(TestDecodeDaikin152, RealExample) { + IRsendTest irsend(0); + IRrecv irrecv(0); + uint16_t rawData[319] = { + 450, 420, 448, 446, 422, 444, 422, 446, 422, 446, 422, 25182, 3492, 1718, + 450, 1288, 448, 422, 446, 448, 420, 446, 422, 1290, 448, 422, 446, 446, + 422, 446, 424, 420, 448, 1290, 448, 446, 422, 1288, 448, 1288, 450, 420, + 448, 1288, 448, 1288, 450, 1288, 448, 1288, 448, 1290, 448, 446, 422, 446, + 422, 1288, 450, 446, 422, 420, 446, 446, 422, 422, 446, 446, 422, 420, + 448, 422, 446, 446, 422, 446, 422, 446, 422, 420, 446, 446, 422, 446, 422, + 422, 446, 446, 422, 422, 446, 446, 422, 446, 422, 446, 422, 446, 422, 446, + 424, 444, 424, 446, 420, 446, 422, 446, 422, 424, 444, 444, 422, 424, 444, + 1288, 450, 444, 422, 1288, 450, 1288, 450, 444, 422, 422, 446, 446, 422, + 446, 422, 446, 422, 446, 422, 422, 446, 420, 448, 444, 422, 446, 422, 446, + 422, 420, 448, 446, 422, 446, 422, 446, 422, 422, 446, 1286, 450, 422, + 448, 446, 422, 446, 422, 422, 446, 420, 446, 422, 446, 446, 422, 422, 446, + 446, 422, 422, 446, 446, 424, 444, 422, 420, 448, 446, 422, 420, 446, 446, + 422, 446, 422, 420, 448, 444, 422, 422, 448, 444, 424, 420, 446, 446, 422, + 446, 422, 422, 446, 444, 422, 446, 422, 444, 422, 446, 422, 420, 448, 446, + 422, 420, 448, 446, 422, 446, 422, 446, 422, 446, 422, 446, 422, 444, 422, + 1288, 450, 420, 448, 446, 420, 446, 422, 446, 422, 446, 424, 420, 448, + 444, 422, 422, 446, 446, 424, 420, 448, 1312, 424, 420, 448, 1288, 448, + 446, 422, 446, 424, 420, 446, 1288, 450, 1288, 450, 444, 422, 446, 422, + 422, 448, 444, 422, 420, 448, 446, 422, 1288, 448, 446, 422, 446, 422, + 444, 424, 444, 422, 446, 422, 446, 422, 420, 448, 446, 422, 420, 446, + 1290, 448, 1288, 448, 420, 446, 1288, 448, 420, 446, 1288, 450, 444, 424, + 1286, 450}; // UNKNOWN 2B9504D3 + uint8_t expectedState[kDaikin152StateLength] = { + 0x11, 0xDA, 0x27, 0x00, 0x00, 0x00, 0x34, 0x00, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x20, 0x00, 0xC5, 0x40, 0x00, 0xAB}; + + irsend.begin(); + irsend.reset(); + irsend.sendRaw(rawData, 319, 38000); + irsend.makeDecodeResult(); + ASSERT_TRUE(irrecv.decode(&irsend.capture)); + ASSERT_EQ(DAIKIN152, irsend.capture.decode_type); + ASSERT_EQ(kDaikin152Bits, irsend.capture.bits); + EXPECT_STATE_EQ(expectedState, irsend.capture.state, irsend.capture.bits); +} + +// https://github.com/crankyoldgit/IRremoteESP8266/issues/873 +TEST(TestDecodeDaikin152, SyntheticExample) { + IRsendTest irsend(0); + IRrecv irrecv(0); + uint8_t expectedState[kDaikin152StateLength] = { + 0x11, 0xDA, 0x27, 0x00, 0x00, 0x00, 0x34, 0x00, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x20, 0x00, 0xC5, 0x40, 0x00, 0xAB}; + + irsend.begin(); + irsend.reset(); + irsend.sendDaikin152(expectedState); + irsend.makeDecodeResult(); + ASSERT_TRUE(irrecv.decode(&irsend.capture)); + ASSERT_EQ(DAIKIN152, irsend.capture.decode_type); + ASSERT_EQ(kDaikin152Bits, irsend.capture.bits); + EXPECT_STATE_EQ(expectedState, irsend.capture.state, irsend.capture.bits); +} diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Denon_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Denon_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Denon_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Denon_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Dish_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Dish_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Dish_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Dish_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Electra_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Electra_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Electra_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Electra_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Fujitsu_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Fujitsu_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Fujitsu_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Fujitsu_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_GICable_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_GICable_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_GICable_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_GICable_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_GlobalCache_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_GlobalCache_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_GlobalCache_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_GlobalCache_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Goodweather_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Goodweather_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Goodweather_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Goodweather_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Gree_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Gree_test.cpp old mode 100644 new mode 100755 similarity index 94% rename from lib/IRremoteESP8266-2.6.4/test/ir_Gree_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Gree_test.cpp index 8d6fa5141..d85df72b8 --- a/lib/IRremoteESP8266-2.6.4/test/ir_Gree_test.cpp +++ b/lib/IRremoteESP8266-2.6.5/test/ir_Gree_test.cpp @@ -497,7 +497,8 @@ TEST(TestGreeClass, HumanReadable) { EXPECT_EQ( "Model: 1 (YAW1F), Power: Off, Mode: 0 (AUTO), Temp: 25C, Fan: 0 (Auto), " "Turbo: Off, IFeel: Off, WiFi: Off, XFan: Off, Light: On, Sleep: Off, " - "Swing Vertical Mode: Manual, Swing Vertical Pos: 0 (Last Pos)", + "Swing Vertical Mode: Manual, Swing Vertical Pos: 0 (Last Pos), " + "Timer: Off", irgree.toString()); irgree.on(); irgree.setMode(kGreeCool); @@ -510,10 +511,11 @@ TEST(TestGreeClass, HumanReadable) { irgree.setIFeel(true); irgree.setWiFi(true); irgree.setSwingVertical(true, kGreeSwingAuto); + irgree.setTimer(12 * 60 + 30); EXPECT_EQ( "Model: 1 (YAW1F), Power: On, Mode: 1 (COOL), Temp: 16C, Fan: 3 (High), " "Turbo: On, IFeel: On, WiFi: On, XFan: On, Light: Off, Sleep: On, " - "Swing Vertical Mode: Auto, Swing Vertical Pos: 1 (Auto)", + "Swing Vertical Mode: Auto, Swing Vertical Pos: 1 (Auto), Timer: 12:30", irgree.toString()); } @@ -573,7 +575,7 @@ TEST(TestDecodeGree, NormalRealExample) { EXPECT_EQ( "Model: 1 (YAW1F), Power: On, Mode: 1 (COOL), Temp: 26C, Fan: 1 (Low), " "Turbo: Off, IFeel: Off, WiFi: Off, XFan: Off, Light: On, Sleep: Off, " - "Swing Vertical Mode: Manual, Swing Vertical Pos: 2", + "Swing Vertical Mode: Manual, Swing Vertical Pos: 2, Timer: Off", irgree.toString()); } @@ -628,7 +630,7 @@ TEST(TestGreeClass, Issue814Power) { EXPECT_EQ( "Model: 2 (YBOFB), Power: On, Mode: 1 (COOL), Temp: 23C, Fan: 1 (Low), " "Turbo: Off, IFeel: Off, WiFi: Off, XFan: Off, Light: On, Sleep: Off, " - "Swing Vertical Mode: Auto, Swing Vertical Pos: 1 (Auto)", + "Swing Vertical Mode: Auto, Swing Vertical Pos: 1 (Auto), Timer: Off", ac.toString()); ac.off(); EXPECT_STATE_EQ(off, ac.getRaw(), kGreeBits); @@ -643,3 +645,44 @@ TEST(TestGreeClass, Issue814Power) { ac.on(); EXPECT_STATE_EQ(YBOFB_on, ac.getRaw(), kGreeBits); } + +TEST(TestGreeClass, Timer) { + IRGreeAC ac(0); + ac.begin(); + + ac.setTimer(0); + EXPECT_FALSE(ac.getTimerEnabled()); + EXPECT_EQ(0, ac.getTimer()); + + ac.setTimer(29); + EXPECT_FALSE(ac.getTimerEnabled()); + EXPECT_EQ(0, ac.getTimer()); + + ac.setTimer(30); + EXPECT_TRUE(ac.getTimerEnabled()); + EXPECT_EQ(30, ac.getTimer()); + + ac.setTimer(60); + EXPECT_TRUE(ac.getTimerEnabled()); + EXPECT_EQ(60, ac.getTimer()); + + ac.setTimer(90); + EXPECT_TRUE(ac.getTimerEnabled()); + EXPECT_EQ(90, ac.getTimer()); + + ac.setTimer(10 * 60); + EXPECT_TRUE(ac.getTimerEnabled()); + EXPECT_EQ(10 * 60, ac.getTimer()); + + ac.setTimer(23 * 60 + 59); + EXPECT_TRUE(ac.getTimerEnabled()); + EXPECT_EQ(23 * 60 + 30, ac.getTimer()); + + ac.setTimer(24 * 60 + 1); + EXPECT_TRUE(ac.getTimerEnabled()); + EXPECT_EQ(24 * 60, ac.getTimer()); + + ac.setTimer(24 * 60 + 30); + EXPECT_TRUE(ac.getTimerEnabled()); + EXPECT_EQ(24 * 60, ac.getTimer()); +} diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Haier_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Haier_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Haier_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Haier_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Hitachi_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Hitachi_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Hitachi_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Hitachi_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Inax_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Inax_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Inax_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Inax_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_JVC_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_JVC_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_JVC_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_JVC_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Kelvinator_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Kelvinator_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Kelvinator_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Kelvinator_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_LG_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_LG_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_LG_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_LG_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Lasertag_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Lasertag_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Lasertag_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Lasertag_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Lego_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Lego_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Lego_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Lego_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Lutron_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Lutron_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Lutron_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Lutron_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_MWM_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_MWM_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_MWM_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_MWM_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Magiquest_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Magiquest_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Magiquest_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Magiquest_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Midea_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Midea_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Midea_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Midea_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_MitsubishiHeavy_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_MitsubishiHeavy_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_MitsubishiHeavy_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_MitsubishiHeavy_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Mitsubishi_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Mitsubishi_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Mitsubishi_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Mitsubishi_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_NEC_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_NEC_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_NEC_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_NEC_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Neoclima_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Neoclima_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Neoclima_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Neoclima_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Nikai_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Nikai_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Nikai_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Nikai_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Panasonic_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Panasonic_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Panasonic_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Panasonic_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Pioneer_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Pioneer_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Pioneer_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Pioneer_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Pronto_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Pronto_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Pronto_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Pronto_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_RC5_RC6_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_RC5_RC6_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_RC5_RC6_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_RC5_RC6_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_RCMM_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_RCMM_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_RCMM_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_RCMM_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Samsung_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Samsung_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Samsung_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Samsung_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Sanyo_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Sanyo_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Sanyo_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Sanyo_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Sharp_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Sharp_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Sharp_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Sharp_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Sherwood_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Sherwood_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Sherwood_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Sherwood_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Sony_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Sony_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Sony_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Sony_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Tcl_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Tcl_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Tcl_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Tcl_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Teco_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Teco_test.cpp old mode 100644 new mode 100755 similarity index 86% rename from lib/IRremoteESP8266-2.6.4/test/ir_Teco_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Teco_test.cpp index aeacfcc68..4ed7fbd9f --- a/lib/IRremoteESP8266-2.6.4/test/ir_Teco_test.cpp +++ b/lib/IRremoteESP8266-2.6.5/test/ir_Teco_test.cpp @@ -198,26 +198,72 @@ TEST(TestTecoACClass, Sleep) { EXPECT_TRUE(ac.getSleep()); } +TEST(TestTecoACClass, Light) { + IRTecoAc ac(0); + ac.begin(); + + ac.setLight(true); + EXPECT_TRUE(ac.getLight()); + ac.setLight(false); + EXPECT_EQ(false, ac.getLight()); + ac.setLight(true); + EXPECT_TRUE(ac.getLight()); + // Ref: https://github.com/crankyoldgit/IRremoteESP8266/issues/870#issue-484797174 + ac.setRaw(0x250200A09); + EXPECT_TRUE(ac.getLight()); +} + +TEST(TestTecoACClass, Humid) { + IRTecoAc ac(0); + ac.begin(); + + ac.setHumid(true); + EXPECT_TRUE(ac.getHumid()); + ac.setHumid(false); + EXPECT_EQ(false, ac.getHumid()); + ac.setHumid(true); + EXPECT_TRUE(ac.getHumid()); + // Ref: https://github.com/crankyoldgit/IRremoteESP8266/issues/870#issuecomment-524536810 + ac.setRaw(0x250100A09); + EXPECT_TRUE(ac.getHumid()); +} + +TEST(TestTecoACClass, Save) { + IRTecoAc ac(0); + ac.begin(); + + ac.setSave(true); + EXPECT_TRUE(ac.getSave()); + ac.setSave(false); + EXPECT_EQ(false, ac.getSave()); + ac.setSave(true); + EXPECT_TRUE(ac.getSave()); + // Ref: https://github.com/crankyoldgit/IRremoteESP8266/issues/870#issuecomment-524536810 + ac.setRaw(0x250800A09); + EXPECT_TRUE(ac.getSave()); +} + TEST(TestTecoACClass, MessageConstuction) { IRTecoAc ac(0); EXPECT_EQ( "Power: Off, Mode: 0 (AUTO), Temp: 16C, Fan: 0 (Auto), Sleep: Off, " - "Swing: Off", + "Swing: Off, Light: Off, Humid: Off, Save: Off", ac.toString()); ac.setPower(true); ac.setMode(kTecoCool); ac.setTemp(21); ac.setFan(kTecoFanHigh); ac.setSwing(false); + ac.setLight(false); EXPECT_EQ( "Power: On, Mode: 1 (COOL), Temp: 21C, Fan: 3 (High), Sleep: Off, " - "Swing: Off", + "Swing: Off, Light: Off, Humid: Off, Save: Off", ac.toString()); ac.setSwing(true); EXPECT_EQ( "Power: On, Mode: 1 (COOL), Temp: 21C, Fan: 3 (High), Sleep: Off, " - "Swing: On", + "Swing: On, Light: Off, Humid: Off, Save: Off", ac.toString()); ac.setSwing(false); ac.setFan(kTecoFanLow); @@ -225,17 +271,20 @@ TEST(TestTecoACClass, MessageConstuction) { ac.setMode(kTecoHeat); EXPECT_EQ( "Power: On, Mode: 4 (HEAT), Temp: 21C, Fan: 1 (Low), Sleep: On, " - "Swing: Off", + "Swing: Off, Light: Off, Humid: Off, Save: Off", ac.toString()); ac.setSleep(false); EXPECT_EQ( "Power: On, Mode: 4 (HEAT), Temp: 21C, Fan: 1 (Low), Sleep: Off, " - "Swing: Off", + "Swing: Off, Light: Off, Humid: Off, Save: Off", ac.toString()); ac.setTemp(25); + ac.setLight(true); + ac.setSave(true); + ac.setHumid(true); EXPECT_EQ( "Power: On, Mode: 4 (HEAT), Temp: 25C, Fan: 1 (Low), Sleep: Off, " - "Swing: Off", + "Swing: Off, Light: On, Humid: On, Save: On", ac.toString()); } @@ -253,7 +302,7 @@ TEST(TestTecoACClass, ReconstructKnownMessage) { EXPECT_EQ(expected, ac.getRaw()); EXPECT_EQ( "Power: On, Mode: 1 (COOL), Temp: 27C, Fan: 0 (Auto), Sleep: On, " - "Swing: On", + "Swing: On, Light: Off, Humid: Off, Save: Off", ac.toString()); } @@ -295,7 +344,7 @@ TEST(TestDecodeTeco, NormalDecodeWithStrict) { ac.setRaw(irsend.capture.value); EXPECT_EQ( "Power: Off, Mode: 0 (AUTO), Temp: 16C, Fan: 0 (Auto), Sleep: Off, " - "Swing: Off", + "Swing: Off, Light: Off, Humid: Off, Save: Off", ac.toString()); } @@ -328,7 +377,7 @@ TEST(TestDecodeTeco, RealNormalExample) { ac.setRaw(irsend.capture.value); EXPECT_EQ( "Power: On, Mode: 1 (COOL), Temp: 27C, Fan: 0 (Auto), Sleep: On, " - "Swing: On", + "Swing: On, Light: Off, Humid: Off, Save: Off", ac.toString()); uint16_t rawData2[73] = { @@ -353,7 +402,7 @@ TEST(TestDecodeTeco, RealNormalExample) { ac.setRaw(irsend.capture.value); EXPECT_EQ( "Power: On, Mode: 2 (DRY), Temp: 21C, Fan: 2 (Medium), Sleep: Off, " - "Swing: On", + "Swing: On, Light: Off, Humid: Off, Save: Off", ac.toString()); } diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Toshiba_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Toshiba_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Toshiba_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Toshiba_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Trotec_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Trotec_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Trotec_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Trotec_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Vestel_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Vestel_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Vestel_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Vestel_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Whirlpool_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Whirlpool_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Whirlpool_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Whirlpool_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/test/ir_Whynter_test.cpp b/lib/IRremoteESP8266-2.6.5/test/ir_Whynter_test.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/test/ir_Whynter_test.cpp rename to lib/IRremoteESP8266-2.6.5/test/ir_Whynter_test.cpp diff --git a/lib/IRremoteESP8266-2.6.4/tools/Makefile b/lib/IRremoteESP8266-2.6.5/tools/Makefile old mode 100644 new mode 100755 similarity index 98% rename from lib/IRremoteESP8266-2.6.4/tools/Makefile rename to lib/IRremoteESP8266-2.6.5/tools/Makefile index 7ae48d392..d2da05eb3 --- a/lib/IRremoteESP8266-2.6.4/tools/Makefile +++ b/lib/IRremoteESP8266-2.6.5/tools/Makefile @@ -51,7 +51,7 @@ PROTOCOLS = ir_NEC.o ir_Sony.o ir_Samsung.o ir_JVC.o ir_RCMM.o ir_RC5_RC6.o \ ir_GICable.o ir_Whirlpool.o ir_Lutron.o ir_Electra.o ir_Pioneer.o \ ir_MWM.o ir_Vestel.o ir_Teco.o ir_Tcl.o ir_Lego.o \ ir_MitsubishiHeavy.o ir_Goodweather.o ir_Inax.o ir_Argo.o \ - ir_Trotec.o ir_Neoclima.o + ir_Trotec.o ir_Neoclima.o ir_Amcor.o # Common object files COMMON_OBJ = IRutils.o IRtimer.o IRsend.o IRrecv.o $(PROTOCOLS) @@ -227,3 +227,6 @@ ir_Goodweather.o : $(USER_DIR)/ir_Goodweather.cpp $(USER_DIR)/ir_Goodweather.h $ ir_Neoclima.o : $(USER_DIR)/ir_Neoclima.cpp $(USER_DIR)/ir_Neoclima.h $(COMMON_DEPS) $(GTEST_HEADERS) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) -c $(USER_DIR)/ir_Neoclima.cpp + +ir_Amcor.o : $(USER_DIR)/ir_Amcor.cpp $(USER_DIR)/ir_Amcor.h $(GTEST_HEADERS) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) -c $(USER_DIR)/ir_Amcor.cpp diff --git a/lib/IRremoteESP8266-2.6.4/tools/RawToGlobalCache.sh b/lib/IRremoteESP8266-2.6.5/tools/RawToGlobalCache.sh similarity index 100% rename from lib/IRremoteESP8266-2.6.4/tools/RawToGlobalCache.sh rename to lib/IRremoteESP8266-2.6.5/tools/RawToGlobalCache.sh diff --git a/lib/IRremoteESP8266-2.6.4/tools/auto_analyse_raw_data.py b/lib/IRremoteESP8266-2.6.5/tools/auto_analyse_raw_data.py similarity index 100% rename from lib/IRremoteESP8266-2.6.4/tools/auto_analyse_raw_data.py rename to lib/IRremoteESP8266-2.6.5/tools/auto_analyse_raw_data.py diff --git a/lib/IRremoteESP8266-2.6.4/tools/auto_analyse_raw_data_test.py b/lib/IRremoteESP8266-2.6.5/tools/auto_analyse_raw_data_test.py similarity index 100% rename from lib/IRremoteESP8266-2.6.4/tools/auto_analyse_raw_data_test.py rename to lib/IRremoteESP8266-2.6.5/tools/auto_analyse_raw_data_test.py diff --git a/lib/IRremoteESP8266-2.6.4/tools/gc_decode.cpp b/lib/IRremoteESP8266-2.6.5/tools/gc_decode.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/tools/gc_decode.cpp rename to lib/IRremoteESP8266-2.6.5/tools/gc_decode.cpp diff --git a/lib/IRremoteESP8266-2.6.4/tools/mkkeywords b/lib/IRremoteESP8266-2.6.5/tools/mkkeywords similarity index 100% rename from lib/IRremoteESP8266-2.6.4/tools/mkkeywords rename to lib/IRremoteESP8266-2.6.5/tools/mkkeywords diff --git a/lib/IRremoteESP8266-2.6.4/tools/mode2_decode.cpp b/lib/IRremoteESP8266-2.6.5/tools/mode2_decode.cpp old mode 100644 new mode 100755 similarity index 100% rename from lib/IRremoteESP8266-2.6.4/tools/mode2_decode.cpp rename to lib/IRremoteESP8266-2.6.5/tools/mode2_decode.cpp diff --git a/lib/IRremoteESP8266-2.6.4/tools/scrape_supported_devices.py b/lib/IRremoteESP8266-2.6.5/tools/scrape_supported_devices.py similarity index 100% rename from lib/IRremoteESP8266-2.6.4/tools/scrape_supported_devices.py rename to lib/IRremoteESP8266-2.6.5/tools/scrape_supported_devices.py diff --git a/platformio.ini b/platformio.ini index b92cf42ee..d19018416 100755 --- a/platformio.ini +++ b/platformio.ini @@ -13,12 +13,14 @@ build_dir = .pioenvs ; *** Uncomment one of the lines below to build/upload only one environment ;default_envs = sonoff +;default_envs = sonoff-ircustom ; alternative to 'sonoff' with full IR protocols activated, you will need to disable some features to keep code not too big ;default_envs = sonoff-minimal ;default_envs = sonoff-basic ;default_envs = sonoff-classic ;default_envs = sonoff-knx ;default_envs = sonoff-sensors ;default_envs = sonoff-display +;default_envs = sonoff-ir ;default_envs = sonoff-BG ;default_envs = sonoff-BR ;default_envs = sonoff-CN @@ -200,6 +202,8 @@ build_flags = ${core_active.build_flags} ; -DFIRMWARE_BASIC ; -DFIRMWARE_KNX_NO_EMULATION ; -DFIRMWARE_DISPLAYS +; -DFIRMWARE_IR +; -DFIRMWARE_IR_CUSTOM ; -DUSE_CONFIG_OVERRIDE ; *** Fix espressif8266@1.7.0 induced undesired all warnings @@ -325,6 +329,34 @@ upload_resetmethod = ${common.upload_resetmethod} upload_speed = ${common.upload_speed} extra_scripts = ${common.extra_scripts} +[env:sonoff-ir] +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board} +board_build.flash_mode = ${common.board_build.flash_mode} +board_build.f_cpu = ${common.board_build.f_cpu} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} -DUSE_IR_REMOTE_FULL -DFIRMWARE_IR +monitor_speed = ${common.monitor_speed} +upload_port = ${common.upload_port} +upload_resetmethod = ${common.upload_resetmethod} +upload_speed = ${common.upload_speed} +extra_scripts = ${common.extra_scripts} + +[env:sonoff-ircustom] +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board} +board_build.flash_mode = ${common.board_build.flash_mode} +board_build.f_cpu = ${common.board_build.f_cpu} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} -DUSE_IR_REMOTE_FULL +monitor_speed = ${common.monitor_speed} +upload_port = ${common.upload_port} +upload_resetmethod = ${common.upload_resetmethod} +upload_speed = ${common.upload_speed} +extra_scripts = ${common.extra_scripts} + [env:sonoff-BG] platform = ${common.platform} framework = ${common.framework} diff --git a/sonoff/_changelog.ino b/sonoff/_changelog.ino index edcfbd87b..5af2e716f 100644 --- a/sonoff/_changelog.ino +++ b/sonoff/_changelog.ino @@ -3,6 +3,7 @@ * Change theoretical baudrate range to 300..19660500 bps in 300 increments (#6294) * Add Full support of all protocols in IRremoteESP8266, to be used on dedicated-IR Tasmota version. Warning: +81k Flash when compiling with USE_IR_REMOTE_FULL * Add compile time define USE_WS2812_HARDWARE to select hardware type WS2812, WS2812X, WS2813, SK6812, LC8812 or APA106 (DMA mode only) + * Add 'sonoff-ir' pre-packaged IR-dedicated firmware and 'sonoff-ircustom' to customize firmware with IR Full protocol support * * 6.6.0.8 20190827 * Add Tuya Energy monitoring by Shantur Rathore diff --git a/sonoff/i18n.h b/sonoff/i18n.h index 38f524e4c..ee7ffdc6c 100644 --- a/sonoff/i18n.h +++ b/sonoff/i18n.h @@ -574,7 +574,7 @@ const char kPrefixes[3][PRFX_MAX_STRING_LENGTH] PROGMEM = { D_STAT, D_TELE }; -const char kCodeImage[] PROGMEM = "sonoff|minimal|classic|sensors|knx|basic|display"; +const char kCodeImage[] PROGMEM = "sonoff|minimal|classic|sensors|knx|basic|display|ir"; // support.ino static const char kMonthNames[] = D_MONTH3LIST; diff --git a/sonoff/my_user_config.h b/sonoff/my_user_config.h index c5c9ad799..ecfa4c9c9 100644 --- a/sonoff/my_user_config.h +++ b/sonoff/my_user_config.h @@ -449,9 +449,17 @@ #define MAX31865_REF_RES 430 // Reference resistor (Usually 430Ω for a PT100, 4300Ω for a PT1000) #define MAX31865_PTD_BIAS 0 // To calibrate your not-so-good PTD -// -- IR Remote features -------------------------- -//#define USE_IR_REMOTE_FULL // Activate all protocols from IRremoteESP8266 - // actovating this option will ignore all other USE_IR_REMOTE_* options and set them all to active +// -- IR Remote features - all protocols from IRremoteESP8266 -------------------------- +// IR Full Protocols mode is activated through platform.io only. +// Either use 'default_envs = sonoff-ircustom' and disable some features here to keep code not too big +// or use 'default_envs = sonoff-ir' for a pre-packaged IR-dedicated firmware +// When using 'sonoff-ircustom' or 'sonoff-ir', parameters below +// (USE_IR_REMOTE, USE_IR_RECEIVE, USE_IR_HVAC...) are IGNORED. +// +// Code impact of IR full protocols is +81k code, 3k mem +// You can reduce this size by disabling some protocols in "lib/IRremoteESP8266.x.x.x/src/IRremoteESP8266.h" + +// -- IR Remote features - subset of IR protocols -------------------------- #define USE_IR_REMOTE // Send IR remote commands using library IRremoteESP8266 and ArduinoJson (+4k3 code, 0k3 mem, 48 iram) // #define USE_IR_SEND_AIWA // Support IRsend Aiwa protocol #define USE_IR_SEND_DISH // Support IRsend Dish protocol @@ -533,6 +541,8 @@ //#define FIRMWARE_SENSORS // Create sonoff-sensors with useful sensors enabled //#define FIRMWARE_KNX_NO_EMULATION // Create sonoff-knx with KNX but without Emulation //#define FIRMWARE_DISPLAYS // Create sonoff-display with display drivers enabled +//#define FIRMWARE_IR // Create sonoff-ir with IR full protocols activated, and many sensors disabled +//#define FIRMWARE_IR_CUSTOM // Create sonoff customizable with special marker to add all IR protocols //#define FIRMWARE_MINIMAL // Create sonoff-minimal as intermediate firmware for OTA-MAGIC /*********************************************************************************************\ diff --git a/sonoff/sonoff_post.h b/sonoff/sonoff_post.h index 01076e035..db0dcc676 100644 --- a/sonoff/sonoff_post.h +++ b/sonoff/sonoff_post.h @@ -317,6 +317,81 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c #undef USE_RF_FLASH // Remove support for flashing the EFM8BB1 chip on the Sonoff RF Bridge. C2CK must be connected to GPIO4, C2D to GPIO5 on the PCB (-3k code) #endif // FIRMWARE_DISPLAYS +/*********************************************************************************************\ + * [sonoff-ir.bin] + * Provide a dedicated image with IR full protocol support, with limited additional features +\*********************************************************************************************/ + +#ifdef FIRMWARE_IR + +#undef CODE_IMAGE +#define CODE_IMAGE 7 + +#define USE_IR_REMOTE_FULL // activate full support of IR protocols + +#undef USE_EMULATION_HUE // disable Hue emulation - only for lights and relays +//#undef USE_EMULATION_WEMO // disable Wemo emulation - only for relays + +//#undef USE_DOMOTICZ // Disable Domoticz +//#undef USE_HOME_ASSISTANT // Disable Home Assistant +//#undef USE_KNX // Disable KNX IP Protocol Support +//#undef USE_CUSTOM // Disable Custom features +//#undef USE_TIMERS // Disable support for up to 16 timers +//#undef USE_TIMERS_WEB // Disable support for timer webpage +//#undef USE_SUNRISE // Disable support for Sunrise and sunset tools +//#undef USE_RULES // Disable support for rules +//#undef USE_DISCOVERY // Disable mDNS for the following services (+8k code or +23.5k code with core 2_5_x, +0.3k mem) + +// -- Optional modules ------------------------- +#undef USE_BUZZER // Disable support for a buzzer (+0k6 code) +#undef USE_SONOFF_IFAN // Disable support for Sonoff iFan02 and iFan03 (+2k code) +#undef USE_TUYA_DIMMER // Disable support for Tuya Serial Dimmer +#undef USE_ARMTRONIX_DIMMERS // Disable support for Armtronix Dimmers (+1k4 code) +#undef USE_PS_16_DZ // Disable support for PS-16-DZ Dimmer and Sonoff L1 (+2k code) +#undef USE_DS18x20 // Disable Optional for more than one DS18x20 sensors with id sort, single scan and read retry (+1k3 code) + +#undef USE_I2C // Disable all I2C sensors +#undef USE_SPI // Disable all SPI devices + +#undef USE_MHZ19 // Disable support for MH-Z19 CO2 sensor +#undef USE_SENSEAIR // Disable support for SenseAir K30, K70 and S8 CO2 sensor +#undef USE_PMS5003 // Disable support for PMS5003 and PMS7003 particle concentration sensor +#undef USE_NOVA_SDS // Disable support for SDS011 and SDS021 particle concentration sensor +#undef USE_SERIAL_BRIDGE // Disable support for software Serial Bridge +#undef USE_SDM120 // Disable support for Eastron SDM120-Modbus energy meter +#undef USE_SDM630 // Disable support for Eastron SDM630-Modbus energy meter +#undef USE_MP3_PLAYER // Disable DFPlayer Mini MP3 Player RB-DFR-562 commands: play, volume and stop +#undef USE_AZ7798 // Disable support for AZ-Instrument 7798 CO2 datalogger +#undef USE_PN532_HSU // Disable support for PN532 using HSU (Serial) interface (+1k8 code, 140 bytes mem) +#undef USE_RDM6300 // Disable support for RDM6300 125kHz RFID Reader (+0k8) +#undef USE_IBEACON // Disable support for bluetooth LE passive scan of ibeacon devices (uses HM17 module) + +#undef USE_ENERGY_SENSOR // Disable Use energy sensors (+14k code) +#undef USE_ENERGY_MARGIN_DETECTION // Disable support for Energy Margin detection (+1k6 code) +#undef USE_PZEM004T // Disable PZEM004T energy sensor +#undef USE_PZEM_AC // Disable PZEM014,016 Energy monitor +#undef USE_PZEM_DC // Disable PZEM003,017 Energy monitor +#undef USE_MCP39F501 // Disable support for MCP39F501 Energy monitor as used in Shelly 2 (+3k1 code) +//#define USE_DHT // Add support for DHT11, AM2301 (DHT21, DHT22, AM2302, AM2321) and SI7021 Temperature and Humidity sensor +#undef USE_MAX31855 // Disable MAX31855 K-Type thermocouple sensor using softSPI +#undef USE_WS2812 // Disable WS2812 Led string using library NeoPixelBus (+5k code, +1k mem, 232 iram) - Disable by // +#undef USE_ARILUX_RF // Disable support for Arilux RF remote controller +#undef USE_SR04 // Disable support for for HC-SR04 ultrasonic devices +#undef USE_TM1638 // Disable support for TM1638 switches copying Switch1 .. Switch8 +#undef USE_HX711 // Disable support for HX711 load cell +#undef USE_RF_FLASH // Disable support for flashing the EFM8BB1 chip on the Sonoff RF Bridge. C2CK must be connected to GPIO4, C2D to GPIO5 on the PCB +#undef USE_TX20_WIND_SENSOR // Disable support for La Crosse TX20 anemometer +#undef USE_RC_SWITCH // Disable support for RF transceiver using library RcSwitch +#undef USE_RF_SENSOR // Disable support for RF sensor receiver (434MHz or 868MHz) (+0k8 code) +#undef USE_SM16716 // Disable support for SM16716 RGB LED controller (+0k7 code) +#undef USE_HRE // Disable support for Badger HR-E Water Meter (+1k4 code) +#undef DEBUG_THEO // Disable debug code +#undef USE_DEBUG_DRIVER // Disable debug code + +//#undef USE_LIGHT // Also disable all Dimmer/Light support + +#endif // FIRMWARE_IR + /*********************************************************************************************\ * Mandatory define for DS18x20 if changed by above image selections \*********************************************************************************************/